mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1140741 - Teach JitProfilingFrameIterator to read DebugModeOSRInfo. (r=djvj)
This commit is contained in:
parent
0e4845745d
commit
9e49472b03
11
js/src/jit-test/tests/profiler/debugmode-osr-resume-addr.js
Normal file
11
js/src/jit-test/tests/profiler/debugmode-osr-resume-addr.js
Normal file
@ -0,0 +1,11 @@
|
||||
enableSPSProfiling();
|
||||
try {
|
||||
// Only the ARM simulator supports single step profiling.
|
||||
enableSingleStepProfiling();
|
||||
} catch (e) {
|
||||
quit(0);
|
||||
}
|
||||
var g = newGlobal();
|
||||
var dbg = Debugger(g);
|
||||
dbg.onDebuggerStatement = function (frame) {};
|
||||
g.eval("var line = new Error().lineNumber; debugger;");
|
@ -280,6 +280,7 @@ class JitProfilingFrameIterator
|
||||
bool tryInitWithPC(void *pc);
|
||||
bool tryInitWithTable(JitcodeGlobalTable *table, void *pc, JSRuntime *rt,
|
||||
bool forLastCallSite);
|
||||
void fixBaselineDebugModeOSRReturnAddress();
|
||||
|
||||
public:
|
||||
JitProfilingFrameIterator(JSRuntime *rt,
|
||||
|
@ -2898,15 +2898,21 @@ JitProfilingFrameIterator::JitProfilingFrameIterator(void *exitFrame)
|
||||
ExitFrameLayout *frame = (ExitFrameLayout *) exitFrame;
|
||||
FrameType prevType = frame->prevType();
|
||||
|
||||
if (prevType == JitFrame_IonJS || prevType == JitFrame_BaselineJS ||
|
||||
prevType == JitFrame_Unwound_IonJS)
|
||||
{
|
||||
if (prevType == JitFrame_IonJS || prevType == JitFrame_Unwound_IonJS) {
|
||||
returnAddressToFp_ = frame->returnAddress();
|
||||
fp_ = GetPreviousRawFrame<ExitFrameLayout, uint8_t *>(frame);
|
||||
type_ = JitFrame_IonJS;
|
||||
return;
|
||||
}
|
||||
|
||||
if (prevType == JitFrame_BaselineJS) {
|
||||
returnAddressToFp_ = frame->returnAddress();
|
||||
fp_ = GetPreviousRawFrame<ExitFrameLayout, uint8_t *>(frame);
|
||||
type_ = JitFrame_BaselineJS;
|
||||
fixBaselineDebugModeOSRReturnAddress();
|
||||
return;
|
||||
}
|
||||
|
||||
if (prevType == JitFrame_BaselineStub || prevType == JitFrame_Unwound_BaselineStub) {
|
||||
BaselineStubFrameLayout *stubFrame =
|
||||
GetPreviousRawFrame<ExitFrameLayout, BaselineStubFrameLayout *>(frame);
|
||||
@ -2997,6 +3003,16 @@ JitProfilingFrameIterator::tryInitWithTable(JitcodeGlobalTable *table, void *pc,
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
JitProfilingFrameIterator::fixBaselineDebugModeOSRReturnAddress()
|
||||
{
|
||||
MOZ_ASSERT(type_ == JitFrame_BaselineJS);
|
||||
BaselineFrame *bl = (BaselineFrame *)(fp_ - BaselineFrame::FramePointerOffset -
|
||||
BaselineFrame::Size());
|
||||
if (BaselineDebugModeOSRInfo *info = bl->getDebugModeOSRInfo())
|
||||
returnAddressToFp_ = info->resumeAddr;
|
||||
}
|
||||
|
||||
void
|
||||
JitProfilingFrameIterator::operator++()
|
||||
{
|
||||
@ -3043,6 +3059,7 @@ JitProfilingFrameIterator::operator++()
|
||||
returnAddressToFp_ = frame->returnAddress();
|
||||
fp_ = GetPreviousRawFrame<JitFrameLayout, uint8_t *>(frame);
|
||||
type_ = JitFrame_BaselineJS;
|
||||
fixBaselineDebugModeOSRReturnAddress();
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user