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