Inline polymorphic [[Construct]] calls to native functions again
Categories
(Core :: JavaScript Engine: JIT, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox66 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(1 file)
|
1.32 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
Inlining polymorphic [[Construct]] calls to inline functions broke in bug 1472132, because the NewTarget of the copied CallInfo wasn't adjusted to hold the currently tested function.
Test case:
function f() {
new Int32Array(8).slice(0);
var ta = new Uint32Array(8);
var r = 0
var t = dateNow()
for (var i = 0; i < 5000000; ++i){
r += ta.slice(0).length;
}
return [dateNow() - t, r];
}
for (var i = 0; i < 5; ++i) print(f());
Before patch:
- First iteration: ~740ms
- Subsequent iterations: ~2600ms
With patch:
- All iterations: ~740ms
| Assignee | ||
Comment 1•6 years ago
|
||
Modifies the NewTarget of the cloned CallInfo to match the current function, similar to [1]. This ensures we don't reject inlining native functions at [2].
[1] https://searchfox.org/mozilla-central/rev/c43240cef5829b8a2dec118faff8a5e1fec6ae1b/js/src/jit/IonBuilder.cpp#4522-4525
[2] https://searchfox.org/mozilla-central/rev/c43240cef5829b8a2dec118faff8a5e1fec6ae1b/js/src/jit/MCallOptimize.cpp#71-76
Comment 2•6 years ago
|
||
| Assignee | ||
Comment 3•6 years ago
|
||
Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1d0d0fed3608
Adjust CallInfo::newTarget to allow inlining polymorphic construct-calls of native functions. r=jandem
Comment 5•6 years ago
|
||
| bugherder | ||
Description
•