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