rusty_v8
rusty_v8 copied to clipboard
Support loading snapshots before snapshotting
Hi,
I noticed that in runtime.rs
there is a TODO around supporting loading snapshots and snapshotting on the same instance. It's a feature I'd find quite useful so I did some digging.
It looks like V8 supports receiving a StartupData
in the constructor of SnapshotCreator
(source). I tried naively updating rusty_v8
to use that parameter, but I get an assertion failure:
# Fatal error in ../../../../v8/src/api/api.cc, line 636
# Debug check failed: data->created_.
Is there anything I can do to help get that todo item done?
@NickGeek I've transferred the issue to rusty_v8
repo as it must first be implemented here before we can add that feature to deno
itself.
@NickGeek please open a PR with your code; the error you got suggests that snapshot was not taken before dropping the isolate.
@bartlomieju Sweet, thanks. I'll try and get that up tonight. Just a warning: it's definitely in a draft state, I was mostly just seeing if I could get something to work.
I've made a PR with the changes I tried at #555
This is now supported.