Closed Bug 1354582 Opened 3 years ago Closed 3 years ago

call/apply inlining should support non-singleton callees

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
This is pretty silly, IonBuilder::getSingleCallTarget (used for call/apply inlining etc) only returns singleton callees, but our inlining code can deal with non-singleton functions just fine. This affects both Ember and React.

The attached patch improves the micro-benchmark below from 772 ms to 57 ms.

function f() {
    var g = (x, y) => x + y;
    var res = 0;
    var t = new Date;
    for (var i=0; i<100000000; i++) {
	res = g.call(null, i, i);
    }
    print(new Date - t);
    return res;
}
f();
Attachment #8855842 - Flags: review?(evilpies)
Comment on attachment 8855842 [details] [diff] [review]
Patch

Review of attachment 8855842 [details] [diff] [review]:
-----------------------------------------------------------------

Great find!

::: js/src/jit/IonBuilder.cpp
@@ +5504,1 @@
>          return abort(AbortReason::Disable, "No singleton callee for eval()");

Nit: No single callee
Attachment #8855842 - Flags: review?(evilpies) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a2abaacf433e
Support non-singleton functions in IonBuilder::getSingleCallTarget. r=evilpie
https://hg.mozilla.org/mozilla-central/rev/a2abaacf433e
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.