Changeset 52856 in webkit for trunk/JavaScriptCore/runtime/UStringImpl.h
- Timestamp:
- Jan 6, 2010, 11:33:29 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/UStringImpl.h
r52776 r52856 138 138 unsigned computedHash() const { ASSERT(m_hash); return m_hash; } // fast path for Identifiers 139 139 void setHash(unsigned hash) { ASSERT(hash == computeHash(data(), m_length)); m_hash = hash; } // fast path for Identifiers 140 bool isIdentifier() const { return m_identifierTable; } 141 IdentifierTable* identifierTable() const { return m_identifierTable; } 142 void setIdentifierTable(IdentifierTable* table) { ASSERT(!isStatic()); m_identifierTable = table; } 140 bool isIdentifier() const { return m_isIdentifier; } 141 void setIsIdentifier(bool isIdentifier) { m_isIdentifier = isIdentifier; } 143 142 144 143 UStringImpl* ref() { m_refCount += s_refCountIncrement; return this; } … … 174 173 ASSERT(bufferOwnerString()->bufferOwnership() != BufferSubstring); 175 174 // Static strings cannot be put in identifier tables, because they are globally shared. 176 ASSERT(!isStatic() || !i dentifierTable());175 ASSERT(!isStatic() || !isIdentifier()); 177 176 } 178 177 … … 194 193 , m_refCount(s_refCountIncrement) 195 194 , m_hash(0) 196 , m_i dentifierTable(0)195 , m_isIdentifier(false) 197 196 , m_dataBuffer(0, ownership) 198 197 { … … 210 209 , m_refCount(s_staticRefCountInitialValue) 211 210 , m_hash(0) 212 , m_i dentifierTable(0)211 , m_isIdentifier(false) 213 212 , m_dataBuffer(0, BufferOwned) 214 213 { … … 222 221 , m_refCount(s_refCountIncrement) 223 222 , m_hash(0) 224 , m_i dentifierTable(0)223 , m_isIdentifier(false) 225 224 , m_dataBuffer(base.releaseRef(), BufferSubstring) 226 225 { … … 239 238 , m_refCount(s_refCountIncrement) 240 239 , m_hash(0) 241 , m_i dentifierTable(0)240 , m_isIdentifier(false) 242 241 , m_dataBuffer(sharedBuffer.releaseRef(), BufferShared) 243 242 { … … 269 268 int m_length; 270 269 unsigned m_refCount; 271 mutable unsigned m_hash ;272 IdentifierTable* m_identifierTable;270 mutable unsigned m_hash : 31; 271 mutable unsigned m_isIdentifier : 1; 273 272 UntypedPtrAndBitfield m_dataBuffer; 274 273
Note:
See TracChangeset
for help on using the changeset viewer.