Changeset 201562 in webkit
- Timestamp:
- Jun 1, 2016, 12:32:34 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
jit/Repatch.cpp (modified) (2 diffs)
-
runtime/JSObject.cpp (modified) (1 diff)
-
runtime/JSObject.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r201544 r201562 1 2016-05-31 Geoffrey Garen <ggaren@apple.com> 2 3 Dictionary property access should be fast 4 https://bugs.webkit.org/show_bug.cgi?id=158250 5 6 Reviewed by Keith Miller. 7 8 We have some remnant code that unnecessarily takes a slow path for 9 dictionaries. This caused the Dromaeo regression in r201436. Let's fix 10 that. 11 12 * jit/Repatch.cpp: 13 (JSC::tryCacheGetByID): Attempt to flatten a dictionary if necessary, but 14 not too much. This is our idiom in other places. 15 16 (JSC::tryCachePutByID): See tryCacheGetByID. 17 18 * llint/LLIntSlowPaths.cpp: 19 (JSC::LLInt::setupGetByIdPrototypeCache): See tryCacheGetByID. 20 21 * runtime/JSObject.cpp: 22 (JSC::JSObject::fillGetterPropertySlot): 23 * runtime/JSObject.h: 24 (JSC::JSObject::fillCustomGetterPropertySlot): The rules for caching a 25 getter are the same as the rules for caching anything else: We're 26 allowed to cache even in dictionaries, as long as they're cacheable 27 dictionaries. Any transition that would change to/from getter/setter 28 or change other attributes requires a structure transition. 29 1 30 2016-05-31 Yusuke Suzuki <utatane.tea@gmail.com> 2 31 -
trunk/Source/JavaScriptCore/jit/Repatch.cpp
r200623 r201562 298 298 299 299 if (slot.isUnset() || slot.slotBase() != baseValue) { 300 if (structure->typeInfo().prohibitsPropertyCaching() || structure->isDictionary())300 if (structure->typeInfo().prohibitsPropertyCaching()) 301 301 return GiveUpOnCache; 302 303 if (structure->isDictionary()) { 304 if (structure->hasBeenFlattenedBefore()) 305 return GiveUpOnCache; 306 structure->flattenDictionaryStructure(vm, jsCast<JSObject*>(baseCell)); 307 } 302 308 303 309 if (slot.isUnset() && structure->typeInfo().getOwnPropertySlotIsImpureForPropertyAbsence()) … … 446 452 ASSERT(slot.type() == PutPropertySlot::NewProperty); 447 453 448 if (!structure->isObject() || structure->isDictionary())454 if (!structure->isObject()) 449 455 return GiveUpOnCache; 456 457 if (structure->isDictionary()) { 458 if (structure->hasBeenFlattenedBefore()) 459 return GiveUpOnCache; 460 structure->flattenDictionaryStructure(vm, jsCast<JSObject*>(baseValue)); 461 } 450 462 451 463 PropertyOffset offset; -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r201448 r201562 2002 2002 NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, JSValue getterSetter, unsigned attributes, PropertyOffset offset) 2003 2003 { 2004 if (structure()->is Dictionary()) {2004 if (structure()->isUncacheableDictionary()) { 2005 2005 slot.setGetterSlot(this, attributes, jsCast<GetterSetter*>(getterSetter)); 2006 2006 return; 2007 2007 } 2008 2009 // This access is cacheable because Structure requires an attributeChangedTransition 2010 // if this property stops being an accessor. 2008 2011 slot.setCacheableGetterSlot(this, attributes, jsCast<GetterSetter*>(getterSetter), offset); 2009 2012 } -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r201448 r201562 1226 1226 ALWAYS_INLINE void JSObject::fillCustomGetterPropertySlot(PropertySlot& slot, JSValue customGetterSetter, unsigned attributes, Structure& structure) 1227 1227 { 1228 if (structure.is Dictionary()) {1228 if (structure.isUncacheableDictionary()) { 1229 1229 slot.setCustom(this, attributes, jsCast<CustomGetterSetter*>(customGetterSetter)->getter()); 1230 1230 return; 1231 1231 } 1232 1233 // This access is cacheable because Structure requires an attributeChangedTransition 1234 // if this property stops being an accessor. 1232 1235 slot.setCacheableCustom(this, attributes, jsCast<CustomGetterSetter*>(customGetterSetter)->getter()); 1233 1236 }
Note:
See TracChangeset
for help on using the changeset viewer.