Changeset 201853 in webkit
- Timestamp:
- Jun 8, 2016, 10:43:46 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 8 edited
-
ChangeLog (modified) (1 diff)
-
runtime/ClassInfo.h (modified) (1 diff)
-
runtime/JSObject.cpp (modified) (5 diffs)
-
runtime/JSObject.h (modified) (1 diff)
-
runtime/Lookup.cpp (modified) (1 diff)
-
runtime/Lookup.h (modified) (2 diffs)
-
runtime/Structure.cpp (modified) (3 diffs)
-
runtime/Structure.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r201848 r201853 1 2016-06-08 Gavin & Ellie Barraclough <barraclough@apple.com> 2 3 JSObject::reifyAllStaticProperties cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=158543 5 6 Reviewed by Mark Lam. 7 8 - JSObject & Structure contain fields labeled 'staticFunctionsReified', however reification now 9 affects all properties, not just functions. Rename to 'staticPropertiesReified'. 10 - reifyAllStaticProperties relies on a 'hasStaticProperties' method on ClassInfo that walks the 11 ClassInfo inheritance chain looking for static property tables. We can now more efficiently 12 get this information from TypeInfo. 13 - reifyAllStaticProperties triggers a 'toUncacheableDictionaryTransition'; this is overzealous, 14 cacheable dictionary is sufficient - this is what we do in the case of DOM prototype property 15 reification (see 'reifyStaticProperties' in Lookup.h). (Changing this with an eye on switching 16 DOM prototype property reification to use JSObject:: reifyAllStaticProperties, rather than 17 having its own special purpose code path.) 18 19 * runtime/ClassInfo.h: 20 (JSC::ClassInfo::hasStaticProperties): Deleted. 21 - deprecated by TypeInfo::hasStaticPropertyTable. 22 * runtime/JSObject.cpp: 23 (JSC::JSObject::putInlineSlow): 24 (JSC::JSObject::deleteProperty): 25 (JSC::JSObject::getOwnNonIndexPropertyNames): 26 - staticFunctionsReified -> staticPropertiesReified 27 (JSC::JSObject::reifyAllStaticProperties): 28 - hasStaticProperties -> TypeInfo::hasStaticPropertyTable 29 - toUncacheableDictionaryTransition -> toCacheableDictionaryTransition 30 - staticFunctionsReified -> staticPropertiesReified 31 * runtime/JSObject.h: 32 (JSC::JSObject::staticPropertiesReified): 33 (JSC::JSObject::staticFunctionsReified): Deleted. 34 * runtime/Lookup.cpp: 35 (JSC::setUpStaticFunctionSlot): 36 * runtime/Lookup.h: 37 (JSC::getStaticPropertySlotFromTable): 38 (JSC::replaceStaticPropertySlot): 39 * runtime/Structure.cpp: 40 (JSC::Structure::Structure): 41 * runtime/Structure.h: 42 - staticFunctionsReified -> staticPropertiesReified 43 1 44 2016-06-08 Benjamin Poulain <bpoulain@apple.com> 2 45 -
trunk/Source/JavaScriptCore/runtime/ClassInfo.h
r198023 r201853 198 198 } 199 199 200 bool hasStaticProperties() const201 {202 for (const ClassInfo* ci = this; ci; ci = ci->parentClass) {203 if (ci->staticPropHashTable)204 return true;205 }206 return false;207 }208 209 200 JS_EXPORT_PRIVATE bool hasStaticSetterOrReadonlyProperties() const; 210 201 -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r201834 r201853 569 569 break; 570 570 } 571 if (!obj->static FunctionsReified()) {571 if (!obj->staticPropertiesReified()) { 572 572 if (obj->classInfo()->hasStaticSetterOrReadonlyProperties()) { 573 573 if (auto* entry = obj->findPropertyHashEntry(propertyName)) … … 1499 1499 unsigned attributes; 1500 1500 1501 if (!thisObject->static FunctionsReified()) {1501 if (!thisObject->staticPropertiesReified()) { 1502 1502 if (auto* entry = thisObject->findPropertyHashEntry(propertyName)) { 1503 1503 // If the static table contains a non-configurable (DontDelete) property then we can return early; … … 1891 1891 void JSObject::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 1892 1892 { 1893 if (!object->static FunctionsReified())1893 if (!object->staticPropertiesReified()) 1894 1894 getClassPropertyNames(exec, object->classInfo(), propertyNames, mode); 1895 1895 … … 1966 1966 void JSObject::reifyAllStaticProperties(ExecState* exec) 1967 1967 { 1968 ASSERT(!static FunctionsReified());1968 ASSERT(!staticPropertiesReified()); 1969 1969 VM& vm = exec->vm(); 1970 1970 1971 1971 // If this object's ClassInfo has no static properties, then nothing to reify! 1972 1972 // We can safely set the flag to avoid the expensive check again in the future. 1973 if (! classInfo()->hasStaticProperties()) {1974 structure(vm)->setStatic FunctionsReified(true);1973 if (!TypeInfo::hasStaticPropertyTable(inlineTypeFlags())) { 1974 structure(vm)->setStaticPropertiesReified(true); 1975 1975 return; 1976 1976 } 1977 1977 1978 if (!structure(vm)->is UncacheableDictionary())1979 setStructure(vm, Structure::to UncacheableDictionaryTransition(vm, structure(vm)));1978 if (!structure(vm)->isDictionary()) 1979 setStructure(vm, Structure::toCacheableDictionaryTransition(vm, structure(vm))); 1980 1980 1981 1981 for (const ClassInfo* info = classInfo(); info; info = info->parentClass) { … … 1993 1993 } 1994 1994 1995 structure(vm)->setStatic FunctionsReified(true);1995 structure(vm)->setStaticPropertiesReified(true); 1996 1996 } 1997 1997 -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r201834 r201853 679 679 } 680 680 681 bool static FunctionsReified() { return structure()->staticFunctionsReified(); }681 bool staticPropertiesReified() { return structure()->staticPropertiesReified(); } 682 682 void reifyAllStaticProperties(ExecState*); 683 683 -
trunk/Source/JavaScriptCore/runtime/Lookup.cpp
r201448 r201853 54 54 // If a property is ever deleted from an object with a static table, then we reify 55 55 // all static functions at that time - after this we shouldn't be re-adding anything. 56 if (thisObject->static FunctionsReified())56 if (thisObject->staticPropertiesReified()) 57 57 return false; 58 58 -
trunk/Source/JavaScriptCore/runtime/Lookup.h
r201719 r201853 211 211 inline bool getStaticPropertySlotFromTable(VM& vm, const HashTable& table, JSObject* thisObject, PropertyName propertyName, PropertySlot& slot) 212 212 { 213 if (thisObject->static FunctionsReified())213 if (thisObject->staticPropertiesReified()) 214 214 return false; 215 215 … … 235 235 return false; 236 236 237 if (!thisObject->static FunctionsReified())237 if (!thisObject->staticPropertiesReified()) 238 238 thisObject->JSObject::setStructure(vm, Structure::attributeChangeTransition(vm, thisObject->structure(), propertyName, 0)); 239 239 -
trunk/Source/JavaScriptCore/runtime/Structure.cpp
r201590 r201853 206 206 setDidPreventExtensions(false); 207 207 setDidTransition(false); 208 setStatic FunctionsReified(false);208 setStaticPropertiesReified(false); 209 209 setTransitionWatchpointIsLikelyToBeFired(false); 210 210 setHasBeenDictionary(false); … … 237 237 setDidPreventExtensions(false); 238 238 setDidTransition(false); 239 setStatic FunctionsReified(false);239 setStaticPropertiesReified(false); 240 240 setTransitionWatchpointIsLikelyToBeFired(false); 241 241 setHasBeenDictionary(false); … … 267 267 setDidPreventExtensions(previous->didPreventExtensions()); 268 268 setDidTransition(true); 269 setStatic FunctionsReified(previous->staticFunctionsReified());269 setStaticPropertiesReified(previous->staticPropertiesReified()); 270 270 setHasBeenDictionary(previous->hasBeenDictionary()); 271 271 -
trunk/Source/JavaScriptCore/runtime/Structure.h
r201590 r201853 610 610 DEFINE_BITFIELD(bool, didPreventExtensions, DidPreventExtensions, 1, 20); 611 611 DEFINE_BITFIELD(bool, didTransition, DidTransition, 1, 21); 612 DEFINE_BITFIELD(bool, static FunctionsReified, StaticFunctionsReified, 1, 22);612 DEFINE_BITFIELD(bool, staticPropertiesReified, StaticPropertiesReified, 1, 22); 613 613 DEFINE_BITFIELD(bool, hasBeenFlattenedBefore, HasBeenFlattenedBefore, 1, 23); 614 614 DEFINE_BITFIELD(bool, hasCustomGetterSetterProperties, HasCustomGetterSetterProperties, 1, 24);
Note:
See TracChangeset
for help on using the changeset viewer.