Closed
Bug 1457125
Opened 7 years ago
Closed 7 years ago
Use interpreter fast path for calls also for calls to non-constructors
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(1 file)
1.27 KB,
patch
|
tcampbell
:
review+
|
Details | Diff | Splinter Review |
Noticed this while investigating bug 1449950 in the debugger on Windows.
The interpreter has an inline-call path that's guarded by:
/* Don't bother trying to fast-path calls to scripted non-constructors. */
if (!isFunction || !maybeFun->isInterpreted() || !maybeFun->isConstructor() ||
(!construct && maybeFun->isClassConstructor()))
We were not using this path for calls to some self-hosted function because isConstructor() returns false, but we only care about that if we're actually constructing.
Attachment #8971207 -
Flags: review?(tcampbell)
Assignee | ||
Comment 1•7 years ago
|
||
Note that bug 667824 added this "Don't bother trying to fast-path calls to scripted non-constructors." comment, but back then I think the only non-constructor function was probably Function.prototype -- nowadays we have a lot more of them.
Assignee | ||
Comment 2•7 years ago
|
||
FWIW this improves the micro-benchmark below from 210 ms to 151 ms with --no-baseline
function f() {
var g = () => 1;
var t = new Date;
for (var i = 0; i < 1000000; i++)
g();
print(new Date - t);
}
f();
Comment 3•7 years ago
|
||
Comment on attachment 8971207 [details] [diff] [review]
Patch
Review of attachment 8971207 [details] [diff] [review]:
-----------------------------------------------------------------
Good find. This is going to move a huge amount of normal calls to the "fast-path". Probably worth getting some talos/AWFY results before landing, especially if aiming for FF61.
While you are here, do you mind changing the definition of |construct| to use |IsConstructorCallPC|?
Attachment #8971207 -
Flags: review?(tcampbell) → review+
Comment 4•7 years ago
|
||
Ah, I was missing that functions by default are constructors, even if code doesn't use them as constructors. This looks reasonable then. :)
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/314f5e5e4502
Use interpreter fast path for calls also for calls to non-constructors. r=tcampbell
Comment 6•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•