Status: Accepted
Owner: [email protected]
CC: [email protected],  [email protected],  [email protected]
Labels: Type-Bug Priority-Medium

New issue 3289 by [email protected]: Suspended generator activations can become invalid when debugging is enabled
http://code.google.com/p/v8/issues/detail?id=3289

Generator objects represent suspended function activations. A generator object encapsulates the state of a function by reifying it on the heap. The data is the context, a slice of the operand stack, the receiver, the function being called, and an offset within the function's code: the continuation.

When a generator activation is resumed, we reconstruct a stack frame, and then jump into the middle of the function, by looking up the function's entry code pointer, then adding the continuation (the code offset) to that pointer. This strategy allows for the function's code to be relocated.

However, if a function is recompiled for debugging mode, the offset is invalid. This can lead to all kinds of bugs.

I guess we should hold onto the code object in the generator object, not just the function. We should probably rely on deoptimization-on-return to convert the continuation to debugging (or not-debugging) mode. Perhaps GeneratorResume should check that it is restoring in the same mode it was captured in.

Somewhat related would be LiveEdit of a generator function -- can you do it? do suspended activations reflect the changes? (I would say yes and no, respectively -- and no, it doesn't work now for the same reasons as this bug.)

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to