Closed Bug 1784015 Opened 2 years ago Closed 2 years ago

Inline inlinable natives through JSOp::FunApply

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(4 files)

Like bug 1738413 except for FunApplyArray. This will allow to optimise bug 1674143 when apply instead of spread arguments are used.

Add some extra assertions to make it more clear which argument
formats are possible in specific functions.

We're already emitting writer.guardArrayIsPacked(), so we should also make
sure the array is packed before trying to attach the stub.

Depends on D154200

Just some preparation for the next part.

Depends on D154201

Use code similar to tryAttachFunCall() to handle inlinable natives in
tryAttachFunApply(). Except there was one major obstacle: Warp doesn't like it
when arguments are loaded another time, cf. WarpCacheIRTranspiler::setArgumentId()
which asserts when the argumentOperandIds_ is already valid. To workaround this
limitation we have to return the argObjId from emitFunApplyGuard() and then
use a combined emitNativeCalleeGuardAndLoadArgsArray() method to guard the native
and return the argument array ObjOperandId.

Test cases were copied from "cacheir/spread-minmax-N.js".

Depends on D154202

Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/6eac61e4eeca
Part 1: Add some extra assertions. r=jandem
https://hg.mozilla.org/integration/autoland/rev/1ca6cd186221
Part 2: Don't attach FunApply when the args-array is non-packed. r=jandem
https://hg.mozilla.org/integration/autoland/rev/600ca9699c93
Part 3: Extract emitFunApplyGuard. r=jandem
https://hg.mozilla.org/integration/autoland/rev/473325749985
Part 4: Support FunApplyArray in InlinableNativeIRGenerator. r=jandem
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: