Added some more docs and rebased to ToT. Please take another look.
https://chromiumcodereview.appspot.com/10795074/diff/16002/include/v8.h File include/v8.h (right): https://chromiumcodereview.appspot.com/10795074/diff/16002/include/v8.h#newcode3260 include/v8.h:3260: * \note \p event_handler won't get notified of existent code. On 2012/07/30 11:43:36, Mikhail Naganov (Chromium) wrote:
One more thing worth mentioning here -- because of missing code
deletion events,
it will be possible for code addition events to arrive having code
addresses
that overlap with previously added code objects. The client needs to
delete all
overlapping code objects first, as they were in fact removed during
GC.
Sorry I forgot about this issue initially.
Thanks! Added docs regarding overlap and string/event lifetimes. https://chromiumcodereview.appspot.com/10795074/diff/16002/src/code-events.cc File src/code-events.cc (right): https://chromiumcodereview.appspot.com/10795074/diff/16002/src/code-events.cc#newcode66 src/code-events.cc:66: SmartArrayPointer<char> name_cstring = name->ToCString(DISALLOW_NULLS); On 2012/07/30 13:33:16, Mikhail Naganov (Chromium) wrote:
On 2012/07/30 11:43:36, Mikhail Naganov (Chromium) wrote: > Are you sure this works correctly? SmartArrayPointer is a scoped
pointer, it
> will delete its contents automatically. You should call Detach to
unmanage the
> pointer. But after that I'm not actually seeing any code that
deletes the
> contents of the string. > > I think what you need is to add deletion of string contents after
calling the
> handler (if it wasn't a static string), and specify this behavior in
the
> documentation.
I'm sorry, I haven't realized you are calling the handler inside this
code
block.
So the only point here is to specify in the documentation the lifetime
of the
string.
I lifted this code pretty much verbatim from GDBJIT, and hadn't considered that it might be wrong. Thanks for the extra eyeballs! I've also looked at the StringBuilder/EmbeddedVector code below - and it looks like it's also correctly discarding the temps on exit. https://chromiumcodereview.appspot.com/10795074/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
