Chromium Code Reviews| Index: runtime/vm/dart.cc |
| diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc |
| index a0f8584168dfbe011c6d4cb3eb835c5d8fb3d1f3..267702aa081345700e78f2f69ae315272245ccfb 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,11 @@ 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(); |
| + if (precompiled) { |
| + // Stub code loaded from snapshot. |
| + } else { |
| + StubCode::InitOnce(); |
| + } |
|
siva
2015/09/14 20:32:59
Would read better as:
// When precompiling the st
rmacnak
2015/09/15 17:56:42
Done.
|
| if (vm_isolate_snapshot != NULL) { |
| const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); |
| if (snapshot == NULL) { |
| @@ -168,6 +171,9 @@ const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot, |
| } else { |
| Symbols::InitOnce(vm_isolate_); |
|
siva
2015/09/14 20:32:59
Maybe the if (!precompiled) check from above shoul
rmacnak
2015/09/15 17:56:42
Yes, precompiled implies there is a vm isolate sna
|
| } |
| + 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. |