| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 if (FLAG_support_timeline) { | 142 if (FLAG_support_timeline) { |
| 143 Timeline::InitOnce(); | 143 Timeline::InitOnce(); |
| 144 } | 144 } |
| 145 NOT_IN_PRODUCT( | 145 NOT_IN_PRODUCT( |
| 146 TimelineDurationScope tds(Timeline::GetVMStream(), "Dart::InitOnce")); | 146 TimelineDurationScope tds(Timeline::GetVMStream(), "Dart::InitOnce")); |
| 147 Isolate::InitOnce(); | 147 Isolate::InitOnce(); |
| 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 NativeSymbolResolver::InitOnce(); |
| 152 NOT_IN_PRODUCT(CodeObservers::InitOnce()); | 153 NOT_IN_PRODUCT(CodeObservers::InitOnce()); |
| 153 if (FLAG_profiler) { | 154 NOT_IN_PRODUCT(Profiler::InitOnce()); |
| 154 ThreadInterrupter::InitOnce(); | |
| 155 Profiler::InitOnce(); | |
| 156 } | |
| 157 SemiSpace::InitOnce(); | 155 SemiSpace::InitOnce(); |
| 158 NOT_IN_PRODUCT(Metric::InitOnce()); | 156 NOT_IN_PRODUCT(Metric::InitOnce()); |
| 159 StoreBuffer::InitOnce(); | 157 StoreBuffer::InitOnce(); |
| 160 MarkingStack::InitOnce(); | 158 MarkingStack::InitOnce(); |
| 161 | 159 |
| 162 #if defined(USING_SIMULATOR) | 160 #if defined(USING_SIMULATOR) |
| 163 Simulator::InitOnce(); | 161 Simulator::InitOnce(); |
| 164 #endif | 162 #endif |
| 165 // Create the read-only handles area. | 163 // Create the read-only handles area. |
| 166 ASSERT(predefined_handles_ == NULL); | 164 ASSERT(predefined_handles_ == NULL); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 ASSERT(Isolate::Current() == NULL); | 345 ASSERT(Isolate::Current() == NULL); |
| 348 if (vm_isolate_ == NULL) { | 346 if (vm_isolate_ == NULL) { |
| 349 return "VM already terminated."; | 347 return "VM already terminated."; |
| 350 } | 348 } |
| 351 | 349 |
| 352 if (FLAG_trace_shutdown) { | 350 if (FLAG_trace_shutdown) { |
| 353 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Starting shutdown\n", | 351 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Starting shutdown\n", |
| 354 UptimeMillis()); | 352 UptimeMillis()); |
| 355 } | 353 } |
| 356 | 354 |
| 357 if (FLAG_profiler) { | 355 #if !defined(PRODUCT) |
| 358 // Shut down profiling. | 356 if (FLAG_trace_shutdown) { |
| 359 if (FLAG_trace_shutdown) { | 357 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Shutting down profiling\n", |
| 360 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Shutting down profiling\n", | 358 UptimeMillis()); |
| 361 UptimeMillis()); | |
| 362 } | |
| 363 Profiler::Shutdown(); | |
| 364 } | 359 } |
| 360 Profiler::Shutdown(); |
| 361 #endif // !defined(PRODUCT) |
| 362 |
| 363 NativeSymbolResolver::ShutdownOnce(); |
| 365 | 364 |
| 366 { | 365 { |
| 367 // Set the VM isolate as current isolate when shutting down | 366 // Set the VM isolate as current isolate when shutting down |
| 368 // Metrics so that we can use a StackZone. | 367 // Metrics so that we can use a StackZone. |
| 369 if (FLAG_trace_shutdown) { | 368 if (FLAG_trace_shutdown) { |
| 370 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Entering vm isolate\n", | 369 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Entering vm isolate\n", |
| 371 UptimeMillis()); | 370 UptimeMillis()); |
| 372 } | 371 } |
| 373 bool result = Thread::EnterIsolate(vm_isolate_); | 372 bool result = Thread::EnterIsolate(vm_isolate_); |
| 374 ASSERT(result); | 373 ASSERT(result); |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 ASSERT(predefined_handles_ != NULL); | 748 ASSERT(predefined_handles_ != NULL); |
| 750 return predefined_handles_->handles_.IsValidScopedHandle(address); | 749 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 751 } | 750 } |
| 752 | 751 |
| 753 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 752 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 754 ASSERT(predefined_handles_ != NULL); | 753 ASSERT(predefined_handles_ != NULL); |
| 755 return predefined_handles_->api_handles_.IsValidHandle(handle); | 754 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 756 } | 755 } |
| 757 | 756 |
| 758 } // namespace dart | 757 } // namespace dart |
| OLD | NEW |