Thanks for your kindly reply. What do you mean "Js natives"? Are they some c++ native functions written in c++ on which v8's build-in js source codes depend?
I noticed that "v8_use_external_startup_data" is only used when " v8_use_snapshot=true". So I thought "v8_use_external_startup_data" just controls whether snapshot data is compiled into the binary. But actually it controls both snapshot data and natives_blob data. Given "v8_use_snapshot=true v8_use_external_startup_data=false", I can find the equivalent of snapshot_blob.bin that is snapshot.cc generated by mksnapshot, but I can't find the equivalent of native_blob.bin. Also I thought "v8_use_snapshot" is used to control the disable/enable of snapshot functionality, but actually it controls the generation of default snapshot data. Even if given "v8_use_snapshot=false", I can still feed v8 with my custom snapshot data. 在 2018年7月17日星期二 UTC+8下午3:31:11,Jakob Gruber写道: > > natives_blob.bin contains the minified source code of JS natives shipped > with V8, while snapshot_blob.bin contains the startup and context > snapshots. We are working on removing natives_blob.bin, hopefully this will > happen sometime this year. > > Given "v8_use_snapshot=true v8_use_external_startup_data=false", the > serialized data is compiled into the binary. > Given "v8_use_snapshot=true v8_use_external_startup_data=true", serialized > data is shipped as the external .bin files you mentioned. > > I hope that helps a bit. I'm not sure I understand your remaining > questions, could you clarify if things are still unclear? > > On Thu, Jul 12, 2018 at 10:52 AM, <fengx...@gmail.com <javascript:>> > wrote: > >> when v8 is compiled with options "v8_use_snapshot=true >> v8_use_external_startup_data=true", two files which are natives_blob.bin >> and snapshot_blob.bin will be generated. when we use v8 in our embedder >> progroam, *V8::InitializeExternalStartupData *need be called to load the >> two files. After that, we need to new a isolate by calling *Isolate::New* >> that will call >> *isolate->set_snapshot_blob(i::Snapshot::DefaultSnapshotBlob());* if we >> don't supply a custom snapshot data by specifing *CreateParams* >> 's snapshot_blob. >> >> But if v8 is complied with options "v8_use_snapshot=true >> v8_use_external_startup_data=false", natives_blob.bin and >> snapshot_blob.bin will not be generated. *V8::InitializeExternalStartupData >> *need not be called. Can I call *Isolate::New *with a custom snapshot >> data that was generated by *SnapshotCreator *Api. Notice in this case no >> natives_blob.bin is supplied. So is natives_blob.bin necessary ? Is >> natives_blob.bin complied into v8 binary? >> >> we can still supply a custom snapshot to *CreateParams even i*f v8 is >> complied with options "v8_use_snapshot=false", is that right? >> >> what is the relationship between natives_blob.bin and snapshot_blob.bin? >> why not just generate one snapshot file? >> >> >> -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.