Skip to content

Commit

Permalink
Bug 1562602 part 1 - Fix JSJitProfilingFrameIterator::fixBaselineRetu…
Browse files Browse the repository at this point in the history
…rnAddress for interpreter frames. r=djvj

It needs to set resumePCinCurrentFrame_ to an address in the interpreter JitCode
instead of nullptr (or else the profiler's JitCodeMap lookup will assert).

Differential Revision: https://phabricator.services.mozilla.com/D36468

--HG--
extra : moz-landing-system : lando
  • Loading branch information
jandem committed Jul 8, 2019
1 parent 808f2e0 commit c6d0430
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions js/src/jit/JSJitFrameIter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,18 +642,25 @@ void JSJitProfilingFrameIterator::fixBaselineReturnAddress() {
// Certain exception handling cases such as debug OSR or resuming a generator
// with .throw() will use BaselineFrame::setOverridePc() to indicate the
// effective |pc|. We translate the effective-pc into a Baseline code
// address. Don't do this for frames running in the Baseline Interpreter,
// because we don't use the return address in that case.
jsbytecode* overridePC = bl->maybeOverridePc();
if (overridePC && !bl->runningInInterpreter()) {
PCMappingSlotInfo slotInfo;
// address.
if (jsbytecode* overridePC = bl->maybeOverridePc()) {
JSScript* script = bl->script();
BaselineScript* blScript = script->baselineScript();
resumePCinCurrentFrame_ =
blScript->nativeCodeForPC(script, overridePC, &slotInfo);
if (bl->runningInInterpreter()) {
// The return address won't be used for pc mapping when running in the
// Baseline interpreter, but JitCodeMap expects a non-null return address
// for the entry lookup so use the interpret-op address.
JitRuntime* jrt = script->runtimeFromAnyThread()->jitRuntime();
resumePCinCurrentFrame_ =
jrt->baselineInterpreter().interpretOpAddr().value;
} else {
PCMappingSlotInfo slotInfo;
BaselineScript* blScript = script->baselineScript();
resumePCinCurrentFrame_ =
blScript->nativeCodeForPC(script, overridePC, &slotInfo);
// NOTE: The stack may not be synced at this PC. For the purpose of
// profiler sampling this is fine.
}

// NOTE: The stack may not be synced at this PC. For the purpose of
// profiler sampling this is fine.
return;
}
}
Expand Down

0 comments on commit c6d0430

Please sign in to comment.