Closed
Bug 497015
Opened 15 years ago
Closed 15 years ago
TM: Wrong value with upvars referring to top-level let variables
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: gkw, Assigned: dmandelin)
References
Details
(Keywords: fixed1.9.1, regression, testcase, Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
1.96 KB,
patch
|
gal
:
review+
|
Details | Diff | Splinter Review |
for each(let a in ['', 8888, 8888, /x/]) { ''; for each(e in ['', false, '']) { (function(e) { for each(let c in ['']) { print(a); } })(); for (let aa = 0; aa < 1; ++aa) { a = aa; } } } Note the extra "8888" in JIT'ed output. Tested on 191 revision 2d0f0efc8f14. Patch in bug 496922 comment 2 does not fix this. === $ ./js-dbg-moz191-intelmac js> for each(let a in ['', 8888, 8888, /x/]) { ''; for each(e in ['', false, '']) { (function(e) { for each(let c in ['']) { print(a); } })(); for (let aa = 0; aa < 1; ++aa) { a = aa; } } } 0 0 8888 0 0 8888 0 0 /x/ 0 0 0 js> ^C $ ./js-dbg-moz191-intelmac -j js> for each(let a in ['', 8888, 8888, /x/]) { ''; for each(e in ['', false, '']) { (function(e) { for each(let c in ['']) { print(a); } })(); for (let aa = 0; aa < 1; ++aa) { a = aa; } } } 0 0 8888 0 0 8888 0 8888 /x/ 0 0 0 js>
Flags: blocking1.9.1?
Reporter | ||
Comment 1•15 years ago
|
||
(Not yet an optimal regression window) No difference - http://hg.mozilla.org/tracemonkey/rev/0fb93c90d996 Difference present - http://hg.mozilla.org/tracemonkey/rev/d62fa90d2035 http://hg.mozilla.org/tracemonkey/pushloghtml?fromchange=0fb93c90d996&tochange=d62fa90d2035
Keywords: regression
Assignee | ||
Comment 2•15 years ago
|
||
This appears to be related to setting upvars defined with |let|. The function js_GetUpvarOnTrace is accessing the correct entry on the trace stack, but that entry has the wrong value--it has the value before the assignment |a=aa|.
Updated•15 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
Assignee | ||
Updated•15 years ago
|
Assignee: general → dmandelin
Assignee | ||
Comment 3•15 years ago
|
||
Since this is a blocker, I should add that it can be quick-fixed by aborting tracing of a JSOP_GETUPVAR when the target frame (containing uvpar definition) has no |fun| member inside TraceRecorder::upvar(). For now, I'll try to fix it so it doesn't have to abort.
Assignee | ||
Comment 4•15 years ago
|
||
The |!fp->fun| case of upvar access was not being handled correctly. Specifically, if the argument to JSOP_GETUPVAR is |n|, then when reading from the interpreter, we should read from position |n+fp->fun->nfixed|. (This is defined by js_GetUpVar.) But if we are reading from the trace native stack, the callee, this, args, and locals are not pushed to the native stack, so we should read from position |n| of the slots area of the stack frame. I didn't realize earlier that the addressing needed to be different for the two cases. The test case doesn't fail inside the regression test suite, so I can't really check in a test case. I have a personal directory of standalone files that I use as personal upvar regression tests, and I have added it there.
Attachment #382404 -
Flags: review?(gal)
Updated•15 years ago
|
Attachment #382404 -
Flags: review?(gal) → review+
Assignee | ||
Comment 5•15 years ago
|
||
Pushed to TM as bf1e2a11e031.
Whiteboard: fixed-in-tracemonkey
Assignee | ||
Updated•15 years ago
|
Summary: TM: Different values with testcase containing for...in, print, function → TM: Wrong value with upvars referring to top-level let variables
Comment 6•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/bf1e2a11e031
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 8•15 years ago
|
||
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/da574c09d790
Keywords: fixed1.9.1
Reporter | ||
Updated•15 years ago
|
Flags: in-testsuite?
Comment 9•11 years ago
|
||
Bug in removed tracer code, setting in-testsuite- flag.
Flags: in-testsuite? → in-testsuite-
You need to log in
before you can comment on or make changes to this bug.
Description
•