Fix tracer integration edge case (bug 636879, r=billm,luke).

This commit is contained in:
David Anderson committed 2011-03-01 12:50:37 -08:00
1 parent b24eac0f53
commit 1b0dfbabba
2 files changed
+15 -7

No files matched your search

+1
View File
@@ -2376,6 +2376,7 @@ Interpret(JSContext *cx, JSStackFrame *entryFrame, uintN inlineCallCount, JSInte
interpReturnOK = mjit::JaegerShotAtSafePoint(cx, ncode); \
if (inlineCallCount) \
goto jit_return; \
regs.fp->setFinishedInInterpreter(); \
goto leave_on_safe_point; \
} \
if (status == mjit::Compile_Abort) { \
+14 -7
View File
@@ -759,16 +759,23 @@ PartialInterpret(VMFrame &f)
JS_STATIC_ASSERT(JSOP_NOP == 0);
/* Returns whether the current PC would return, popping the frame. */
static inline JSOp
/*
* Returns whether the current PC would return, or if the frame has already
* been completed. This distinction avoids re-entering the interpreter or JIT
* to complete a JSOP_RETURN. Instead, that edge case is handled in
* HandleFinishedFrame. We could consider reducing complexity, and making this
* function return only "finishedInInterpreter", and always using the full VM
* machinery to fully finish frames.
*/
static inline bool
FrameIsFinished(JSContext *cx)
{
JSOp op = JSOp(*cx->regs->pc);
return (op == JSOP_RETURN ||
op == JSOP_RETRVAL ||
op == JSOP_STOP)
? op
: JSOP_NOP;
? true
: cx->fp()->finishedInInterpreter();
}
@@ -818,9 +825,9 @@ HandleFinishedFrame(VMFrame &f, JSStackFrame *entryFrame)
* 4. No: Somewhere in the RunTracer call tree, we removed a frame,
* and we returned to a JSOP_RETURN opcode. Note carefully
* that in this situation, FrameIsFinished() returns true!
* 5. Yes: The function exited in the method JIT. However, in this
* case, we'll never enter HandleFinishedFrame(): we always
* immediately pop JIT'd frames.
* 5. Yes: The function exited in the method JIT, during
* FinishExcessFrames() However, in this case, we'll never enter
* HandleFinishedFrame(): we always immediately pop JIT'd frames.
*
* Since the only scenario where this fixup is NOT needed is a normal exit
* from the interpreter, we can cleanly check for this scenario by checking