rusty_v8 icon indicating copy to clipboard operation
rusty_v8 copied to clipboard

V8 EmbedderHeapTracer

Open ewoudje opened this issue 4 years ago • 1 comments

A handy util for the embedder, so that you can keep rust data alive if V8 heap references it.

In V8 there is support for the embedder to be able to keep track of references to the outside and inside of V8 heap. With EmbedderHeapTracer together with Object#GetAlignedPointerFromInternalField you can keep a rust Rc alive, this would be handy for storing rust data inside a JS object and so that after a function call from JS the Rc can be used in Rust code again.

Altough I am unsure if such util is within the scope of the V8 crate.

But at this point in time I cannot use the V8 crate to configure any EmbedderHeapTracer, so if possible that the relevant function calls could be exposed so that I or others can use this feature, such as mentioned above.

ewoudje avatar Mar 29 '22 14:03 ewoudje

Instead of exposing EmbedderHeapTracer, we should expose the Oilpan APIs instead (https://v8.dev/blog/oilpan-library). EmbedderHeapTracer is on it's way out.

lucacasonato avatar Apr 02 '22 18:04 lucacasonato