| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(); |
| 314 | 315 |
| 316 #ifndef DART_PRECOMPILED_RUNTIME |
| 317 KernelIsolate::Run(); |
| 318 #endif // DART_PRECOMPILED_RUNTIME |
| 319 |
| 315 return NULL; | 320 return NULL; |
| 316 } | 321 } |
| 317 | 322 |
| 318 | 323 |
| 319 // This waits until only the VM isolate and the service isolate remains in the | 324 // This waits until only the VM isolate and the service isolate remains in the |
| 320 // list, i.e. list length == 2. | 325 // list, i.e. list length == 2. |
| 321 void Dart::WaitForApplicationIsolateShutdown() { | 326 void Dart::WaitForApplicationIsolateShutdown() { |
| 322 ASSERT(!Isolate::creation_enabled_); | 327 ASSERT(!Isolate::creation_enabled_); |
| 323 MonitorLocker ml(Isolate::isolates_list_monitor_); | 328 MonitorLocker ml(Isolate::isolates_list_monitor_); |
| 324 while ((Isolate::isolates_list_head_ != NULL) && | 329 while ((Isolate::isolates_list_head_ != NULL) && |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 } | 597 } |
| 593 } | 598 } |
| 594 | 599 |
| 595 I->heap()->InitGrowthControl(); | 600 I->heap()->InitGrowthControl(); |
| 596 I->set_init_callback_data(data); | 601 I->set_init_callback_data(data); |
| 597 Api::SetupAcquiredError(I); | 602 Api::SetupAcquiredError(I); |
| 598 if (FLAG_print_class_table) { | 603 if (FLAG_print_class_table) { |
| 599 I->class_table()->Print(); | 604 I->class_table()->Print(); |
| 600 } | 605 } |
| 601 | 606 |
| 607 #ifndef DART_PRECOMPILED_RUNTIME |
| 608 KernelIsolate::InitCallback(I); |
| 609 #endif |
| 602 ServiceIsolate::MaybeMakeServiceIsolate(I); | 610 ServiceIsolate::MaybeMakeServiceIsolate(I); |
| 603 if (!ServiceIsolate::IsServiceIsolate(I)) { | 611 if (!ServiceIsolate::IsServiceIsolate(I)) { |
| 604 I->message_handler()->set_should_pause_on_start( | 612 I->message_handler()->set_should_pause_on_start( |
| 605 FLAG_pause_isolates_on_start); | 613 FLAG_pause_isolates_on_start); |
| 606 I->message_handler()->set_should_pause_on_exit(FLAG_pause_isolates_on_exit); | 614 I->message_handler()->set_should_pause_on_exit(FLAG_pause_isolates_on_exit); |
| 607 } | 615 } |
| 608 ServiceIsolate::SendIsolateStartupMessage(); | 616 ServiceIsolate::SendIsolateStartupMessage(); |
| 609 if (FLAG_support_debugger) { | 617 if (FLAG_support_debugger) { |
| 610 I->debugger()->NotifyIsolateCreated(); | 618 I->debugger()->NotifyIsolateCreated(); |
| 611 } | 619 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 return predefined_handles_->handles_.IsValidScopedHandle(address); | 737 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 730 } | 738 } |
| 731 | 739 |
| 732 | 740 |
| 733 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 741 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 734 ASSERT(predefined_handles_ != NULL); | 742 ASSERT(predefined_handles_ != NULL); |
| 735 return predefined_handles_->api_handles_.IsValidHandle(handle); | 743 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 736 } | 744 } |
| 737 | 745 |
| 738 } // namespace dart | 746 } // namespace dart |
| OLD | NEW |