diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
commit | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch) | |
tree | b34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Source/JavaScriptCore/dfg/DFGJITCompiler.cpp | |
parent | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff) | |
download | qtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz |
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGJITCompiler.cpp')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGJITCompiler.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp index ac5f314a1..7b2bbc788 100644 --- a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp +++ b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp @@ -116,7 +116,7 @@ void JITCompiler::link(LinkBuffer& linkBuffer) { // Link the code, populate data in CodeBlock data structures. #if DFG_ENABLE(DEBUG_VERBOSE) - fprintf(stderr, "JIT code for %p start at [%p, %p). Size = %zu.\n", m_codeBlock, linkBuffer.debugAddress(), static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.debugSize(), linkBuffer.debugSize()); + dataLog("JIT code for %p start at [%p, %p). Size = %zu.\n", m_codeBlock, linkBuffer.debugAddress(), static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.debugSize(), linkBuffer.debugSize()); #endif // Link all calls out from the JIT code to their respective functions. @@ -134,27 +134,16 @@ void JITCompiler::link(LinkBuffer& linkBuffer) m_codeBlock->callReturnIndexVector().append(CallReturnOffsetToBytecodeOffset(returnAddressOffset, exceptionInfo)); } } + + Vector<CodeOriginAtCallReturnOffset>& codeOrigins = m_codeBlock->codeOrigins(); + codeOrigins.resize(m_exceptionChecks.size()); - unsigned numCallsFromInlineCode = 0; for (unsigned i = 0; i < m_exceptionChecks.size(); ++i) { - if (m_exceptionChecks[i].m_codeOrigin.inlineCallFrame) - numCallsFromInlineCode++; - } - - if (numCallsFromInlineCode) { - Vector<CodeOriginAtCallReturnOffset>& codeOrigins = m_codeBlock->codeOrigins(); - codeOrigins.resize(numCallsFromInlineCode); - - for (unsigned i = 0, j = 0; i < m_exceptionChecks.size(); ++i) { - CallExceptionRecord& record = m_exceptionChecks[i]; - if (record.m_codeOrigin.inlineCallFrame) { - unsigned returnAddressOffset = linkBuffer.returnAddressOffset(m_exceptionChecks[i].m_call); - codeOrigins[j].codeOrigin = record.m_codeOrigin; - codeOrigins[j].callReturnOffset = returnAddressOffset; - record.m_token.assertCodeOriginIndex(j); - j++; - } - } + CallExceptionRecord& record = m_exceptionChecks[i]; + unsigned returnAddressOffset = linkBuffer.returnAddressOffset(m_exceptionChecks[i].m_call); + codeOrigins[i].codeOrigin = record.m_codeOrigin; + codeOrigins[i].callReturnOffset = returnAddressOffset; + record.m_token.assertCodeOriginIndex(i); } m_codeBlock->setNumberOfStructureStubInfos(m_propertyAccesses.size()); @@ -212,6 +201,9 @@ void JITCompiler::compile(JITCode& entry) SpeculativeJIT speculative(*this); compileBody(speculative); + // Create OSR entry trampolines if necessary. + speculative.createOSREntries(); + LinkBuffer linkBuffer(*m_globalData, this, m_codeBlock); link(linkBuffer); speculative.linkOSREntries(linkBuffer); @@ -251,7 +243,10 @@ void JITCompiler::compileFunction(JITCode& entry, MacroAssemblerCodePtr& entryWi registerFileCheck.link(this); move(stackPointerRegister, GPRInfo::argumentGPR0); poke(GPRInfo::callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*)); + + CallBeginToken token = beginCall(); Call callRegisterFileCheck = call(); + notifyCall(callRegisterFileCheck, CodeOrigin(0), token); jump(fromRegisterFileCheck); // The fast entry point into a function does not check the correct number of arguments @@ -266,9 +261,14 @@ void JITCompiler::compileFunction(JITCode& entry, MacroAssemblerCodePtr& entryWi branch32(AboveOrEqual, GPRInfo::regT1, Imm32(m_codeBlock->numParameters())).linkTo(fromArityCheck, this); move(stackPointerRegister, GPRInfo::argumentGPR0); poke(GPRInfo::callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*)); + token = beginCall(); Call callArityCheck = call(); + notifyCall(callArityCheck, CodeOrigin(0), token); move(GPRInfo::regT0, GPRInfo::callFrameRegister); jump(fromArityCheck); + + // Create OSR entry trampolines if necessary. + speculative.createOSREntries(); // === Link === |