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

Unified Diff: runtime/vm/dart.cc

Issue 1584443002: VM: Precompiled rodata snapshot. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: compute string hash if necessary Created 4 years, 10 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/vm/dart.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | 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 d2cc5a8097139417f087c145b4e55a398df8e609..5e563ebf3424c0ccfe39f4a1ec2cc969f0fe6c51 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -50,6 +50,7 @@ ThreadPool* Dart::thread_pool_ = NULL;
DebugInfo* Dart::pprof_symbol_generator_ = NULL;
ReadOnlyHandles* Dart::predefined_handles_ = NULL;
const uint8_t* Dart::instructions_snapshot_buffer_ = NULL;
+const uint8_t* Dart::data_snapshot_buffer_ = NULL;
// Structure for managing read-only global handles allocation used for
// creating global read-only handles that are pre created and initialized
@@ -77,6 +78,7 @@ class ReadOnlyHandles {
const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
const uint8_t* instructions_snapshot,
+ const uint8_t* data_snapshot,
Dart_IsolateCreateCallback create,
Dart_IsolateShutdownCallback shutdown,
Dart_FileOpenCallback file_open,
@@ -158,6 +160,8 @@ const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
if (vm_isolate_snapshot != NULL) {
if (instructions_snapshot != NULL) {
vm_isolate_->SetupInstructionsSnapshotPage(instructions_snapshot);
+ ASSERT(data_snapshot != NULL);
+ vm_isolate_->SetupDataSnapshotPage(data_snapshot);
}
const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot);
if (snapshot == NULL) {
@@ -167,6 +171,7 @@ const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
VmIsolateSnapshotReader reader(snapshot->content(),
snapshot->length(),
instructions_snapshot,
+ data_snapshot,
T);
const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot());
if (!error.IsNull()) {
@@ -427,6 +432,7 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
IsolateSnapshotReader reader(snapshot->content(),
snapshot->length(),
Dart::instructions_snapshot_buffer(),
+ Dart::data_snapshot_buffer(),
T);
const Error& error = Error::Handle(reader.ReadFullSnapshot());
if (!error.IsNull()) {
« no previous file with comments | « runtime/vm/dart.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698