summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGJITCompiler.cpp')
-rw-r--r--Source/JavaScriptCore/dfg/DFGJITCompiler.cpp40
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 ===