Title: [176079] trunk/Source/_javascript_Core
Revision
176079
Author
[email protected]
Date
2014-11-13 11:18:43 -0800 (Thu, 13 Nov 2014)

Log Message

Generate put_by_id for bracket assignment with constant string subscript.
<https://webkit.org/b/138702>

Reviewed by Geoffrey Garen.

Transform o["f"]=x to o.f=x when generating bytecode. This allows our JIT
to inline-cache those accesses instead of always dropping out to C++.

Just like the get_by_id transformations, this gets a bunch of use on
real-web content (and Speedometer) but little/none on raw JS benchmarks.

* bytecompiler/NodesCodegen.cpp:
(JSC::AssignBracketNode::emitBytecode):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (176078 => 176079)


--- trunk/Source/_javascript_Core/ChangeLog	2014-11-13 19:07:11 UTC (rev 176078)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-11-13 19:18:43 UTC (rev 176079)
@@ -1,3 +1,19 @@
+2014-11-13  Andreas Kling  <[email protected]>
+
+        Generate put_by_id for bracket assignment with constant string subscript.
+        <https://webkit.org/b/138702>
+
+        Reviewed by Geoffrey Garen.
+
+        Transform o["f"]=x to o.f=x when generating bytecode. This allows our JIT
+        to inline-cache those accesses instead of always dropping out to C++.
+
+        Just like the get_by_id transformations, this gets a bunch of use on
+        real-web content (and Speedometer) but little/none on raw JS benchmarks.
+
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::AssignBracketNode::emitBytecode):
+
 2014-11-12  Mark Lam  <[email protected]>
 
         Create canonical lists of registers used by both the Assemblers and the JIT probes.

Modified: trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (176078 => 176079)


--- trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2014-11-13 19:07:11 UTC (rev 176078)
+++ trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2014-11-13 19:18:43 UTC (rev 176079)
@@ -1644,7 +1644,12 @@
 
     generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
     RegisterID* forwardResult = (dst == generator.ignoredResult()) ? result : generator.moveToDestinationIfNeeded(generator.tempDestination(result), result);
-    generator.emitPutByVal(base.get(), property.get(), forwardResult);
+
+    if (m_subscript->isString())
+        generator.emitPutById(base.get(), static_cast<StringNode*>(m_subscript)->value(), forwardResult);
+    else
+        generator.emitPutByVal(base.get(), property.get(), forwardResult);
+
     if (generator.vm()->typeProfiler()) {
         generator.emitProfileType(forwardResult, ProfileTypeBytecodeDoesNotHaveGlobalID, nullptr);
         generator.emitTypeProfilerExpressionInfo(divotStart(), divotEnd());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to