Changeset 37989 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 29, 2008, 7:44:46 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r37985 r37989 1 2008-10-29 Sam Weinig <[email protected]> 2 3 Reviewed by Oliver Hunt. 4 5 Remove direct use of PropertyMap. 6 7 * JavaScriptCore.exp: 8 * runtime/JSObject.cpp: 9 (JSC::JSObject::mark): 10 (JSC::JSObject::put): 11 (JSC::JSObject::deleteProperty): 12 (JSC::JSObject::getPropertyAttributes): 13 (JSC::JSObject::removeDirect): 14 * runtime/JSObject.h: 15 (JSC::JSObject::getDirect): 16 (JSC::JSObject::getDirectLocation): 17 (JSC::JSObject::hasCustomProperties): 18 (JSC::JSObject::JSObject): 19 (JSC::JSObject::putDirect): 20 * runtime/PropertyMap.cpp: 21 (JSC::PropertyMap::get): 22 * runtime/PropertyMap.h: 23 (JSC::PropertyMap::isEmpty): 24 (JSC::PropertyMap::get): 25 * runtime/StructureID.cpp: 26 (JSC::StructureID::dumpStatistics): 27 * runtime/StructureID.h: 28 (JSC::StructureID::propertyStorageSize): 29 (JSC::StructureID::get): 30 (JSC::StructureID::put): 31 (JSC::StructureID::remove): 32 (JSC::StructureID::isEmpty): 33 1 34 2008-10-29 Sam Weinig <[email protected]> 2 35 -
trunk/JavaScriptCore/JavaScriptCore.exp
r37970 r37989 110 110 __ZN3JSC11ProfileNode4sortEPFbRKN3WTF6RefPtrIS0_EES5_E 111 111 __ZN3JSC11ProgramNode6createEPNS_12JSGlobalDataEPNS_14SourceElementsEPN3WTF6VectorISt4pairINS_10IdentifierEjELm16EEEPNS6_INS5_6RefPtrINS_12FuncDeclNodeEEELm16EEERKNS_10SourceCodeEji 112 __ZN3JSC11PropertyMap3getERKNS_10IdentifierERj113 112 __ZN3JSC11PropertyMap3putERKNS_10IdentifierEj 114 113 __ZN3JSC11PropertyMapD1Ev … … 305 304 __ZN3WTF8CollatorD1Ev 306 305 __ZN3WTF8fastFreeEPv 306 __ZNK3JSC11PropertyMap3getERKNS_10IdentifierERj 307 307 __ZNK3JSC12DateInstance7getTimeERdRi 308 308 __ZNK3JSC12StringObject12toThisStringEPNS_9ExecStateE -
trunk/JavaScriptCore/runtime/JSObject.cpp
r37938 r37989 70 70 m_structureID->mark(); 71 71 72 unsigned storageSize = m_structureID->propertyMap().storageSize();73 for ( unsignedi = 0; i < storageSize; ++i) {72 size_t storageSize = m_structureID->propertyStorageSize(); 73 for (size_t i = 0; i < storageSize; ++i) { 74 74 JSValue* v = m_propertyStorage[i]; 75 75 if (!v->marked()) … … 134 134 135 135 unsigned attributes; 136 if ((m_structureID-> propertyMap().get(propertyName, attributes) != WTF::notFound) && attributes & ReadOnly)136 if ((m_structureID->get(propertyName, attributes) != WTF::notFound) && attributes & ReadOnly) 137 137 return; 138 138 … … 200 200 { 201 201 unsigned attributes; 202 if (m_structureID-> propertyMap().get(propertyName, attributes) != WTF::notFound) {202 if (m_structureID->get(propertyName, attributes) != WTF::notFound) { 203 203 if ((attributes & DontDelete)) 204 204 return false; … … 410 410 bool JSObject::getPropertyAttributes(ExecState* exec, const Identifier& propertyName, unsigned& attributes) const 411 411 { 412 if (m_structureID-> propertyMap().get(propertyName, attributes) != WTF::notFound)412 if (m_structureID->get(propertyName, attributes) != WTF::notFound) 413 413 return true; 414 414 … … 468 468 size_t offset; 469 469 if (m_structureID->isDictionary()) { 470 offset = m_structureID-> propertyMap().remove(propertyName);470 offset = m_structureID->remove(propertyName); 471 471 if (offset != WTF::notFound) { 472 472 m_propertyStorage[offset] = jsUndefined(); … … 477 477 478 478 RefPtr<StructureID> structureID = StructureID::toDictionaryTransition(m_structureID); 479 offset = structureID-> propertyMap().remove(propertyName);479 offset = structureID->remove(propertyName); 480 480 if (offset != WTF::notFound) 481 481 m_propertyStorage[offset] = jsUndefined(); -
trunk/JavaScriptCore/runtime/JSObject.h
r37938 r37989 29 29 #include "ExecState.h" 30 30 #include "JSNumberCell.h" 31 #include "PropertyMap.h"32 31 #include "PropertySlot.h" 33 32 #include "PutPropertySlot.h" … … 53 52 }; 54 53 54 typedef JSValue** PropertyStorage; 55 55 56 class JSObject : public JSCell { 56 57 friend class BatchedTransitionOptimizer; … … 124 125 JSValue* getDirect(const Identifier& propertyName) const 125 126 { 126 size_t offset = m_structureID-> propertyMap().get(propertyName);127 size_t offset = m_structureID->get(propertyName); 127 128 return offset != WTF::notFound ? m_propertyStorage[offset] : noValue(); 128 129 } … … 130 131 JSValue** getDirectLocation(const Identifier& propertyName) 131 132 { 132 size_t offset = m_structureID-> propertyMap().get(propertyName);133 size_t offset = m_structureID->get(propertyName); 133 134 return offset != WTF::notFound ? locationForOffset(offset) : 0; 134 135 } … … 136 137 JSValue** getDirectLocation(const Identifier& propertyName, unsigned& attributes) 137 138 { 138 size_t offset = m_structureID-> propertyMap().get(propertyName, attributes);139 size_t offset = m_structureID->get(propertyName, attributes); 139 140 return offset != WTF::notFound ? locationForOffset(offset) : 0; 140 141 } … … 153 154 154 155 void removeDirect(const Identifier& propertyName); 155 bool hasCustomProperties() { return !m_structureID-> propertyMap().isEmpty(); }156 bool hasCustomProperties() { return !m_structureID->isEmpty(); } 156 157 bool hasGetterSetterProperties() { return m_structureID->hasGetterSetterProperties(); } 157 158 … … 221 222 ASSERT(m_structureID); 222 223 ASSERT(m_structureID->propertyStorageCapacity() == inlineStorageCapacity); 223 ASSERT(m_structureID-> propertyMap().isEmpty());224 ASSERT(m_structureID->isEmpty()); 224 225 ASSERT(prototype()->isNull() || Heap::heap(this) == Heap::heap(prototype())); 225 226 } … … 389 390 if (m_structureID->isDictionary()) { 390 391 unsigned currentAttributes; 391 size_t offset = m_structureID-> propertyMap().get(propertyName, currentAttributes);392 size_t offset = m_structureID->get(propertyName, currentAttributes); 392 393 if (offset != WTF::notFound) { 393 394 if (checkReadOnly && currentAttributes & ReadOnly) … … 399 400 400 401 size_t currentCapacity = m_structureID->propertyStorageCapacity(); 401 offset = m_structureID->p ropertyMap().put(propertyName, attributes);402 if (m_structureID->property Map().storageSize() > m_structureID->propertyStorageCapacity()) {402 offset = m_structureID->put(propertyName, attributes); 403 if (m_structureID->propertyStorageSize() > m_structureID->propertyStorageCapacity()) { 403 404 m_structureID->growPropertyStorageCapacity(); 404 405 allocatePropertyStorage(currentCapacity, m_structureID->propertyStorageCapacity()); … … 412 413 413 414 unsigned currentAttributes; 414 size_t offset = m_structureID-> propertyMap().get(propertyName, currentAttributes);415 size_t offset = m_structureID->get(propertyName, currentAttributes); 415 416 if (offset != WTF::notFound) { 416 417 if (checkReadOnly && currentAttributes & ReadOnly) -
trunk/JavaScriptCore/runtime/JSVariableObject.cpp
r37938 r37989 31 31 32 32 #include "PropertyNameArray.h" 33 #include "PropertyMap.h"34 33 35 34 namespace JSC { -
trunk/JavaScriptCore/runtime/PropertyMap.cpp
r37938 r37989 271 271 } 272 272 273 size_t PropertyMap::get(const Identifier& propertyName, unsigned& attributes) 273 size_t PropertyMap::get(const Identifier& propertyName, unsigned& attributes) const 274 274 { 275 275 ASSERT(!propertyName.isNull()); -
trunk/JavaScriptCore/runtime/PropertyMap.h
r37981 r37989 94 94 PropertyMap& operator=(const PropertyMap&); 95 95 96 size_t get(const Identifier& propertyName) ;97 size_t get(const Identifier& propertyName, unsigned& attributes) ;96 size_t get(const Identifier& propertyName) const; 97 size_t get(const Identifier& propertyName, unsigned& attributes) const; 98 98 size_t put(const Identifier& propertyName, unsigned attributes); 99 99 size_t remove(const Identifier& propertyName); … … 101 101 void getEnumerablePropertyNames(PropertyNameArray&) const; 102 102 103 bool isEmpty() { return !m_table; }103 bool isEmpty() const { return !m_table; } 104 104 unsigned storageSize() const { return m_table ? m_table->keyCount + m_deletedOffsets.size() : 0; } 105 105 … … 133 133 } 134 134 135 inline size_t PropertyMap::get(const Identifier& propertyName) 135 inline size_t PropertyMap::get(const Identifier& propertyName) const 136 136 { 137 137 ASSERT(!propertyName.isNull()); -
trunk/JavaScriptCore/runtime/StructureID.cpp
r37985 r37989 76 76 } 77 77 78 totalPropertyMapsSize += structureID-> propertyMap().propertyMapSize();78 totalPropertyMapsSize += structureID->m_propertyMap.propertyMapSize(); 79 79 } 80 80 -
trunk/JavaScriptCore/runtime/StructureID.h
r37985 r37989 97 97 StructureIDChain* cachedPrototypeChain() const { return m_cachedPrototypeChain.get(); } 98 98 99 const PropertyMap& propertyMap() const { return m_propertyMap; }100 PropertyMap& propertyMap() { return m_propertyMap; }101 102 99 void setCachedTransistionOffset(size_t offset) { m_cachedTransistionOffset = offset; } 103 100 size_t cachedTransistionOffset() const { return m_cachedTransistionOffset; } … … 105 102 void growPropertyStorageCapacity(); 106 103 size_t propertyStorageCapacity() const { return m_propertyStorageCapacity; } 104 size_t propertyStorageSize() const { return m_propertyMap.storageSize(); } 105 106 size_t get(const Identifier& propertyName) const { return m_propertyMap.get(propertyName); } 107 size_t get(const Identifier& propertyName, unsigned& attributes) const { return m_propertyMap.get(propertyName, attributes); } 108 size_t put(const Identifier& propertyName, unsigned attributes) { return m_propertyMap.put(propertyName, attributes); } 109 size_t remove(const Identifier& propertyName) { return m_propertyMap.remove(propertyName); } 107 110 108 111 void getEnumerablePropertyNames(ExecState*, PropertyNameArray&, JSObject*); … … 112 115 void setHasGetterSetterProperties(bool hasGetterSetterProperties) { m_hasGetterSetterProperties = hasGetterSetterProperties; } 113 116 117 bool isEmpty() const { return m_propertyMap.isEmpty(); } 118 114 119 private: 115 120 StructureID(JSValue* prototype, const TypeInfo&); 116 121 117 122 static const size_t s_maxTransitionLength = 64; 118 123
Note:
See TracChangeset
for help on using the changeset viewer.