[js] Fix invalid early return in BaselineFrame::trace.

We were not tracing debugger environments for Baseline frames without any
local/expression slots.
This commit is contained in:
Jan de Mooij 2021-06-02 10:29:47 +00:00 • committed by roytam1
commit 9c3495379f

View file

@ -62,24 +62,24 @@ BaselineFrame::trace(JSTracer* trc, JitFrameIterator& frameIterator)
// NB: It is possible that numValueSlots() could be zero, even if nfixed is // NB: It is possible that numValueSlots() could be zero, even if nfixed is
// nonzero. This is the case if the function has an early stack check. // nonzero. This is the case if the function has an early stack check.
if (numValueSlots() == 0) if (numValueSlots > 0) {
return;
MOZ_ASSERT(nfixed <= numValueSlots()); MOZ_ASSERT(nfixed <= numValueSlots());
if (nfixed == nlivefixed) { if (nfixed == nlivefixed) {
// All locals are live. // All locals are live.
MarkLocals(this, trc, 0, numValueSlots()); MarkLocals(this, trc, 0, numValueSlots());
} else { } else {
// Mark operand stack. // Mark operand stack.
MarkLocals(this, trc, nfixed, numValueSlots()); MarkLocals(this, trc, nfixed, numValueSlots());
// Clear dead block-scoped locals. // Clear dead block-scoped locals.
while (nfixed > nlivefixed) while (nfixed > nlivefixed)
unaliasedLocal(--nfixed).setUndefined(); unaliasedLocal(--nfixed).setUndefined();
// Mark live locals. // Mark live locals.
MarkLocals(this, trc, 0, nlivefixed); MarkLocals(this, trc, 0, nlivefixed);
}
} }
if (script->compartment()->debugEnvs) if (script->compartment()->debugEnvs)