Update scalar replacement of MNewCallObject for Warp
Categories
(Core :: JavaScript Engine: JIT, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Bug 1073033 added scalar replacement support for MNewCallObject
, but it needs to be updated to work in Warp, too.
Example:
function f() {
var r = 0;
for (var i = 0; i < 100; ++i) {
var fn = i => () => i;
r += fn(i)();
}
return r;
}
The generated graph is:
48 lambda newcallobject43:Object constant47:Object
53 guardtofunction lambda48:Object
54 guardfunctionscript guardtofunction53:Object
57 functionenvironment guardfunctionscript54:Object
Warp added MGuardToFunction
and MGuardFunctionScript
, which we now need to support during scalar replacement, so that we're able to scalar replace the MNewCallObject
.
Assignee | ||
Comment 1•1 year ago
|
||
This allows to scalar replace the MNewCallObject
in cases like:
function f() {
var r = 0;
for (var i = 0; i < 100; ++i) {
var fn = i => () => i;
r += fn(i)();
}
return r;
}
This code is compiled to:
48 lambda newcallobject43:Object constant47:Object
53 guardtofunction lambda48:Object
54 guardfunctionscript guardtofunction53:Object
57 functionenvironment guardfunctionscript54:Object
MGuardToFunction
and MGuardFunctionScript
weren't present in Ion when scalar
replacement support for MNewCallObject
was originally implemented. For Warp
we need to handle those two instructions, too.
There aren't any new tests, because MNewCallObject
is an implementation detail
and can't be tested from JS. (The MLambda
is already scalar replaced without
this change.)
Updated•1 year ago
|
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/2a9f5a362029 Handle MGuardToFunction and MGuardFunctionScript during scalar replacement. r=iain
Comment 3•1 year ago
|
||
bugherder |
Description
•