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