DFG JIT - merge changes between 95905 - 96175
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Sep 2011 01:52:21 +0000 (01:52 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Sep 2011 01:52:21 +0000 (01:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68963

Reviewed by Sam Weinig.

Merge missing changes from bug#68677, bug#68784, bug#68785.

* dfg/DFGJITCompiler32_64.cpp:
(JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
(JSC::DFG::JITCompiler::compileEntry):
(JSC::DFG::JITCompiler::compileBody):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96178 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGJITCompiler32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

index 87105db..851b192 100644 (file)
@@ -1,5 +1,21 @@
 2011-09-27  Gavin Barraclough  <barraclough@apple.com>
 
+        DFG JIT - merge changes between 95905 - 96175
+        https://bugs.webkit.org/show_bug.cgi?id=68963
+
+        Reviewed by Sam Weinig.
+
+        Merge missing changes from bug#68677, bug#68784, bug#68785.
+
+        * dfg/DFGJITCompiler32_64.cpp:
+        (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
+        (JSC::DFG::JITCompiler::compileEntry):
+        (JSC::DFG::JITCompiler::compileBody):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+
+2011-09-27  Gavin Barraclough  <barraclough@apple.com>
+
         Get JSVALUE32_64 DFG JIT building on OS X.
         https://bugs.webkit.org/show_bug.cgi?id=68961
 
index 1511bf9..f7ad406 100644 (file)
@@ -95,10 +95,6 @@ void JITCompiler::exitSpeculativeWithOSR(const OSRExit& exit, SpeculationRecover
     fprintf(stderr, "OSR exit for Node @%d (bc#%u) at JIT offset 0x%x   ", (int)exit.m_nodeIndex, exit.m_bytecodeIndex, debugOffset());
     exit.dump(stderr);
 #endif
-#if ENABLE(DFG_JIT_BREAK_ON_SPECULATION_FAILURE)
-    breakpoint();
-#endif
-    
 #if ENABLE(DFG_VERBOSE_SPECULATION_FAILURE)
     SpeculationFailureDebugInfo* debugInfo = new SpeculationFailureDebugInfo;
     debugInfo->codeBlock = m_codeBlock;
@@ -107,6 +103,10 @@ void JITCompiler::exitSpeculativeWithOSR(const OSRExit& exit, SpeculationRecover
     debugCall(debugOperationPrintSpeculationFailure, debugInfo);
 #endif
     
+#if ENABLE(DFG_JIT_BREAK_ON_SPECULATION_FAILURE)
+    breakpoint();
+#endif
+    
 #if ENABLE(DFG_SUCCESS_STATS)
     static SamplingCounter counter("SpeculationFailure");
     emitCount(counter);
@@ -522,8 +522,6 @@ void JITCompiler::compileEntry()
     // both normal return code and when jumping to an exception handler).
     preserveReturnAddressAfterCall(GPRInfo::regT2);
     emitPutToCallFrameHeader(GPRInfo::regT2, RegisterFile::ReturnPC);
-
-    addPtr(Imm32(1), AbsoluteAddress(codeBlock()->addressOfSpeculativeSuccessCounter()));
 }
 
 void JITCompiler::compileBody()
@@ -533,6 +531,8 @@ void JITCompiler::compileBody()
     // Handy debug tool!
     breakpoint();
 #endif
+    
+    addPtr(Imm32(1), AbsoluteAddress(codeBlock()->addressOfSpeculativeSuccessCounter()));
 
     Label speculativePathBegin = label();
     SpeculativeJIT speculative(*this);
index d3dc4b2..cda2383 100644 (file)
@@ -601,8 +601,15 @@ void SpeculativeJIT::compile(Node& node)
         break;
 
     case GetLocal: {
-        GPRTemporary result(this);
         PredictedType prediction = m_jit.graph().getPrediction(node.local());
+
+        // If we have no prediction for this local, then don't attempt to compile.
+        if (prediction == PredictNone) {
+            terminateSpeculativeExecution();
+            break;
+        }
+        
+        GPRTemporary result(this);
         VirtualRegister virtualRegister = node.virtualRegister();
         m_jit.load32(JITCompiler::payloadFor(node.local()), result.gpr());
         if (isInt32Prediction(prediction)) {