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" |
11 #include "vm/dart_api_state.h" | 11 #include "vm/dart_api_state.h" |
12 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
13 #include "vm/debugger.h" | 13 #include "vm/debugger.h" |
14 #include "vm/flags.h" | 14 #include "vm/flags.h" |
15 #include "vm/freelist.h" | 15 #include "vm/freelist.h" |
16 #include "vm/handles.h" | 16 #include "vm/handles.h" |
17 #include "vm/heap.h" | 17 #include "vm/heap.h" |
18 #include "vm/isolate.h" | 18 #include "vm/isolate.h" |
19 #include "vm/kernel_isolate.h" | 19 #include "vm/kernel_isolate.h" |
20 #include "vm/malloc_hooks.h" | |
21 #include "vm/message_handler.h" | 20 #include "vm/message_handler.h" |
22 #include "vm/metrics.h" | 21 #include "vm/metrics.h" |
23 #include "vm/object.h" | 22 #include "vm/object.h" |
24 #include "vm/object_store.h" | 23 #include "vm/object_store.h" |
25 #include "vm/object_id_ring.h" | 24 #include "vm/object_id_ring.h" |
26 #include "vm/port.h" | 25 #include "vm/port.h" |
27 #include "vm/profiler.h" | 26 #include "vm/profiler.h" |
28 #include "vm/service_isolate.h" | 27 #include "vm/service_isolate.h" |
29 #include "vm/simulator.h" | 28 #include "vm/simulator.h" |
30 #include "vm/snapshot.h" | 29 #include "vm/snapshot.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 FLAG_verify_gc_contains = true; | 147 FLAG_verify_gc_contains = true; |
149 } | 148 } |
150 #endif | 149 #endif |
151 set_thread_exit_callback(thread_exit); | 150 set_thread_exit_callback(thread_exit); |
152 SetFileCallbacks(file_open, file_read, file_write, file_close); | 151 SetFileCallbacks(file_open, file_read, file_write, file_close); |
153 set_entropy_source_callback(entropy_source); | 152 set_entropy_source_callback(entropy_source); |
154 OS::InitOnce(); | 153 OS::InitOnce(); |
155 start_time_micros_ = OS::GetCurrentMonotonicMicros(); | 154 start_time_micros_ = OS::GetCurrentMonotonicMicros(); |
156 VirtualMemory::InitOnce(); | 155 VirtualMemory::InitOnce(); |
157 OSThread::InitOnce(); | 156 OSThread::InitOnce(); |
158 MallocHooks::InitOnce(); | |
159 if (FLAG_support_timeline) { | 157 if (FLAG_support_timeline) { |
160 Timeline::InitOnce(); | 158 Timeline::InitOnce(); |
161 } | 159 } |
162 NOT_IN_PRODUCT( | 160 NOT_IN_PRODUCT( |
163 TimelineDurationScope tds(Timeline::GetVMStream(), "Dart::InitOnce")); | 161 TimelineDurationScope tds(Timeline::GetVMStream(), "Dart::InitOnce")); |
164 Isolate::InitOnce(); | 162 Isolate::InitOnce(); |
165 PortMap::InitOnce(); | 163 PortMap::InitOnce(); |
166 FreeListElement::InitOnce(); | 164 FreeListElement::InitOnce(); |
167 ForwardingCorpse::InitOnce(); | 165 ForwardingCorpse::InitOnce(); |
168 Api::InitOnce(); | 166 Api::InitOnce(); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 if (FLAG_support_timeline) { | 484 if (FLAG_support_timeline) { |
487 if (FLAG_trace_shutdown) { | 485 if (FLAG_trace_shutdown) { |
488 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Shutting down timeline\n", | 486 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Shutting down timeline\n", |
489 UptimeMillis()); | 487 UptimeMillis()); |
490 } | 488 } |
491 Timeline::Shutdown(); | 489 Timeline::Shutdown(); |
492 } | 490 } |
493 if (FLAG_trace_shutdown) { | 491 if (FLAG_trace_shutdown) { |
494 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Done\n", UptimeMillis()); | 492 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Done\n", UptimeMillis()); |
495 } | 493 } |
496 MallocHooks::TearDown(); | 494 |
497 return NULL; | 495 return NULL; |
498 } | 496 } |
499 | 497 |
500 | 498 |
501 Isolate* Dart::CreateIsolate(const char* name_prefix, | 499 Isolate* Dart::CreateIsolate(const char* name_prefix, |
502 const Dart_IsolateFlags& api_flags) { | 500 const Dart_IsolateFlags& api_flags) { |
503 // Create a new isolate. | 501 // Create a new isolate. |
504 Isolate* isolate = Isolate::Init(name_prefix, api_flags); | 502 Isolate* isolate = Isolate::Init(name_prefix, api_flags); |
505 return isolate; | 503 return isolate; |
506 } | 504 } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 return predefined_handles_->handles_.IsValidScopedHandle(address); | 749 return predefined_handles_->handles_.IsValidScopedHandle(address); |
752 } | 750 } |
753 | 751 |
754 | 752 |
755 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 753 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
756 ASSERT(predefined_handles_ != NULL); | 754 ASSERT(predefined_handles_ != NULL); |
757 return predefined_handles_->api_handles_.IsValidHandle(handle); | 755 return predefined_handles_->api_handles_.IsValidHandle(handle); |
758 } | 756 } |
759 | 757 |
760 } // namespace dart | 758 } // namespace dart |
OLD | NEW |