Ignore:
Timestamp:
Jun 11, 2014, 11:40:13 AM (11 years ago)
Author:
[email protected]
Message:

Some JSValue::get() micro-optimzations.
<https://webkit.org/b/133739>

Tighten some of the property lookup code to improve performance of the
eagerly reified prototype attributes:

  • Instead of converting the property name to an integer at every step in the prototype chain, move that to a separate pass at the end since it should be a rare case.
  • Cache the StructureIDTable in a local instead of fetching it from the Heap on every step.
  • Make fillCustomGetterPropertySlot inline. It was out-of-lined based on the assumption that clients would mostly be cacheable GetByIds, and it gets pretty hot (~1%) in GetByVal.
  • Pass the Structure directly to fillCustomGetterPropertySlot instead of refetching it from the StructureIDTable.

Reviewed by Geoff Garen.

  • runtime/JSObject.cpp:

(JSC::JSObject::fillCustomGetterPropertySlot): Deleted.

  • runtime/JSObject.h:

(JSC::JSObject::inlineGetOwnPropertySlot):
(JSC::JSObject::fillCustomGetterPropertySlot):
(JSC::JSObject::getOwnPropertySlot):
(JSC::JSObject::fastGetOwnPropertySlot):
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::getOwnPropertySlotSlow): Deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r169740 r169815  
    16891689    }
    16901690    slot.setCacheableGetterSlot(this, attributes, jsCast<GetterSetter*>(getterSetter), offset);
    1691 }
    1692 
    1693 NEVER_INLINE void JSObject::fillCustomGetterPropertySlot(PropertySlot& slot, JSValue customGetterSetter, unsigned attributes)
    1694 {
    1695     if (structure()->isDictionary()) {
    1696         slot.setCustom(this, attributes, jsCast<CustomGetterSetter*>(customGetterSetter)->getter());
    1697         return;
    1698     }
    1699     slot.setCacheableCustom(this, attributes, jsCast<CustomGetterSetter*>(customGetterSetter)->getter());
    17001691}
    17011692
Note: See TracChangeset for help on using the changeset viewer.