mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 20:37:31 +09:00
[js] Simplify tracing of arguments in MarkThisAndArguments.
This commit is contained in:
parent
1ddd3ea76b
commit
dc52303799
1 changed files with 13 additions and 13 deletions
|
|
@ -1049,31 +1049,31 @@ MarkThisAndArguments(JSTracer* trc, const JitFrameIterator& frame)
|
||||||
if (!CalleeTokenIsFunction(layout->calleeToken()))
|
if (!CalleeTokenIsFunction(layout->calleeToken()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
size_t nargs = layout->numActualArgs();
|
|
||||||
size_t nformals = 0;
|
|
||||||
|
|
||||||
JSFunction* fun = CalleeTokenToFunction(layout->calleeToken());
|
JSFunction* fun = CalleeTokenToFunction(layout->calleeToken());
|
||||||
if (!frame.isExitFrameLayout<LazyLinkExitFrameLayout>() &&
|
size_t numFormals = fun->nargs();
|
||||||
!fun->nonLazyScript()->mayReadFrameArgsDirectly())
|
size_t numArgs = Max(layout->numActualArgs(), numFormals);
|
||||||
{
|
size_t firstArg = 0;
|
||||||
nformals = fun->nargs();
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t newTargetOffset = Max(nargs, fun->nargs());
|
if (!frame.isExitFrameLayout<LazyLinkExitFrameLayout>() &&
|
||||||
|
!fun->nonLazyScript()->mayReadFrameArgsDirectly()) {
|
||||||
|
firstArg = numFormals;
|
||||||
|
}
|
||||||
|
|
||||||
Value* argv = layout->argv();
|
Value* argv = layout->argv();
|
||||||
|
|
||||||
// Trace |this|.
|
// Trace |this|.
|
||||||
TraceRoot(trc, argv, "ion-thisv");
|
TraceRoot(trc, argv, "ion-thisv");
|
||||||
|
|
||||||
// Trace actual arguments beyond the formals. Note + 1 for thisv.
|
// Trace arguments. Note + 1 for thisv.
|
||||||
for (size_t i = nformals + 1; i < nargs + 1; i++)
|
for (size_t i = firstArg; i < numArgs; i++) {
|
||||||
TraceRoot(trc, &argv[i], "ion-argv");
|
TraceRoot(trc, &argv[i + 1], "ion-argv");
|
||||||
|
}
|
||||||
|
|
||||||
// Always mark the new.target from the frame. It's not in the snapshots.
|
// Always mark the new.target from the frame. It's not in the snapshots.
|
||||||
// +1 to pass |this|
|
// +1 to pass |this|
|
||||||
if (CalleeTokenIsConstructing(layout->calleeToken()))
|
if (CalleeTokenIsConstructing(layout->calleeToken())) {
|
||||||
TraceRoot(trc, &argv[1 + newTargetOffset], "ion-newTarget");
|
TraceRoot(trc, &argv[1 + numArgs], "ion-newTarget");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JS_NUNBOX32
|
#ifdef JS_NUNBOX32
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue