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

Unified Diff: runtime/vm/dart.cc

Issue 1311403009: More precompiled snapshotting. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 5 years, 3 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
Index: runtime/vm/dart.cc
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index a838585dda8b87ca9d50bab6a9cb6b1364bd6cb1..7bb02659a0149e7d3a82f1ca25d373657e88b423 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -119,12 +119,14 @@ const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
ASSERT(vm_isolate_ == NULL);
ASSERT(Flags::Initialized());
const bool is_vm_isolate = true;
+ const bool precompiled = instructions_snapshot != NULL;
// Setup default flags for the VM isolate.
Isolate::Flags vm_flags;
Dart_IsolateFlags api_flags;
vm_flags.CopyTo(&api_flags);
vm_isolate_ = Isolate::Init("vm-isolate", api_flags, is_vm_isolate);
+ vm_isolate_->set_compilation_allowed(!precompiled);
// Verify assumptions about executing in the VM isolate.
ASSERT(vm_isolate_ == Isolate::Current());
ASSERT(vm_isolate_ == Thread::Current()->isolate());
@@ -136,10 +138,10 @@ const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
TargetCPUFeatures::InitOnce();
Object::InitOnce(vm_isolate_);
ArgumentsDescriptor::InitOnce();
- StubCode::InitOnce();
- Thread::InitOnceAfterObjectAndStubCode();
- // Now that the needed stub has been generated, set the stack limit.
- vm_isolate_->InitializeStackLimit();
+ // When precompiled the stub code is initialized from the snapshot.
+ if (!precompiled) {
+ StubCode::InitOnce();
+ }
if (vm_isolate_snapshot != NULL) {
const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot);
if (snapshot == NULL) {
@@ -168,6 +170,9 @@ const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
} else {
Symbols::InitOnce(vm_isolate_);
}
+ Thread::InitOnceAfterObjectAndStubCode();
+ // Now that the needed stub has been generated, set the stack limit.
+ vm_isolate_->InitializeStackLimit();
Scanner::InitOnce();
#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
// Dart VM requires at least SSE2.
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/object.h » ('j') | runtime/vm/snapshot.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698