0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 07:01:52 +00:00

correctly load V8 8.x snapshot blob

This commit is contained in:
Stefan Siegl 2020-03-06 10:30:47 +01:00
parent 801c744885
commit 8fe3cbc292
No known key found for this signature in database
GPG Key ID: 73942AF5642F3DDA

View File

@ -52,12 +52,20 @@ void v8js_v8_init() /* {{{ */
}
#endif
#if defined(PHP_V8_NATIVES_BLOB_PATH) && defined(PHP_V8_SNAPSHOT_BLOB_PATH)
#if defined(PHP_V8_SNAPSHOT_BLOB_PATH)
#if !defined(PHP_V8_NATIVES_BLOB_PATH)
/* Newer V8 version don't have a natives blob anymore. */
v8::V8::InitializeExternalStartupDataFromFile(
PHP_V8_SNAPSHOT_BLOB_PATH
);
#else
/* V8 doesn't work without startup data, load it. */
v8::V8::InitializeExternalStartupData(
PHP_V8_NATIVES_BLOB_PATH,
PHP_V8_SNAPSHOT_BLOB_PATH
);
#endif
#endif
v8js_process_globals.v8_platform = v8::platform::NewDefaultPlatform();