Title: [106207] trunk/Source/_javascript_Core
Revision
106207
Author
[email protected]
Date
2012-01-29 18:39:14 -0800 (Sun, 29 Jan 2012)

Log Message

REGRESSION (r105576-r105582): Web Inspector Crash in JSC::JSValue::toString(JSC::ExecState*) const
https://bugs.webkit.org/show_bug.cgi?id=77146
<rdar://problem/10770586>

Reviewed by Oliver Hunt.
        
The old JIT expects that the result of the last operation is in the lastResultRegister.  The DFG JIT is
designed to correctly track the lastResultRegister by looking at SetLocal nodes.  However, when the DFG
JIT inlines a code block, it forgets that the inlined code block's result would have been placed in the
lastResultRegister.  Hence if we OSR exit on the first node following the end of an inlined code block
that had a return value, and that first node uses the return value, the old JIT will get massively
confused.  This patch takes a surgical approach: instead of making the DFG smarter, it makes the old
JIT slightly dumber.

* jit/JITCall.cpp:
(JSC::JIT::emit_op_call_put_result):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (106206 => 106207)


--- trunk/Source/_javascript_Core/ChangeLog	2012-01-30 02:23:12 UTC (rev 106206)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-01-30 02:39:14 UTC (rev 106207)
@@ -1,5 +1,24 @@
 2012-01-29  Filip Pizlo  <[email protected]>
 
+        REGRESSION (r105576-r105582): Web Inspector Crash in JSC::JSValue::toString(JSC::ExecState*) const
+        https://bugs.webkit.org/show_bug.cgi?id=77146
+        <rdar://problem/10770586>
+
+        Reviewed by Oliver Hunt.
+        
+        The old JIT expects that the result of the last operation is in the lastResultRegister.  The DFG JIT is
+        designed to correctly track the lastResultRegister by looking at SetLocal nodes.  However, when the DFG
+        JIT inlines a code block, it forgets that the inlined code block's result would have been placed in the
+        lastResultRegister.  Hence if we OSR exit on the first node following the end of an inlined code block
+        that had a return value, and that first node uses the return value, the old JIT will get massively
+        confused.  This patch takes a surgical approach: instead of making the DFG smarter, it makes the old
+        JIT slightly dumber.
+
+        * jit/JITCall.cpp:
+        (JSC::JIT::emit_op_call_put_result):
+
+2012-01-29  Filip Pizlo  <[email protected]>
+
         Build fix for Mac non-x64 platforms.
 
         * tools/CodeProfiling.cpp:

Modified: trunk/Source/_javascript_Core/jit/JITCall.cpp (106206 => 106207)


--- trunk/Source/_javascript_Core/jit/JITCall.cpp	2012-01-30 02:23:12 UTC (rev 106206)
+++ trunk/Source/_javascript_Core/jit/JITCall.cpp	2012-01-30 02:39:14 UTC (rev 106207)
@@ -52,6 +52,8 @@
     int dst = instruction[1].u.operand;
     emitValueProfilingSite();
     emitPutVirtualRegister(dst);
+    if (canBeOptimized())
+        killLastResultRegister(); // Make lastResultRegister tracking simpler in the DFG.
 }
 
 void JIT::compileLoadVarargs(Instruction* instruction)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to