Changeset 77269 in webkit for trunk/Source/JavaScriptCore/runtime/JSObject.h
- Timestamp:
- Feb 1, 2011, 12:17:21 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSObject.h
r77151 r77269 156 156 } 157 157 158 JSValue* getDirectLocation(const Identifier& propertyName)158 WriteBarrierBase<Unknown>* getDirectLocation(const Identifier& propertyName) 159 159 { 160 160 size_t offset = m_structure->get(propertyName); … … 162 162 } 163 163 164 JSValue* getDirectLocation(const Identifier& propertyName, unsigned& attributes)164 WriteBarrierBase<Unknown>* getDirectLocation(const Identifier& propertyName, unsigned& attributes) 165 165 { 166 166 JSCell* specificFunction; … … 169 169 } 170 170 171 size_t offsetForLocation( JSValue* location) const172 { 173 return location - reinterpret_cast<const JSValue*>(propertyStorage());171 size_t offsetForLocation(WriteBarrierBase<Unknown>* location) const 172 { 173 return location - propertyStorage(); 174 174 } 175 175 … … 199 199 void putUndefinedAtDirectOffset(size_t offset) { propertyStorage()[offset].setUndefined(); } 200 200 201 void fillGetterPropertySlot(PropertySlot&, JSValue* location);201 void fillGetterPropertySlot(PropertySlot&, WriteBarrierBase<Unknown>* location); 202 202 203 203 virtual void defineGetter(ExecState*, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes = 0); … … 232 232 } 233 233 234 void putAnonymousValue( unsigned index, JSValue value)234 void putAnonymousValue(JSGlobalData& globalData, unsigned index, JSValue value) 235 235 { 236 236 ASSERT(index < m_structure->anonymousSlotCount()); 237 *locationForOffset(index) = value; 237 locationForOffset(index)->set(globalData, this, value); 238 } 239 void clearAnonymousValue(unsigned index) 240 { 241 ASSERT(index < m_structure->anonymousSlotCount()); 242 locationForOffset(index)->clear(); 238 243 } 239 244 JSValue getAnonymousValue(unsigned index) const 240 245 { 241 246 ASSERT(index < m_structure->anonymousSlotCount()); 242 return *locationForOffset(index);247 return locationForOffset(index)->get(); 243 248 } 244 249 245 250 protected: 246 251 static const unsigned StructureFlags = 0; 252 253 void putThisToAnonymousValue(unsigned index) 254 { 255 locationForOffset(index)->setWithoutWriteBarrier(this); 256 } 247 257 248 258 private: … … 255 265 void isObject(); 256 266 void isString(); 257 267 258 268 ConstPropertyStorage propertyStorage() const { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); } 259 269 PropertyStorage propertyStorage() { return (isUsingInlineStorage() ? m_inlineStorage : m_externalStorage); } 260 270 261 const JSValue* locationForOffset(size_t offset) const262 { 263 return reinterpret_cast<const JSValue*>(&propertyStorage()[offset]);264 } 265 266 JSValue* locationForOffset(size_t offset)267 { 268 return reinterpret_cast<JSValue*>(&propertyStorage()[offset]);271 const WriteBarrierBase<Unknown>* locationForOffset(size_t offset) const 272 { 273 return &propertyStorage()[offset]; 274 } 275 276 WriteBarrierBase<Unknown>* locationForOffset(size_t offset) 277 { 278 return &propertyStorage()[offset]; 269 279 } 270 280 … … 374 384 ALWAYS_INLINE bool JSObject::inlineGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 375 385 { 376 if ( JSValue* location = getDirectLocation(propertyName)) {377 if (m_structure->hasGetterSetterProperties() && location [0].isGetterSetter())386 if (WriteBarrierBase<Unknown>* location = getDirectLocation(propertyName)) { 387 if (m_structure->hasGetterSetterProperties() && location->isGetterSetter()) 378 388 fillGetterPropertySlot(slot, location); 379 389 else 380 slot.setValue Slot(this, location, offsetForLocation(location));390 slot.setValue(this, location->get(), offsetForLocation(location)); 381 391 return true; 382 392 }
Note:
See TracChangeset
for help on using the changeset viewer.