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

Unified Diff: runtime/bin/run_vm_tests.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/main.cc ('k') | runtime/bin/snapshot_empty.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/run_vm_tests.cc
diff --git a/runtime/bin/run_vm_tests.cc b/runtime/bin/run_vm_tests.cc
index ddb8a4e37bb1846b32cc68cb8dade34fbce15b64..103fede8f86396548ea326c36eeb45e9000d7873 100644
--- a/runtime/bin/run_vm_tests.cc
+++ b/runtime/bin/run_vm_tests.cc
@@ -14,6 +14,12 @@
#include "vm/dart.h"
#include "vm/unit_test.h"
+extern "C" {
+extern const uint8_t kDartVmSnapshotData[];
+extern const uint8_t kDartVmSnapshotInstructions[];
+extern const uint8_t kDartCoreIsolateSnapshotData[];
+extern const uint8_t kDartCoreIsolateSnapshotInstructions[];
+}
// TODO(iposva, asiva): This is a placeholder for the real unittest framework.
namespace dart {
@@ -21,10 +27,16 @@ namespace dart {
// Defined in vm/os_thread_win.cc
extern bool private_flag_windows_run_tls_destructors;
-// vm_snapshot_data_buffer points to a snapshot for the vm isolate if we
-// link in a snapshot otherwise it is initialized to NULL.
-extern const uint8_t* bin::vm_snapshot_data;
-extern const uint8_t* bin::vm_snapshot_instructions;
+// Snapshot pieces when we link in a snapshot.
+#if defined(DART_NO_SNAPSHOT)
+#error "run_vm_tests must be built with a snapshot"
+#else
+const uint8_t* bin::vm_snapshot_data = kDartVmSnapshotData;
+const uint8_t* bin::vm_snapshot_instructions = kDartVmSnapshotInstructions;
+const uint8_t* bin::core_isolate_snapshot_data = kDartCoreIsolateSnapshotData;
+const uint8_t* bin::core_isolate_snapshot_instructions =
+ kDartCoreIsolateSnapshotInstructions;
+#endif
// Only run tests that match the filter string. The default does not match any
// tests.
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/snapshot_empty.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698