Title: [167842] trunk/Source/_javascript_Core
Revision
167842
Author
[email protected]
Date
2014-04-25 23:00:43 -0700 (Fri, 25 Apr 2014)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (167841 => 167842)


--- trunk/Source/_javascript_Core/ChangeLog	2014-04-26 05:53:06 UTC (rev 167841)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-04-26 06:00:43 UTC (rev 167842)
@@ -1,3 +1,30 @@
+2014-04-25  Andreas Kling  <[email protected]>
+
+        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.
+
 2014-04-25  Oliver Hunt  <[email protected]>
 
         Need earlier cell test

Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (167841 => 167842)


--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2014-04-26 05:53:06 UTC (rev 167841)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2014-04-26 06:00:43 UTC (rev 167842)
@@ -259,7 +259,7 @@
     return JSValue::encode(jsAddSlowCase(exec, op1, op2));
 }
 
-static inline EncodedJSValue getByVal(ExecState* exec, JSCell* base, uint32_t index)
+static ALWAYS_INLINE EncodedJSValue getByVal(ExecState* exec, JSCell* base, uint32_t index)
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);

Modified: trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h (167841 => 167842)


--- trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h	2014-04-26 05:53:06 UTC (rev 167841)
+++ trunk/Source/_javascript_Core/runtime/JSCJSValueInlines.h	2014-04-26 06:00:43 UTC (rev 167842)
@@ -683,13 +683,13 @@
     return jsUndefined();
 }
 
-inline JSValue JSValue::get(ExecState* exec, unsigned propertyName) const
+ALWAYS_INLINE JSValue JSValue::get(ExecState* exec, unsigned propertyName) const
 {
     PropertySlot slot(asValue());
     return get(exec, propertyName, slot);
 }
 
-inline JSValue JSValue::get(ExecState* exec, unsigned propertyName, PropertySlot& slot) const
+ALWAYS_INLINE JSValue JSValue::get(ExecState* exec, unsigned propertyName, PropertySlot& slot) const
 {
     // If this is a primitive, we'll need to synthesize the prototype -
     // and if it's a string there are special properties to check first.

Modified: trunk/Source/_javascript_Core/runtime/JSObject.h (167841 => 167842)


--- trunk/Source/_javascript_Core/runtime/JSObject.h	2014-04-26 05:53:06 UTC (rev 167841)
+++ trunk/Source/_javascript_Core/runtime/JSObject.h	2014-04-26 06:00:43 UTC (rev 167842)
@@ -1257,11 +1257,13 @@
 
 ALWAYS_INLINE bool JSObject::getPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
 {
+    VM& vm = exec->vm();
     JSObject* object = this;
     while (true) {
-        if (object->methodTable(exec->vm())->getOwnPropertySlotByIndex(object, exec, propertyName, slot))
+        Structure& structure = *object->structure(vm);
+        if (structure.classInfo()->methodTable.getOwnPropertySlotByIndex(object, exec, propertyName, slot))
             return true;
-        JSValue prototype = object->prototype();
+        JSValue prototype = structure.storedPrototype();
         if (!prototype.isObject())
             return false;
         object = asObject(prototype);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to