Changeset 37400 in webkit
- Timestamp:
- Oct 7, 2008 4:49:59 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37388 r37400 1 2008-10-07 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Cameron Zwarich. 4 5 Move hasGetterSetterProperties flag from PropertyMap to StructureID. 6 7 * kjs/JSObject.cpp: 8 (JSC::JSObject::put): 9 (JSC::JSObject::defineGetter): 10 (JSC::JSObject::defineSetter): 11 * kjs/JSObject.h: 12 (JSC::JSObject::hasGetterSetterProperties): 13 (JSC::JSObject::getOwnPropertySlotForWrite): 14 (JSC::JSObject::getOwnPropertySlot): 15 * kjs/PropertyMap.h: 16 * kjs/StructureID.cpp: 17 (JSC::StructureID::StructureID): 18 (JSC::StructureID::addPropertyTransition): 19 (JSC::StructureID::toDictionaryTransition): 20 (JSC::StructureID::changePrototypeTransition): 21 (JSC::StructureID::getterSetterTransition): 22 * kjs/StructureID.h: 23 (JSC::StructureID::hasGetterSetterProperties): 24 (JSC::StructureID::setHasGetterSetterProperties): 25 1 26 2008-10-07 Sam Weinig <sam@webkit.org> 2 27 -
trunk/JavaScriptCore/kjs/JSObject.cpp
r37388 r37400 126 126 // Check if there are any setters or getters in the prototype chain 127 127 JSValue* prototype; 128 for (JSObject* obj = this; !obj->structureID()-> propertyMap().hasGetterSetterProperties(); obj = static_cast<JSObject*>(prototype)) {128 for (JSObject* obj = this; !obj->structureID()->hasGetterSetterProperties(); obj = static_cast<JSObject*>(prototype)) { 129 129 prototype = obj->prototype(); 130 130 if (prototype->isNull()) { … … 293 293 JSValue* object = getDirect(propertyName); 294 294 if (object && object->isGetterSetter()) { 295 ASSERT(m_structureID-> propertyMap().hasGetterSetterProperties());295 ASSERT(m_structureID->hasGetterSetterProperties()); 296 296 GetterSetter* getterSetter = static_cast<GetterSetter*>(object); 297 297 getterSetter->setGetter(getterFunction); … … 313 313 } 314 314 315 m_structureID-> propertyMap().setHasGetterSetterProperties(true);315 m_structureID->setHasGetterSetterProperties(true); 316 316 getterSetter->setGetter(getterFunction); 317 317 } … … 321 321 JSValue* object = getDirect(propertyName); 322 322 if (object && object->isGetterSetter()) { 323 ASSERT(m_structureID-> propertyMap().hasGetterSetterProperties());323 ASSERT(m_structureID->hasGetterSetterProperties()); 324 324 GetterSetter* getterSetter = static_cast<GetterSetter*>(object); 325 325 getterSetter->setSetter(setterFunction); … … 341 341 } 342 342 343 m_structureID-> propertyMap().setHasGetterSetterProperties(true);343 m_structureID->setHasGetterSetterProperties(true); 344 344 getterSetter->setSetter(setterFunction); 345 345 } -
trunk/JavaScriptCore/kjs/JSObject.h
r37388 r37400 153 153 void removeDirect(const Identifier& propertyName); 154 154 bool hasCustomProperties() { return !m_structureID->propertyMap().isEmpty(); } 155 bool hasGetterSetterProperties() { return m_structureID-> propertyMap().hasGetterSetterProperties(); }155 bool hasGetterSetterProperties() { return m_structureID->hasGetterSetterProperties(); } 156 156 157 157 void putDirect(const Identifier& propertyName, JSValue* value, unsigned attr = 0); … … 314 314 unsigned attributes; 315 315 if (JSValue** location = getDirectLocation(propertyName, attributes)) { 316 if (m_structureID-> propertyMap().hasGetterSetterProperties() && location[0]->isGetterSetter()) {316 if (m_structureID->hasGetterSetterProperties() && location[0]->isGetterSetter()) { 317 317 slotIsWriteable = false; 318 318 fillGetterPropertySlot(slot, location); … … 340 340 { 341 341 if (JSValue** location = getDirectLocation(propertyName)) { 342 if (m_structureID-> propertyMap().hasGetterSetterProperties() && location[0]->isGetterSetter())342 if (m_structureID->hasGetterSetterProperties() && location[0]->isGetterSetter()) 343 343 fillGetterPropertySlot(slot, location); 344 344 else -
trunk/JavaScriptCore/kjs/PropertyMap.h
r37388 r37400 95 95 PropertyMap& operator=(const PropertyMap&); 96 96 97 98 97 size_t get(const Identifier& propertyName); 99 98 size_t get(const Identifier& propertyName, unsigned& attributes); … … 102 101 103 102 void getEnumerablePropertyNames(PropertyNameArray&) const; 104 105 bool hasGetterSetterProperties() const { return m_getterSetterFlag; }106 void setHasGetterSetterProperties(bool f) { m_getterSetterFlag = f; }107 103 108 104 bool isEmpty() { return !m_table; } -
trunk/JavaScriptCore/kjs/StructureID.cpp
r37388 r37400 40 40 : m_typeInfo(typeInfo) 41 41 , m_isDictionary(false) 42 , m_hasGetterSetterProperties(false) 42 43 , m_prototype(prototype) 43 44 , m_cachedPrototypeChain(0) … … 139 140 transition->m_propertyMap = structureID->m_propertyMap; 140 141 transition->m_propertyStorageCapacity = structureID->m_propertyStorageCapacity; 142 transition->m_hasGetterSetterProperties = structureID->m_hasGetterSetterProperties; 141 143 142 144 offset = transition->m_propertyMap.put(propertyName, attributes); … … 158 160 transition->m_propertyMap = structureID->m_propertyMap; 159 161 transition->m_propertyStorageCapacity = structureID->m_propertyStorageCapacity; 162 transition->m_hasGetterSetterProperties = structureID->m_hasGetterSetterProperties; 160 163 return transition.release(); 161 164 } … … 178 181 transition->m_propertyMap = structureID->m_propertyMap; 179 182 transition->m_propertyStorageCapacity = structureID->m_propertyStorageCapacity; 183 transition->m_hasGetterSetterProperties = structureID->m_hasGetterSetterProperties; 180 184 return transition.release(); 181 185 } … … 187 191 transition->m_propertyMap = structureID->m_propertyMap; 188 192 transition->m_propertyStorageCapacity = structureID->m_propertyStorageCapacity; 193 transition->m_hasGetterSetterProperties = transition->m_hasGetterSetterProperties; 189 194 return transition.release(); 190 195 } -
trunk/JavaScriptCore/kjs/StructureID.h
r37388 r37400 125 125 void clearEnumerationCache(); 126 126 127 bool hasGetterSetterProperties() const { return m_hasGetterSetterProperties; } 128 void setHasGetterSetterProperties(bool hasGetterSetterProperties) { m_hasGetterSetterProperties = hasGetterSetterProperties; } 129 127 130 private: 128 131 typedef std::pair<RefPtr<UString::Rep>, unsigned> TransitionTableKey; … … 136 139 137 140 bool m_isDictionary; 141 142 bool m_hasGetterSetterProperties; 138 143 139 144 JSValue* m_prototype;
Note: See TracChangeset
for help on using the changeset viewer.