Closed Bug 565974 Opened 16 years ago Closed 15 years ago

generators need not be rooted by call/args objects when closed

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: luke, Unassigned)

Details

Although this isn't the biggest source of garbage in the world, I noticed, in situations where a generator creates an escaping closure that requires a scope chain: function f() { var x = 3; g = function() { return x } ++x; } that after the generator is closed, it is still marked by its call and args objects, since we don't call fp->putActivationObjects() in SendToGenerator. (This is true before and after the change in bug 540706.) If we did call fp->putActivationObjects(), the private field of activation objects would be null and the generator would be free to be GC'd (assuming it wasn't rooted elsewhere). Not a really big deal though...
Nit: your example isn't actually a generator. Quick patch: function f() { if (false) { yield } var x = 3; g = function() { return x } ++x; } Dave
Hah, good point.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.