Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-01-19 09:43:10 +08:00
commit cad030d6cc
11 changed files with 109 additions and 59 deletions

View file

@ -35,6 +35,12 @@ JitFrameIterator::baselineFrame() const
return (BaselineFrame*)(fp() - BaselineFrame::FramePointerOffset - BaselineFrame::Size());
}
inline uint32_t
JitFrameIterator::baselineFrameNumValueSlots() const {
MOZ_ASSERT(isBaselineJS());
return baselineFrame()->numValueSlots();
}
template <typename T>
bool
JitFrameIterator::isExitFrameLayout() const

View file

@ -256,6 +256,10 @@ class JitFrameIterator
inline BaselineFrame* baselineFrame() const;
// Returns the number of local and expression stack Values for the current
// Baseline frame.
inline uint32_t baselineFrameNumValueSlots() const;
// This function isn't used, but we keep it here (debug-only) because it is
// helpful when chasing issues with the jitcode map.
#ifdef DEBUG

View file

@ -1568,18 +1568,18 @@ DecompileExpressionFromStack(JSContext* cx, int spindex, int skipStackHits, Hand
FrameIter frameIter(cx);
if (frameIter.done() || !frameIter.hasScript() || frameIter.compartment() != cx->compartment())
return true;
if (frameIter.done() ||
!frameIter.hasScript() ||
frameIter.compartment() != cx->compartment() ||
frameIter.inPrologue()) {
return true;
}
RootedScript script(cx, frameIter.script());
jsbytecode* valuepc = frameIter.pc();
MOZ_ASSERT(script->containsPC(valuepc));
// Give up if in prologue.
if (valuepc < script->main())
return true;
if (!FindStartPC(cx, frameIter, spindex, skipStackHits, v, &valuepc))
return false;
if (!valuepc)

View file

@ -1331,6 +1331,21 @@ NonBuiltinScriptFrameIter::settle()
}
}
bool
FrameIter::inPrologue() const {
if (pc() < script()->main()) {
return true;
}
// If we do a VM call before pushing locals in baseline, the stack frame will
// not include space for those locals.
if (pc() == script()->code() && isBaseline() &&
data_.jitFrames_.baselineFrameNumValueSlots() < script()->nfixed()) {
return true;
}
return false;
}
ActivationEntryMonitor::ActivationEntryMonitor(JSContext* cx)
: cx_(cx), entryMonitor_(cx->runtime()->entryMonitor)
{

View file

@ -1884,6 +1884,9 @@ class FrameIter
// This is used to provide a raw interface for debugging.
void* rawFramePtr() const;
// Determines if we're in the prologue of a baseline function.
bool inPrologue() const;
private:
Data data_;