rusty_v8 icon indicating copy to clipboard operation
rusty_v8 copied to clipboard

Support loading snapshots before snapshotting

Open NickGeek opened this issue 4 years ago • 4 comments

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 avatar Dec 06 '20 02:12 NickGeek

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

bartlomieju avatar Dec 06 '20 13:12 bartlomieju

@NickGeek please open a PR with your code; the error you got suggests that snapshot was not taken before dropping the isolate.

bartlomieju avatar Dec 06 '20 14:12 bartlomieju

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

NickGeek avatar Dec 08 '20 02:12 NickGeek

I've made a PR with the changes I tried at #555

NickGeek avatar Dec 09 '20 10:12 NickGeek

This is now supported.

bartlomieju avatar Nov 28 '22 22:11 bartlomieju