Changeset 167842 in webkit


Ignore:
Timestamp:
Apr 25, 2014 11:00:43 PM (10 years ago)
Author:
akling@apple.com
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.

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r167832 r167842  
     12014-04-25  Andreas Kling  <akling@apple.com>
     2
     3        Inline (C++) GetByVal with numeric indices more aggressively.
     4        <https://webkit.org/b/132218>
     5
     6        We were already inlining the string indexed GetByVal path pretty well,
     7        while the path for numeric indices got neglected. No more!
     8
     9        ~9.5% improvement on Dromaeo/dom-traverse.html on my MBP:
     10
     11            Before: 199.50 runs/s
     12             After: 218.58 runs/s
     13
     14        Reviewed by Phil Pizlo.
     15
     16        * dfg/DFGOperations.cpp:
     17        * runtime/JSCJSValueInlines.h:
     18        (JSC::JSValue::get):
     19
     20            ALWAYS_INLINE all the things.
     21
     22        * runtime/JSObject.h:
     23        (JSC::JSObject::getPropertySlot):
     24
     25            Avoid fetching the Structure more than once. We have the same
     26            optimization in the string-indexed code path.
     27
    1282014-04-25  Oliver Hunt  <oliver@apple.com>
    229
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r167548 r167842  
    260260}
    261261
    262 static inline EncodedJSValue getByVal(ExecState* exec, JSCell* base, uint32_t index)
     262static ALWAYS_INLINE EncodedJSValue getByVal(ExecState* exec, JSCell* base, uint32_t index)
    263263{
    264264    VM& vm = exec->vm();
  • trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h

    r167405 r167842  
    684684}
    685685
    686 inline JSValue JSValue::get(ExecState* exec, unsigned propertyName) const
     686ALWAYS_INLINE JSValue JSValue::get(ExecState* exec, unsigned propertyName) const
    687687{
    688688    PropertySlot slot(asValue());
     
    690690}
    691691
    692 inline JSValue JSValue::get(ExecState* exec, unsigned propertyName, PropertySlot& slot) const
     692ALWAYS_INLINE JSValue JSValue::get(ExecState* exec, unsigned propertyName, PropertySlot& slot) const
    693693{
    694694    // If this is a primitive, we'll need to synthesize the prototype -
  • 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.