Changeset 32609 in webkit for trunk/JavaScriptCore/kjs/JSVariableObject.h
- Timestamp:
- Apr 27, 2008, 10:59:07 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSVariableObject.h
r32587 r32609 91 91 inline bool JSVariableObject::symbolTableGet(const Identifier& propertyName, PropertySlot& slot) 92 92 { 93 size_t index = symbolTable().get(propertyName.ustring().rep()); 94 if (index != missingSymbolMarker()) { 93 size_t index = symbolTable().inlineGet(propertyName.ustring().rep()); 94 if (index == missingSymbolMarker()) 95 return false; 95 96 #ifndef NDEBUG 96 // During initialization, the variable object needs to advertise that it has certain 97 // properties, even if they're not ready for access yet. This check verifies that 98 // no one tries to access such a property. 99 100 // In a release build, we optimize this check away and just return an invalid pointer. 101 // There's no harm in an invalid pointer, since no one dereferences it. 102 if (index >= d->localStorage.size()) { 103 slot.setUngettable(this); 104 return true; 105 } 106 #endif 107 slot.setValueSlot(this, &d->localStorage[index].value); 97 // During initialization, the variable object needs to advertise that it has certain 98 // properties, even if they're not ready for access yet. This check verifies that 99 // no one tries to access such a property. In a release build, we optimize this check 100 // away and just return an invalid pointer. There's no harm in an invalid pointer, 101 // since no one dereferences it. 102 if (index >= d->localStorage.size()) { 103 slot.setUngettable(this); 108 104 return true; 109 105 } 110 return false; 106 #endif 107 slot.setValueSlot(this, &d->localStorage[index].value); 108 return true; 111 109 } 112 110 113 111 inline bool JSVariableObject::symbolTablePut(const Identifier& propertyName, JSValue* value) 114 112 { 115 size_t index = symbolTable(). get(propertyName.ustring().rep());113 size_t index = symbolTable().inlineGet(propertyName.ustring().rep()); 116 114 if (index == missingSymbolMarker()) 117 115 return false; … … 133 131 return true; 134 132 } 135 133 136 134 inline bool JSVariableObject::symbolTableInsert(const Identifier& propertyName, JSValue* value, unsigned attributes) 137 135 { 138 136 if (symbolTable().get(propertyName.ustring().rep()) != missingSymbolMarker()) 139 137 return false; 140 141 ASSERT((attributes & DontDelete) != 0);142 138 size_t localStorageIndex = d->localStorage.size(); 143 139 d->localStorage.append(LocalStorageEntry(value, attributes)); … … 145 141 return true; 146 142 } 143 147 144 } // namespace KJS 148 145
Note:
See TracChangeset
for help on using the changeset viewer.