Closed
Bug 620838
Opened 14 years ago
Closed 14 years ago
Incorrect optimization to global with local function inside control flow
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: dmandelin, Assigned: dmandelin)
References
Details
(Keywords: regression, Whiteboard: fixed-in-tracemonkey)
Attachments
(2 files)
326 bytes,
text/plain
|
Details | |
2.27 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
The attached test case fails, because we incorrectly optimize the call to |g| inside |q| to skip straight to the global object. Currently, we check for possibly-aliasing constructs in the current function (DEFFUN, WITH), and suppress that optimization if so via the TCF_FUN_MIGHT_ALIAS_LOCALS flag.
The bug is that we don't propagate that flag downward (i.e., to enclosed lexical scopes). If any outer scope to a given scope X can introduce aliases, then scope X cannot skip straight to the global object.
Patch forthcoming.
Assignee | ||
Comment 1•14 years ago
|
||
Attachment #499207 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•14 years ago
|
blocking2.0: --- → betaN+
Comment 2•14 years ago
|
||
Comment on attachment 499207 [details] [diff] [review]
Patch
>diff --git a/js/src/jsemit.h b/js/src/jsemit.h
> /*
>+ * The function or a function that encloses it may define new local names
>+ * at run time through means other than calling eval.
> */
> #define TCF_FUN_MIGHT_ALIAS_LOCALS 0x4000000
"runtime" seems the more common spelling in js-land to me.
Attachment #499207 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 3•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/5f29abee4321
My personal usage is to write "run time" when it would be replaceable with "compile time", and "runtime" for other issues. grep reveals you are right about established usage in SM, so I switched.
By the way, what do you like put in comment comments for 'r='? Should it be 'waldo', or 'jwalden', or something else?
Whiteboard: fixed-in-tracemonkey
Comment 4•14 years ago
|
||
As long as it clearly identifies the reviewer, which both those do, I don't think it matters. I've seen both used historically. But when I'm pushing patches for others that I've reviewed, I use r=jwalden.
To the extent that I have a preference, which is extremely minimal and has never been enough that I've actually said it to anyone, I prefer r=jwalden because r=Waldo will ping me if I'm on IRC. :-)
Comment 6•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•