Changeset 37321 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Oct 5, 2008, 5:58:42 PM (17 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/PropertyMap.cpp
r36847 r37321 115 115 } 116 116 117 voidPropertyMap::put(const Identifier& propertyName, JSValue* value, unsigned attributes, bool checkReadOnly, JSObject* slotBase, PutPropertySlot& slot, PropertyStorage& propertyStorage)117 size_t PropertyMap::put(const Identifier& propertyName, JSValue* value, unsigned attributes, bool checkReadOnly, JSObject* slotBase, PutPropertySlot& slot, PropertyStorage& propertyStorage) 118 118 { 119 119 ASSERT(!propertyName.isNull()); … … 145 145 if (m_table->entries()[entryIndex - 1].key == rep) { 146 146 if (checkReadOnly && (m_table->entries()[entryIndex - 1].attributes & ReadOnly)) 147 return ;147 return WTF::notFound; 148 148 // Put a new value in an existing hash table entry. 149 149 propertyStorage[entryIndex - 2] = value; 150 150 // Attributes are intentionally not updated. 151 151 slot.setExistingProperty(slotBase, entryIndex - 2); 152 return ;152 return entryIndex - 2; 153 153 } else if (entryIndex == deletedSentinelIndex) { 154 154 // If we find a deleted-element sentinel, remember it for use later. … … 203 203 checkConsistency(propertyStorage); 204 204 slot.setNewProperty(slotBase, entryIndex - 2); 205 return entryIndex - 2; 205 206 } 206 207 -
trunk/JavaScriptCore/kjs/PropertyMap.h
r36847 r37321 95 95 bool isEmpty() { return !m_table; } 96 96 97 voidput(const Identifier& propertyName, JSValue*, unsigned attributes, bool checkReadOnly, JSObject* slotBase, PutPropertySlot&, PropertyStorage&);97 size_t put(const Identifier& propertyName, JSValue*, unsigned attributes, bool checkReadOnly, JSObject* slotBase, PutPropertySlot&, PropertyStorage&); 98 98 void remove(const Identifier& propertyName, PropertyStorage&); 99 99 -
trunk/JavaScriptCore/kjs/StructureID.cpp
r37300 r37321 45 45 , m_nameInPrevious(0) 46 46 , m_transitionCount(0) 47 , m_cachedTransistionOffset(WTF::notFound) 47 48 { 48 49 ASSERT(m_prototype); … … 117 118 slotBase->allocatePropertyStorage(structureID->m_propertyMap.size(), existingTransition->m_propertyMap.size()); 118 119 119 size_t offset = existingTransition-> propertyMap().getOffset(propertyName);120 size_t offset = existingTransition->cachedTransistionOffset(); 120 121 ASSERT(offset != WTF::notFound); 121 122 propertyStorage[offset] = value; … … 139 140 transition->m_propertyMap = structureID->m_propertyMap; 140 141 141 transition->m_propertyMap.put(propertyName, value, attributes, false, slotBase, slot, propertyStorage); 142 size_t offset = transition->m_propertyMap.put(propertyName, value, attributes, false, slotBase, slot, propertyStorage); 143 transition->setCachedTransistionOffset(offset); 142 144 143 145 structureID->m_transitionTable.add(make_pair(propertyName.ustring().rep(), attributes), transition.get()); -
trunk/JavaScriptCore/kjs/StructureID.h
r36789 r37321 116 116 PropertyMap& propertyMap() { return m_propertyMap; } 117 117 118 void setCachedTransistionOffset(size_t offset) { m_cachedTransistionOffset = offset; } 119 size_t cachedTransistionOffset() const { return m_cachedTransistionOffset; } 120 118 121 void getEnumerablePropertyNames(ExecState*, PropertyNameArray&, JSObject*); 119 122 void clearEnumerationCache(); … … 146 149 147 150 PropertyMap m_propertyMap; 151 152 size_t m_cachedTransistionOffset; 148 153 }; 149 154
Note:
See TracChangeset
for help on using the changeset viewer.