Bug 1099444 - Fix getting pc offsets from BaselineFrames mid-debug mode OSR. (r=jandem)

This commit is contained in:
Shu-yu Guo 2014-11-18 16:42:01 -08:00
parent f573792cd6
commit c0911d9bae
2 changed files with 8 additions and 15 deletions

View File

@ -216,16 +216,6 @@ JitFrameIterator::script() const
return script;
}
uint8_t *
JitFrameIterator::resumeAddressToFp() const
{
// If we are settled on a patched BaselineFrame due to debug mode OSR, get
// the real return address via the stashed DebugModeOSRInfo.
if (isBaselineJS() && baselineFrame()->getDebugModeOSRInfo())
return baselineFrame()->debugModeOSRInfo()->resumeAddr;
return returnAddressToFp();
}
void
JitFrameIterator::baselineScriptAndPc(JSScript **scriptRes, jsbytecode **pcRes) const
{
@ -233,7 +223,6 @@ JitFrameIterator::baselineScriptAndPc(JSScript **scriptRes, jsbytecode **pcRes)
JSScript *script = this->script();
if (scriptRes)
*scriptRes = script;
uint8_t *retAddr = resumeAddressToFp();
// If we have unwound the scope due to exception handling to a different
// pc, the frame should behave as if it were settled on that pc.
@ -242,6 +231,14 @@ JitFrameIterator::baselineScriptAndPc(JSScript **scriptRes, jsbytecode **pcRes)
return;
}
// If we are settled on a patched BaselineFrame due to debug mode OSR, get
// the stashed pc.
if (baselineFrame()->getDebugModeOSRInfo()) {
*pcRes = baselineFrame()->debugModeOSRInfo()->pc;
return;
}
uint8_t *retAddr = returnAddressToFp();
if (pcRes) {
// If the return address is into the prologue entry address or just
// after the debug prologue, then assume start of script.

View File

@ -179,10 +179,6 @@ class JitFrameIterator
return returnAddressToFp_;
}
// Returns the resume address. As above, except taking
// BaselineDebugModeOSRInfo into account, if present.
uint8_t *resumeAddressToFp() const;
// Previous frame information extracted from the current frame.
inline size_t prevFrameLocalSize() const;
inline FrameType prevType() const;