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)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a2

People

(Reporter: brendan, Assigned: brendan)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 2 obsolete files)

Attached patch fix with test (obsolete) — Splinter Review
See patch for test and fix. /be
Flags: in-testsuite+
Attachment #426429 - Flags: review?(jorendorff)
This requires a partial flat closure, as the test shows. /be
Status: NEW → ASSIGNED
Attached patch fix with tests, v2 (obsolete) — Splinter Review
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)
Summary: flat closure source coordinate fencepost bug → partial flat closure source coordinate fencepost and upvar order-sensitive bugs
Attached patch fix, etc., v3Splinter Review
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 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+
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.
Blocks: 545759
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
No longer blocks: 545759
Depends on: 545759
No longer depends on: 545759
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.

Attachment

General

Created:
Updated:
Size: