Ignore:
Timestamp:
Apr 25, 2014, 11:00:43 PM (11 years ago)
Author:
[email protected]
Message:

Inline (C++) GetByVal with numeric indices more aggressively.
<https://webkit.org/b/132218>

We were already inlining the string indexed GetByVal path pretty well,
while the path for numeric indices got neglected. No more!

~9.5% improvement on Dromaeo/dom-traverse.html on my MBP:

Before: 199.50 runs/s

After: 218.58 runs/s

Reviewed by Phil Pizlo.

  • dfg/DFGOperations.cpp:
  • runtime/JSCJSValueInlines.h:

(JSC::JSValue::get):

ALWAYS_INLINE all the things.

  • runtime/JSObject.h:

(JSC::JSObject::getPropertySlot):

Avoid fetching the Structure more than once. We have the same
optimization in the string-indexed code path.

File:
1 edited

Legend:

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

    r167313 r167842  
    12581258ALWAYS_INLINE bool JSObject::getPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
    12591259{
     1260    VM& vm = exec->vm();
    12601261    JSObject* object = this;
    12611262    while (true) {
    1262         if (object->methodTable(exec->vm())->getOwnPropertySlotByIndex(object, exec, propertyName, slot))
     1263        Structure& structure = *object->structure(vm);
     1264        if (structure.classInfo()->methodTable.getOwnPropertySlotByIndex(object, exec, propertyName, slot))
    12631265            return true;
    1264         JSValue prototype = object->prototype();
     1266        JSValue prototype = structure.storedPrototype();
    12651267        if (!prototype.isObject())
    12661268            return false;
Note: See TracChangeset for help on using the changeset viewer.