| 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/become.h" | 7 #include "vm/become.h" |
| 8 #include "vm/clustered_snapshot.h" | 8 #include "vm/clustered_snapshot.h" |
| 9 #include "vm/code_observers.h" | 9 #include "vm/code_observers.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 PortMap::InitOnce(); | 148 PortMap::InitOnce(); |
| 149 FreeListElement::InitOnce(); | 149 FreeListElement::InitOnce(); |
| 150 ForwardingCorpse::InitOnce(); | 150 ForwardingCorpse::InitOnce(); |
| 151 Api::InitOnce(); | 151 Api::InitOnce(); |
| 152 NOT_IN_PRODUCT(CodeObservers::InitOnce()); | 152 NOT_IN_PRODUCT(CodeObservers::InitOnce()); |
| 153 if (FLAG_profiler) { | 153 if (FLAG_profiler) { |
| 154 ThreadInterrupter::InitOnce(); | 154 ThreadInterrupter::InitOnce(); |
| 155 Profiler::InitOnce(); | 155 Profiler::InitOnce(); |
| 156 } | 156 } |
| 157 SemiSpace::InitOnce(); | 157 SemiSpace::InitOnce(); |
| 158 Metric::InitOnce(); | 158 NOT_IN_PRODUCT(Metric::InitOnce()); |
| 159 StoreBuffer::InitOnce(); | 159 StoreBuffer::InitOnce(); |
| 160 MarkingStack::InitOnce(); | 160 MarkingStack::InitOnce(); |
| 161 | 161 |
| 162 #if defined(USING_SIMULATOR) | 162 #if defined(USING_SIMULATOR) |
| 163 Simulator::InitOnce(); | 163 Simulator::InitOnce(); |
| 164 #endif | 164 #endif |
| 165 // Create the read-only handles area. | 165 // Create the read-only handles area. |
| 166 ASSERT(predefined_handles_ == NULL); | 166 ASSERT(predefined_handles_ == NULL); |
| 167 predefined_handles_ = new ReadOnlyHandles(); | 167 predefined_handles_ = new ReadOnlyHandles(); |
| 168 // Create the VM isolate and finish the VM initialization. | 168 // Create the VM isolate and finish the VM initialization. |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 365 |
| 366 { | 366 { |
| 367 // Set the VM isolate as current isolate when shutting down | 367 // Set the VM isolate as current isolate when shutting down |
| 368 // Metrics so that we can use a StackZone. | 368 // Metrics so that we can use a StackZone. |
| 369 if (FLAG_trace_shutdown) { | 369 if (FLAG_trace_shutdown) { |
| 370 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Entering vm isolate\n", | 370 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Entering vm isolate\n", |
| 371 UptimeMillis()); | 371 UptimeMillis()); |
| 372 } | 372 } |
| 373 bool result = Thread::EnterIsolate(vm_isolate_); | 373 bool result = Thread::EnterIsolate(vm_isolate_); |
| 374 ASSERT(result); | 374 ASSERT(result); |
| 375 Metric::Cleanup(); | 375 NOT_IN_PRODUCT(Metric::Cleanup()); |
| 376 Thread::ExitIsolate(); | 376 Thread::ExitIsolate(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 // Disable the creation of new isolates. | 379 // Disable the creation of new isolates. |
| 380 if (FLAG_trace_shutdown) { | 380 if (FLAG_trace_shutdown) { |
| 381 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Disabling isolate creation\n", | 381 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Disabling isolate creation\n", |
| 382 UptimeMillis()); | 382 UptimeMillis()); |
| 383 } | 383 } |
| 384 Isolate::DisableIsolateCreation(); | 384 Isolate::DisableIsolateCreation(); |
| 385 | 385 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 ASSERT(predefined_handles_ != NULL); | 749 ASSERT(predefined_handles_ != NULL); |
| 750 return predefined_handles_->handles_.IsValidScopedHandle(address); | 750 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 751 } | 751 } |
| 752 | 752 |
| 753 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 753 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 754 ASSERT(predefined_handles_ != NULL); | 754 ASSERT(predefined_handles_ != NULL); |
| 755 return predefined_handles_->api_handles_.IsValidHandle(handle); | 755 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 756 } | 756 } |
| 757 | 757 |
| 758 } // namespace dart | 758 } // namespace dart |
| OLD | NEW |