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" | |
20 #include "vm/message_handler.h" | 19 #include "vm/message_handler.h" |
21 #include "vm/metrics.h" | 20 #include "vm/metrics.h" |
22 #include "vm/object.h" | 21 #include "vm/object.h" |
23 #include "vm/object_store.h" | 22 #include "vm/object_store.h" |
24 #include "vm/object_id_ring.h" | 23 #include "vm/object_id_ring.h" |
25 #include "vm/port.h" | 24 #include "vm/port.h" |
26 #include "vm/profiler.h" | 25 #include "vm/profiler.h" |
27 #include "vm/service_isolate.h" | 26 #include "vm/service_isolate.h" |
28 #include "vm/simulator.h" | 27 #include "vm/simulator.h" |
29 #include "vm/snapshot.h" | 28 #include "vm/snapshot.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 Thread::ExitIsolate(); // Unregister the VM isolate from this thread. | 305 Thread::ExitIsolate(); // Unregister the VM isolate from this thread. |
307 Isolate::SetCreateCallback(create); | 306 Isolate::SetCreateCallback(create); |
308 Isolate::SetShutdownCallback(shutdown); | 307 Isolate::SetShutdownCallback(shutdown); |
309 | 308 |
310 if (FLAG_support_service) { | 309 if (FLAG_support_service) { |
311 Service::SetGetServiceAssetsCallback(get_service_assets); | 310 Service::SetGetServiceAssetsCallback(get_service_assets); |
312 } | 311 } |
313 | 312 |
314 ServiceIsolate::Run(); | 313 ServiceIsolate::Run(); |
315 | 314 |
316 #ifndef DART_PRECOMPILED_RUNTIME | |
317 KernelIsolate::Run(); | |
318 #endif // DART_PRECOMPILED_RUNTIME | |
319 | |
320 return NULL; | 315 return NULL; |
321 } | 316 } |
322 | 317 |
323 | 318 |
324 // This waits until only the VM isolate and the service isolate remains in the | 319 // This waits until only the VM isolate and the service isolate remains in the |
325 // list, i.e. list length == 2. | 320 // list, i.e. list length == 2. |
326 void Dart::WaitForApplicationIsolateShutdown() { | 321 void Dart::WaitForApplicationIsolateShutdown() { |
327 ASSERT(!Isolate::creation_enabled_); | 322 ASSERT(!Isolate::creation_enabled_); |
328 MonitorLocker ml(Isolate::isolates_list_monitor_); | 323 MonitorLocker ml(Isolate::isolates_list_monitor_); |
329 while ((Isolate::isolates_list_head_ != NULL) && | 324 while ((Isolate::isolates_list_head_ != NULL) && |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 } | 592 } |
598 } | 593 } |
599 | 594 |
600 I->heap()->InitGrowthControl(); | 595 I->heap()->InitGrowthControl(); |
601 I->set_init_callback_data(data); | 596 I->set_init_callback_data(data); |
602 Api::SetupAcquiredError(I); | 597 Api::SetupAcquiredError(I); |
603 if (FLAG_print_class_table) { | 598 if (FLAG_print_class_table) { |
604 I->class_table()->Print(); | 599 I->class_table()->Print(); |
605 } | 600 } |
606 | 601 |
607 #ifndef DART_PRECOMPILED_RUNTIME | |
608 KernelIsolate::InitCallback(I); | |
609 #endif | |
610 ServiceIsolate::MaybeMakeServiceIsolate(I); | 602 ServiceIsolate::MaybeMakeServiceIsolate(I); |
611 if (!ServiceIsolate::IsServiceIsolate(I)) { | 603 if (!ServiceIsolate::IsServiceIsolate(I)) { |
612 I->message_handler()->set_should_pause_on_start( | 604 I->message_handler()->set_should_pause_on_start( |
613 FLAG_pause_isolates_on_start); | 605 FLAG_pause_isolates_on_start); |
614 I->message_handler()->set_should_pause_on_exit(FLAG_pause_isolates_on_exit); | 606 I->message_handler()->set_should_pause_on_exit(FLAG_pause_isolates_on_exit); |
615 } | 607 } |
616 ServiceIsolate::SendIsolateStartupMessage(); | 608 ServiceIsolate::SendIsolateStartupMessage(); |
617 if (FLAG_support_debugger) { | 609 if (FLAG_support_debugger) { |
618 I->debugger()->NotifyIsolateCreated(); | 610 I->debugger()->NotifyIsolateCreated(); |
619 } | 611 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 return predefined_handles_->handles_.IsValidScopedHandle(address); | 729 return predefined_handles_->handles_.IsValidScopedHandle(address); |
738 } | 730 } |
739 | 731 |
740 | 732 |
741 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 733 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
742 ASSERT(predefined_handles_ != NULL); | 734 ASSERT(predefined_handles_ != NULL); |
743 return predefined_handles_->api_handles_.IsValidHandle(handle); | 735 return predefined_handles_->api_handles_.IsValidHandle(handle); |
744 } | 736 } |
745 | 737 |
746 } // namespace dart | 738 } // namespace dart |
OLD | NEW |