Closed
Bug 545573
Opened 15 years ago
Closed 15 years ago
partial flat closure source coordinate fencepost and upvar order-sensitive bugs
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a2
People
(Reporter: brendan, Assigned: brendan)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 2 obsolete files)
4.79 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
See patch for test and fix.
/be
Flags: in-testsuite+
Attachment #426429 -
Flags: review?(jorendorff)
Assignee | ||
Comment 1•15 years ago
|
||
This requires a partial flat closure, as the test shows.
/be
Assignee | ||
Updated•15 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•15 years ago
|
||
TR::record_JSOP_LAMBDA_FC aborts if the compiler-created function object does not have this->globalObj as its parent, but then it relies on scopeChain() to compile the parent to pass to js_AllocFlatClosure. How can that be right when in block scope with a flat upvar bound to a let in that block?
/be
Attachment #426429 -
Attachment is obsolete: true
Attachment #426542 -
Flags: review?(jorendorff)
Attachment #426429 -
Flags: review?(jorendorff)
Assignee | ||
Updated•15 years ago
|
Summary: flat closure source coordinate fencepost bug → partial flat closure source coordinate fencepost and upvar order-sensitive bugs
Assignee | ||
Comment 3•15 years ago
|
||
But broken on new trace-test/tests/closures/partial-flat-closure-1.js -- Jason has thoughts on how to fix.
/be
Attachment #426542 -
Attachment is obsolete: true
Attachment #426550 -
Flags: review?(jorendorff)
Attachment #426542 -
Flags: review?(jorendorff)
Comment 4•15 years ago
|
||
Comment on attachment 426550 [details] [diff] [review]
fix, etc., v3
Two great catches here. I'm in favor of pushing the two fixes without the last test, and filing a separate bug for that.
Attachment #426550 -
Flags: review?(jorendorff) → review+
Comment 5•15 years ago
|
||
There are two separate bugs related to the last test.
1. TR::record_LAMBDA_FC creates a closure parented to the global instead of the current scope chain. It needs to call TR::scopeChain, as TR::record_LAMBDA does.
2. TR::scopeChain() returns the wrong scope chain when we're in a let block.
The easiest fix is to make TR::scopeChain() fallible and have it call js_GetScopeChain and walk the interpreter's stack chain (up to the entry frame) looking for Block objects. If it finds one, abort recording.
Assignee | ||
Comment 6•15 years ago
|
||
Ok, filed bug 545759 per comment 5. Fix without partial-flat-closure-1.js test is in tracemonkey:
http://hg.mozilla.org/tracemonkey/rev/c1a0484b8a23
/be
Whiteboard: fixed-in-tracemonkey
Assignee | ||
Updated•15 years ago
|
Comment 8•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•