Closed
Bug 933798
Opened 11 years ago
Closed 11 years ago
Don't inhibit name optimizations in try blocks
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
bhackett1024
:
review+
|
Details | Diff | Splinter Review |
As discussed on IRC, there's some unnecessary code that's deoptimizing name accesses in try blocks.
This gets rid of the BINDNAME ops that are slowing down the x86 emulator in bug 933369.
Attachment #825952 -
Flags: review?(bhackett1024)
Updated•11 years ago
|
Attachment #825952 -
Flags: review?(bhackett1024) → review+
Comment 1•11 years ago
|
||
This means there's no reason not to support `let` in lazy-parsed functions, right? catch-blocks are just like let-blocks, in terms of scoping.
Comment 2•11 years ago
|
||
(In reply to Jason Orendorff [:jorendorff] from comment #1)
> This means there's no reason not to support `let` in lazy-parsed functions,
> right? catch-blocks are just like let-blocks, in terms of scoping.
This patch just deals with the final emitted bytecode and how we optimize name accesses in functions that were lazily parsed. There's still the issue of handling 'let' blocks when detecting syntax errors during the initial lazy parse.
Assignee | ||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Assignee | ||
Comment 5•11 years ago
|
||
Backed out for causing crashes:
https://hg.mozilla.org/integration/mozilla-inbound/rev/175bebe48034
Assignee | ||
Comment 6•11 years ago
|
||
Hm here's the testcase luke posted in bug 934789. I'm pretty sure that's caused by this bug. Brian do you have any ideas offhand before I dive in? It would be great if we didn't have to deoptimize names in try blocks.
(function() {
function foo() {}
dis(function bar(e) {
try {
(function() { e; });
}
catch (e) {
foo(); // << assertion in dis() here
}
});
}());
Flags: needinfo?(bhackett1024)
Comment 7•11 years ago
|
||
Merge of backout:
https://hg.mozilla.org/mozilla-central/rev/175bebe48034
Updated•11 years ago
|
Target Milestone: mozilla28 → ---
Assignee | ||
Comment 9•11 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM UTC-5] from comment #8)
> Do make sure those testcases get landed :)
jorendorff already pushed tests :)
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b6e3ca41348
Flags: in-testsuite? → in-testsuite+
Assignee | ||
Comment 10•11 years ago
|
||
The old code checked for STMT_TRY and STMT_FINALLY, but STMT_CATCH is the one we care about right? Well, it turns out when we're inside a catch block, the STMT_CATCH StmtInfo has an *outer* STMT_TRY StmtInfo that was used to prevent optimizing name accesses in catch blocks.
This patch checks for STMT_CATCH instead of STMT_TRY/STMT_FINALLY and now passes the two tests that were added.
Attachment #825952 -
Attachment is obsolete: true
Attachment #828230 -
Flags: review?(bhackett1024)
Flags: needinfo?(bhackett1024)
Comment 11•11 years ago
|
||
Comment on attachment 828230 [details] [diff] [review]
Patch v2
Review of attachment 828230 [details] [diff] [review]:
-----------------------------------------------------------------
Sorry for the delay.
Attachment #828230 -
Flags: review?(bhackett1024) → review+
Assignee | ||
Comment 12•11 years ago
|
||
Pushed with some extra tests decoder found:
https://hg.mozilla.org/integration/mozilla-inbound/rev/22237babbbf9
Comment 13•11 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in
before you can comment on or make changes to this bug.
Description
•