Closed Bug 1740683 Opened 3 years ago Closed 2 years ago

Support extra formals when replacing the rest array for MApplyArray and MConstructArray

Categories

(Core :: JavaScript Engine: JIT, task, P3)

task

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Replacing the rest array for MApplyArray and MConstructArray uses MApplyArgs resp. MConstructArgs. If we want to support replacing rest arrays when extra formals are present, MApplyArgs and MConstructArgs need to be updated to handle this case.

// Rest array is replaced when no extra formals are present.
function noExtraFormals(...rest) {
  return f(...rest);
}

// Rest array is _not_ replaced when extra formals are present.
function extraFormals(a, ...rest) {
  return f(...rest);
}
Priority: -- → P3

Pass through the number of formals, so we know how many initial arguments we have to skip
in CodeGenerator::emitPushArguments(). The actual number of arguments (argc) for
M(Apply|Construct)Args is computed through Math.max(numActuals - numFormals, 0).

Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b8defeb29902
Scalar replace rest array spread calls with extra formals. r=iain
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: