From 285c61e0a2720f72089b117884088313f093fa1a Mon Sep 17 00:00:00 2001 From: "barraclough@apple.com" Date: Wed, 28 Sep 2011 01:52:21 +0000 Subject: [PATCH] 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): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96178 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/JavaScriptCore/ChangeLog | 16 ++++++++++++++++ Source/JavaScriptCore/dfg/DFGJITCompiler32_64.cpp | 12 ++++++------ Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp | 9 ++++++++- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog index 87105db..851b192 100644 --- a/Source/JavaScriptCore/ChangeLog +++ b/Source/JavaScriptCore/ChangeLog @@ -1,5 +1,21 @@ 2011-09-27 Gavin Barraclough + 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 + Get JSVALUE32_64 DFG JIT building on OS X. https://bugs.webkit.org/show_bug.cgi?id=68961 diff --git a/Source/JavaScriptCore/dfg/DFGJITCompiler32_64.cpp b/Source/JavaScriptCore/dfg/DFGJITCompiler32_64.cpp index 1511bf9..f7ad406 100644 --- a/Source/JavaScriptCore/dfg/DFGJITCompiler32_64.cpp +++ b/Source/JavaScriptCore/dfg/DFGJITCompiler32_64.cpp @@ -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); diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp index d3dc4b2..cda2383 100644 --- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp +++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp @@ -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)) { -- 2.7.4