Title: [95683] trunk/Source/_javascript_Core
Revision
95683
Author
[email protected]
Date
2011-09-21 16:46:09 -0700 (Wed, 21 Sep 2011)

Log Message

DFG JIT should be able to compile op_throw
https://bugs.webkit.org/show_bug.cgi?id=68571

Reviewed by Geoffrey Garen.
        
This compiles op_throw in the simplest way possible: it's an OSR
point back to the old JIT. This is a good step towards increasing
coverage, particularly on Kraken, but it's neutral because the
same functions that do throw also use some other unsupported
opcodes.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.h:
(JSC::DFG::canCompileOpcode):
* dfg/DFGNode.h:
* dfg/DFGPropagator.cpp:
(JSC::DFG::Propagator::propagateNodePredictions):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compile):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (95682 => 95683)


--- trunk/Source/_javascript_Core/ChangeLog	2011-09-21 23:44:20 UTC (rev 95682)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-09-21 23:46:09 UTC (rev 95683)
@@ -1,5 +1,28 @@
 2011-09-21  Filip Pizlo  <[email protected]>
 
+        DFG JIT should be able to compile op_throw
+        https://bugs.webkit.org/show_bug.cgi?id=68571
+
+        Reviewed by Geoffrey Garen.
+        
+        This compiles op_throw in the simplest way possible: it's an OSR
+        point back to the old JIT. This is a good step towards increasing
+        coverage, particularly on Kraken, but it's neutral because the
+        same functions that do throw also use some other unsupported
+        opcodes.
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::parseBlock):
+        * dfg/DFGCapabilities.h:
+        (JSC::DFG::canCompileOpcode):
+        * dfg/DFGNode.h:
+        * dfg/DFGPropagator.cpp:
+        (JSC::DFG::Propagator::propagateNodePredictions):
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+
+2011-09-21  Filip Pizlo  <[email protected]>
+
         DFG should support continuous optimization
         https://bugs.webkit.org/show_bug.cgi?id=68329
 

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (95682 => 95683)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2011-09-21 23:44:20 UTC (rev 95682)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2011-09-21 23:46:09 UTC (rev 95683)
@@ -1314,6 +1314,14 @@
             addToGraph(Return, get(currentInstruction[1].u.operand));
             LAST_OPCODE(op_end);
             
+        case op_throw:
+            addToGraph(Throw, get(currentInstruction[1].u.operand));
+            LAST_OPCODE(op_throw);
+            
+        case op_throw_reference_error:
+            addToGraph(ThrowReferenceError);
+            LAST_OPCODE(op_throw_reference_error);
+            
         case op_call: {
             NodeIndex callTarget = get(currentInstruction[1].u.operand);
             if (m_graph.isFunctionConstant(m_codeBlock, callTarget)) {

Modified: trunk/Source/_javascript_Core/dfg/DFGCapabilities.h (95682 => 95683)


--- trunk/Source/_javascript_Core/dfg/DFGCapabilities.h	2011-09-21 23:44:20 UTC (rev 95682)
+++ trunk/Source/_javascript_Core/dfg/DFGCapabilities.h	2011-09-21 23:46:09 UTC (rev 95683)
@@ -114,6 +114,8 @@
     case op_call_put_result:
     case op_resolve:
     case op_resolve_base:
+    case op_throw:
+    case op_throw_reference_error:
         return true;
     default:
         return false;

Modified: trunk/Source/_javascript_Core/dfg/DFGNode.h (95682 => 95683)


--- trunk/Source/_javascript_Core/dfg/DFGNode.h	2011-09-21 23:44:20 UTC (rev 95682)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h	2011-09-21 23:46:09 UTC (rev 95683)
@@ -297,7 +297,9 @@
     /* Block terminals. */\
     macro(Jump, NodeMustGenerate | NodeIsTerminal | NodeIsJump) \
     macro(Branch, NodeMustGenerate | NodeIsTerminal | NodeIsBranch) \
-    macro(Return, NodeMustGenerate | NodeIsTerminal)
+    macro(Return, NodeMustGenerate | NodeIsTerminal) \
+    macro(Throw, NodeMustGenerate | NodeIsTerminal) \
+    macro(ThrowReferenceError, NodeMustGenerate | NodeIsTerminal)
 
 // This enum generates a monotonically increasing id for all Node types,
 // and is used by the subsequent enum to fill out the id (as accessed via the NodeIdMask).

Modified: trunk/Source/_javascript_Core/dfg/DFGPropagator.cpp (95682 => 95683)


--- trunk/Source/_javascript_Core/dfg/DFGPropagator.cpp	2011-09-21 23:44:20 UTC (rev 95682)
+++ trunk/Source/_javascript_Core/dfg/DFGPropagator.cpp	2011-09-21 23:46:09 UTC (rev 95683)
@@ -552,6 +552,8 @@
         case Return:
         case CheckHasInstance:
         case Phi:
+        case Throw:
+        case ThrowReferenceError:
             break;
             
         // These get ignored because we don't have profiling for them, yet.

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (95682 => 95683)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2011-09-21 23:44:20 UTC (rev 95682)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2011-09-21 23:46:09 UTC (rev 95683)
@@ -1524,6 +1524,14 @@
         noResult(m_compileIndex);
         break;
     }
+        
+    case Throw:
+    case ThrowReferenceError: {
+        // We expect that throw statements are rare and are intended to exit the code block
+        // anyway, so we just OSR back to the old JIT for now.
+        terminateSpeculativeExecution();
+        break;
+    }
 
     case ConvertThis: {
         SpeculateCellOperand thisValue(this, node.child1());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to