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

Unified Diff: runtime/bin/main.cc

Issue 2901163002: Use assembly instead of C array literals to link the core snapshot into the VM. (Closed)
Patch Set: windows Created 3 years, 7 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 | « runtime/bin/bin.gypi ('k') | runtime/bin/run_vm_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 412a2fb25931ebdc459dcb9a8d5626e427c9d4cf..254680f32e5eac082d820bba1288f35e745c8a54 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -36,14 +36,28 @@
#include "vm/kernel.h"
+extern "C" {
+extern const uint8_t kDartVmSnapshotData[];
+extern const uint8_t kDartVmSnapshotInstructions[];
+extern const uint8_t kDartCoreIsolateSnapshotData[];
+extern const uint8_t kDartCoreIsolateSnapshotInstructions[];
+}
+
namespace dart {
namespace bin {
// Snapshot pieces if we link in a snapshot, otherwise initialized to NULL.
-extern const uint8_t* vm_snapshot_data;
-extern const uint8_t* vm_snapshot_instructions;
-extern const uint8_t* core_isolate_snapshot_data;
-extern const uint8_t* core_isolate_snapshot_instructions;
+#if defined(DART_NO_SNAPSHOT)
+const uint8_t* vm_snapshot_data = NULL;
+const uint8_t* vm_snapshot_instructions = NULL;
+const uint8_t* core_isolate_snapshot_data = NULL;
+const uint8_t* core_isolate_snapshot_instructions = NULL;
+#else
+const uint8_t* vm_snapshot_data = kDartVmSnapshotData;
+const uint8_t* vm_snapshot_instructions = kDartVmSnapshotInstructions;
+const uint8_t* core_isolate_snapshot_data = kDartCoreIsolateSnapshotData;
+const uint8_t* core_isolate_snapshot_instructions = kDartVmSnapshotInstructions;
+#endif
/**
* Global state used to control and store generation of application snapshots
« no previous file with comments | « runtime/bin/bin.gypi ('k') | runtime/bin/run_vm_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698