Skip to content

Commit

Permalink
Fix macOS snapshot path
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Jul 22, 2021
1 parent 4104eca commit 9fcf692
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/init/startup-data-util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,16 @@ void InitializeExternalStartupData(const char* directory_path) {
}
#endif
#endif
std::unique_ptr<char[]> snapshot = base::RelativePath(directory_path, "v8_context_snapshot.bin");
#ifdef __APPLE__
#if V8_TARGET_ARCH_X64
const char* snapshot_name = "v8_context_snapshot.x86_64.bin";
#else
const char* snapshot_name = "v8_context_snapshot.arm64.bin";
#endif
#else
const char* snapshot_name = "v8_context_snapshot.bin";
#endif
std::unique_ptr<char[]> snapshot = base::RelativePath(directory_path, snapshot_name);
LoadFromFile(snapshot.get());
#endif // V8_USE_EXTERNAL_STARTUP_DATA
}
Expand Down

0 comments on commit 9fcf692

Please sign in to comment.