OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/dart.h" | 5 #include "vm/dart.h" |
6 | 6 |
7 #include "vm/code_observers.h" | 7 #include "vm/code_observers.h" |
8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
9 #include "vm/dart_api_state.h" | 9 #include "vm/dart_api_state.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // Create the VM isolate and finish the VM initialization. | 124 // Create the VM isolate and finish the VM initialization. |
125 ASSERT(thread_pool_ == NULL); | 125 ASSERT(thread_pool_ == NULL); |
126 thread_pool_ = new ThreadPool(); | 126 thread_pool_ = new ThreadPool(); |
127 { | 127 { |
128 ASSERT(vm_isolate_ == NULL); | 128 ASSERT(vm_isolate_ == NULL); |
129 ASSERT(Flags::Initialized()); | 129 ASSERT(Flags::Initialized()); |
130 const bool is_vm_isolate = true; | 130 const bool is_vm_isolate = true; |
131 const bool precompiled = instructions_snapshot != NULL; | 131 const bool precompiled = instructions_snapshot != NULL; |
132 | 132 |
133 // Setup default flags for the VM isolate. | 133 // Setup default flags for the VM isolate. |
134 Isolate::Flags vm_flags; | |
135 Dart_IsolateFlags api_flags; | 134 Dart_IsolateFlags api_flags; |
136 vm_flags.CopyTo(&api_flags); | 135 Isolate::FlagsInitialize(&api_flags); |
137 vm_isolate_ = Isolate::Init("vm-isolate", api_flags, is_vm_isolate); | 136 vm_isolate_ = Isolate::Init("vm-isolate", api_flags, is_vm_isolate); |
138 start_time_ = vm_isolate_->start_time(); | 137 start_time_ = vm_isolate_->start_time(); |
139 vm_isolate_->set_compilation_allowed(!precompiled); | 138 vm_isolate_->set_compilation_allowed(!precompiled); |
140 // Verify assumptions about executing in the VM isolate. | 139 // Verify assumptions about executing in the VM isolate. |
141 ASSERT(vm_isolate_ == Isolate::Current()); | 140 ASSERT(vm_isolate_ == Isolate::Current()); |
142 ASSERT(vm_isolate_ == Thread::Current()->isolate()); | 141 ASSERT(vm_isolate_ == Thread::Current()->isolate()); |
143 | 142 |
144 Thread* T = Thread::Current(); | 143 Thread* T = Thread::Current(); |
145 ASSERT(T != NULL); | 144 ASSERT(T != NULL); |
146 StackZone zone(T); | 145 StackZone zone(T); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 return predefined_handles_->handles_.IsValidScopedHandle(address); | 556 return predefined_handles_->handles_.IsValidScopedHandle(address); |
558 } | 557 } |
559 | 558 |
560 | 559 |
561 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 560 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
562 ASSERT(predefined_handles_ != NULL); | 561 ASSERT(predefined_handles_ != NULL); |
563 return predefined_handles_->api_handles_.IsValidHandle(handle); | 562 return predefined_handles_->api_handles_.IsValidHandle(handle); |
564 } | 563 } |
565 | 564 |
566 } // namespace dart | 565 } // namespace dart |
OLD | NEW |