diff options
Diffstat (limited to 'Source/JavaScriptCore/interpreter/CallFrame.cpp')
-rw-r--r-- | Source/JavaScriptCore/interpreter/CallFrame.cpp | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/Source/JavaScriptCore/interpreter/CallFrame.cpp b/Source/JavaScriptCore/interpreter/CallFrame.cpp index 3ef5bd26f..b0e5ea0f6 100644 --- a/Source/JavaScriptCore/interpreter/CallFrame.cpp +++ b/Source/JavaScriptCore/interpreter/CallFrame.cpp @@ -40,7 +40,7 @@ void CallFrame::dumpCaller() JSValue function; interpreter()->retrieveLastCaller(this, signedLineNumber, sourceID, urlString, function); - printf("Callpoint => %s:%d\n", urlString.utf8().data(), signedLineNumber); + dataLog("Callpoint => %s:%d\n", urlString.utf8().data(), signedLineNumber); } RegisterFile* CallFrame::registerFile() @@ -50,6 +50,29 @@ RegisterFile* CallFrame::registerFile() #endif +#if USE(JSVALUE32_64) +unsigned CallFrame::bytecodeOffsetForNonDFGCode() const +{ + ASSERT(codeBlock()); + return currentVPC() - codeBlock()->instructions().begin(); +} + +void CallFrame::setBytecodeOffsetForNonDFGCode(unsigned offset) +{ + ASSERT(codeBlock()); + setCurrentVPC(codeBlock()->instructions().begin() + offset); +} +#else +Instruction* CallFrame::currentVPC() const +{ + return codeBlock()->instructions().begin() + bytecodeOffsetForNonDFGCode(); +} +void CallFrame::setCurrentVPC(Instruction* vpc) +{ + setBytecodeOffsetForNonDFGCode(vpc - codeBlock()->instructions().begin()); +} +#endif + #if ENABLE(DFG_JIT) bool CallFrame::isInlineCallFrameSlow() { @@ -96,15 +119,15 @@ CallFrame* CallFrame::trueCallFrame(AbstractPC pc) if (pc.isSet()) { ReturnAddressPtr currentReturnPC = pc.jitReturnAddress(); - if (!machineCodeBlock->codeOriginForReturn(currentReturnPC, codeOrigin)) - return this; // Not currently in inlined code. + bool hasCodeOrigin = machineCodeBlock->codeOriginForReturn(currentReturnPC, codeOrigin); + ASSERT_UNUSED(hasCodeOrigin, hasCodeOrigin); } else { - unsigned index = codeOriginIndexForDFGWithInlining(); - if (index == UINT_MAX) - return this; // Not currently in inlined code. - + unsigned index = codeOriginIndexForDFG(); codeOrigin = machineCodeBlock->codeOrigin(index); } + + if (!codeOrigin.inlineCallFrame) + return this; // Not currently in inlined code. for (InlineCallFrame* inlineCallFrame = codeOrigin.inlineCallFrame; inlineCallFrame;) { InlineCallFrame* nextInlineCallFrame = inlineCallFrame->caller.inlineCallFrame; @@ -140,10 +163,10 @@ CallFrame* CallFrame::trueCallerFrame() // // machineCaller -> The caller according to the machine, which may be zero or // more frames above the true caller due to inlining. - + // Am I an inline call frame? If so, we're done. if (isInlineCallFrame()) - return callerFrame(); + return callerFrame()->removeHostCallFrameFlag(); // I am a machine call frame, so the question is: is my caller a machine call frame // that has inlines or a machine call frame that doesn't? @@ -153,10 +176,10 @@ CallFrame* CallFrame::trueCallerFrame() ASSERT(!machineCaller->isInlineCallFrame()); // Figure out how we want to get the current code location. - if (hasHostCallFrameFlag() || returnAddressIsInCtiTrampoline(returnPC())) - return machineCaller->trueCallFrameFromVMCode(); + if (!hasReturnPC() || returnAddressIsInCtiTrampoline(returnPC())) + return machineCaller->trueCallFrameFromVMCode()->removeHostCallFrameFlag(); - return machineCaller->trueCallFrame(returnPC()); + return machineCaller->trueCallFrame(returnPC())->removeHostCallFrameFlag(); } #endif |