Closed
Bug 617609
Opened 14 years ago
Closed 14 years ago
Upvar analysis marks functions as NULL_CLOSURE incorrectly
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: jimb, Assigned: jorendorff)
References
Details
(Whiteboard: [softblocker][fixed-in-tracemonkey])
Attachments
(1 file)
4.92 KB,
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
In the following code (from bug 554955):
function f(s) {
eval(s);
return function(a) {
var d;
let (c = 3) {
d = function() { a; };
return b;
};
};
}
the inner function gets marked as a NULL_CLOSURE. But since it can refer to a binding created by the eval in f, that's not correct.
This code happens to work because, for null closures, we simply grab the current frame's scope chain to use as the function's parent, because that's more convenient than walking down to get the global, so the closure does end up enclosing f's call object, and the JSOP_NAME finds the right binding.
But it's my understanding that NULL_CLOSURE means that a function doesn't need anything but the global on its scope chain; that's clearly incorrect here.
Reporter | ||
Updated•14 years ago
|
Summary: Upvar analysis marks functions a NULL_CLOSURE incorrectly → Upvar analysis marks functions as NULL_CLOSURE incorrectly
Comment 1•14 years ago
|
||
Nominating because bug 561359 depends on this and that bug is marked as final+ and a softblocker.
blocking2.0: --- → ?
Assignee | ||
Updated•14 years ago
|
Assignee: general → jorendorff
Updated•14 years ago
|
blocking2.0: ? → betaN+
Whiteboard: softblocker
Assignee | ||
Comment 2•14 years ago
|
||
This works, but it deoptimizes a little more than I think we need to.
Instead I bet I can make DeoptimizeUsesWithin mark all functions that directly contain deoptimized uses.
Assignee | ||
Comment 3•14 years ago
|
||
Comment on attachment 505509 [details] [diff] [review]
WIP 1
Correction. It looks like getting from pnu to its containing function in DeoptimizeUsesWithin is more trouble than it's worth. So let's try v1.
The upshot of this is:
function f(s) { // HEAVYWEIGHT
eval(s);
return function(a) { // HEAVYWEIGHT
var d;
let (c = 3) {
d = function() { a; }; // neither heavyweight nor null closure
return b;
};
};
}
Attachment #505509 -
Flags: review?(brendan)
Comment 4•14 years ago
|
||
Comment on attachment 505509 [details] [diff] [review]
WIP 1
Seems fine.
/be
Attachment #505509 -
Flags: review?(brendan) → review+
Assignee | ||
Comment 5•14 years ago
|
||
Whiteboard: softblocker → [softblocker][fixed-in-tracemonkey]
Comment 6•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•