Toon, thanks for taking a look, working on a better patch.


https://codereview.chromium.org/475423003/diff/60001/src/heap/heap.cc
File src/heap/heap.cc (right):

https://codereview.chromium.org/475423003/diff/60001/src/heap/heap.cc#newcode3758
src/heap/heap.cc:3758: if (source->IsJSFunction()) {
On 2014/08/18 14:15:35, Toon Verwaest wrote:
Are you sure this works? What code object does this get? What if it's
optimized?
If we also become optimized, will we get notified in case the function
deoptimizes?

Can you just make a specialized JSFunction::Copy(), that preferably
uses
NewFunctionFromSharedFunctionInfo, but additionally copies over
properties and
prototype?

You are quite right, it is easy to write a test that crashes.
JSFunction::Copy is a way to go I guess. Another way would be to
properly wire up the JSFunction's clone into the functions' list etc.
but that would break whenever that logic changes because people will
forget to update the cloning logic (people will forget to update
JSFunction::Copy logic as well that that might just be a less frequent
change)

https://codereview.chromium.org/475423003/

--
--
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