Closed
Bug 922406
Opened 12 years ago
Closed 10 years ago
Top-level use of "this" prevents ion compilation
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla45
| Tracking | Status | |
|---|---|---|
| firefox45 | --- | fixed |
People
(Reporter: jruderman, Assigned: jandem)
References
Details
(Keywords: perf, regression, testcase)
Attachments
(2 files)
|
14.15 KB,
text/plain
|
Details | |
|
2.38 KB,
patch
|
shu
:
review+
|
Details | Diff | Splinter Review |
Removing the second line of this shell program makes it 9x faster:
var start = dateNow();
this.Array;
for (var i = 0; i < 10000000; ++i) {}
var end = dateNow();
print(Math.floor(end - start) + " ms");
Pretty much anything more complicated than "this;" causes the slowdown, e.g.
* this.Array;
* this, {};
* (function(){})(this); // often needed for asm modules or strict-mode code
I noticed this slowdown while converting Mersenne Twister to asm style.
| Reporter | ||
Comment 1•12 years ago
|
||
| Reporter | ||
Comment 2•12 years ago
|
||
Regression range depends on the exact second line. The attachment above is for "this, {};". Its large regression range seems to be due to hgrange('d2cce982a7c8', '4a6b8dd4dfe3'), # broken virtualenv
| Reporter | ||
Comment 3•12 years ago
|
||
> (function(){})(this)
The first bad revision is:
changeset: http://hg.mozilla.org/mozilla-central/rev/e0bc47d3f814
user: Jan de Mooij
date: Mon Dec 17 11:04:08 2012 +0100
summary: Bug 821682 - Compile DEFVAR, DEFCONST and PICK. r=djvj
> this.Array;
The first bad revision is:
changeset: http://hg.mozilla.org/mozilla-central/rev/c13b9e58eedb
user: Jan de Mooij
date: Wed Dec 19 09:43:22 2012 +0100
summary: Bug 822744 - Compile OBJECT, REGEXP, LAMBDA. r=djvj
> this, {};
Large regression range in comment 1.
Updated•10 years ago
|
Component: JavaScript Engine → JavaScript Engine: JIT
OS: Mac OS X → All
Hardware: x86_64 → All
Comment 4•10 years ago
|
||
Not sure if this is still valid, but putting a needinfo on jandem to be sure.
Flags: needinfo?(jdemooij)
Comment 5•10 years ago
|
||
With 'this.Array;' I get 260ms on Nightly and 45ms on Chrome 43
Without 'this.Array;' I get 23ms on Nightly and 45ms on Chrome 43.
| Assignee | ||
Comment 6•10 years ago
|
||
(In reply to Christian Holler (:decoder) from comment #4)
> Not sure if this is still valid, but putting a needinfo on jandem to be sure.
It is, thanks for the reminder. Patch in a bit.
| Assignee | ||
Comment 7•10 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #6)
> (In reply to Christian Holler (:decoder) from comment #4)
> > Not sure if this is still valid, but putting a needinfo on jandem to be sure.
>
> It is, thanks for the reminder. Patch in a bit.
Actually, this bug is a fair amount of work to fix: we either (1) should add an extra MBasicBlock/snapshot slot for `this` in global scripts, or (2) fix bug 1125423, so that we have the global `this` for the compartment readily available.
(2) is a bit annoying because it requires changes outside SpiderMonkey, but I think it's where we want to be long-term so I'd prefer it over putting a lot of effort on (1). Unfortunately neither of these is trivial.
Depends on: 1125423
Flags: needinfo?(jdemooij)
| Assignee | ||
Comment 9•10 years ago
|
||
After all the other changes, fixing this is almost trivial.
Comment 10•10 years ago
|
||
Comment on attachment 8691334 [details] [diff] [review]
Patch
Review of attachment 8691334 [details] [diff] [review]:
-----------------------------------------------------------------
A triumph.
Attachment #8691334 -
Flags: review?(shu) → review+
Comment 11•10 years ago
|
||
Comment 12•10 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•