Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Unified Diff: runtime/vm/dart.cc

Issue 1902423003: Make Dart_Initialize fail if a VM built as a JIT runtime gets a precompiled snapshot or vice versa. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart.cc
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index f50a22b9e8a7aec85589081d5c8f54ef20ebdd81..d005ceee306f93553e07c9bde4dc37c532fddac2 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -131,6 +131,15 @@ const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
if (vm_isolate_ != NULL || !Flags::Initialized()) {
return "VM already initialized or flags not initialized.";
}
+#if defined(DART_PRECOMPILED_RUNTIME)
+ if (instructions_snapshot == NULL) {
+ return "Precompiled runtime requires a precompiled snapshot";
+ }
+#else
+ if (instructions_snapshot != NULL) {
+ return "JIT runtime cannot run a precompiled snapshot";
+ }
+#endif
set_thread_exit_callback(thread_exit);
SetFileCallbacks(file_open, file_read, file_write, file_close);
set_entropy_source_callback(entropy_source);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698