| 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/isolate.h" | 5 #include "vm/isolate.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/json.h" | 9 #include "platform/json.h" |
| 10 #include "vm/code_observers.h" | 10 #include "vm/code_observers.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "vm/os_thread.h" | 24 #include "vm/os_thread.h" |
| 25 #include "vm/parser.h" | 25 #include "vm/parser.h" |
| 26 #include "vm/port.h" | 26 #include "vm/port.h" |
| 27 #include "vm/profiler.h" | 27 #include "vm/profiler.h" |
| 28 #include "vm/reusable_handles.h" | 28 #include "vm/reusable_handles.h" |
| 29 #include "vm/service.h" | 29 #include "vm/service.h" |
| 30 #include "vm/service_event.h" | 30 #include "vm/service_event.h" |
| 31 #include "vm/service_isolate.h" | 31 #include "vm/service_isolate.h" |
| 32 #include "vm/simulator.h" | 32 #include "vm/simulator.h" |
| 33 #include "vm/stack_frame.h" | 33 #include "vm/stack_frame.h" |
| 34 #include "vm/store_buffer.h" |
| 34 #include "vm/stub_code.h" | 35 #include "vm/stub_code.h" |
| 35 #include "vm/symbols.h" | 36 #include "vm/symbols.h" |
| 36 #include "vm/tags.h" | 37 #include "vm/tags.h" |
| 37 #include "vm/thread_interrupter.h" | 38 #include "vm/thread_interrupter.h" |
| 38 #include "vm/timer.h" | 39 #include "vm/timer.h" |
| 39 #include "vm/visitor.h" | 40 #include "vm/visitor.h" |
| 40 | 41 |
| 41 | 42 |
| 42 namespace dart { | 43 namespace dart { |
| 43 | 44 |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 #else | 605 #else |
| 605 #define REUSABLE_HANDLE_SCOPE_INIT(object) | 606 #define REUSABLE_HANDLE_SCOPE_INIT(object) |
| 606 #endif // defined(DEBUG) | 607 #endif // defined(DEBUG) |
| 607 | 608 |
| 608 #define REUSABLE_HANDLE_INITIALIZERS(object) \ | 609 #define REUSABLE_HANDLE_INITIALIZERS(object) \ |
| 609 object##_handle_(NULL), | 610 object##_handle_(NULL), |
| 610 | 611 |
| 611 Isolate::Isolate(const Dart_IsolateFlags& api_flags) | 612 Isolate::Isolate(const Dart_IsolateFlags& api_flags) |
| 612 : mutator_thread_(NULL), | 613 : mutator_thread_(NULL), |
| 613 vm_tag_(0), | 614 vm_tag_(0), |
| 614 store_buffer_(), | 615 store_buffer_(new StoreBuffer()), |
| 615 message_notify_callback_(NULL), | 616 message_notify_callback_(NULL), |
| 616 name_(NULL), | 617 name_(NULL), |
| 617 debugger_name_(NULL), | 618 debugger_name_(NULL), |
| 618 start_time_(OS::GetCurrentTimeMicros()), | 619 start_time_(OS::GetCurrentTimeMicros()), |
| 619 main_port_(0), | 620 main_port_(0), |
| 620 origin_id_(0), | 621 origin_id_(0), |
| 621 pause_capability_(0), | 622 pause_capability_(0), |
| 622 terminate_capability_(0), | 623 terminate_capability_(0), |
| 623 errors_fatal_(true), | 624 errors_fatal_(true), |
| 624 heap_(NULL), | 625 heap_(NULL), |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 set_vm_tag(VMTag::kEmbedderTagId); | 680 set_vm_tag(VMTag::kEmbedderTagId); |
| 680 set_user_tag(UserTags::kDefaultUserTag); | 681 set_user_tag(UserTags::kDefaultUserTag); |
| 681 } | 682 } |
| 682 | 683 |
| 683 #undef REUSABLE_HANDLE_SCOPE_INIT | 684 #undef REUSABLE_HANDLE_SCOPE_INIT |
| 684 #undef REUSABLE_HANDLE_INITIALIZERS | 685 #undef REUSABLE_HANDLE_INITIALIZERS |
| 685 | 686 |
| 686 Isolate::~Isolate() { | 687 Isolate::~Isolate() { |
| 687 free(name_); | 688 free(name_); |
| 688 free(debugger_name_); | 689 free(debugger_name_); |
| 690 delete store_buffer_; |
| 689 delete heap_; | 691 delete heap_; |
| 690 delete object_store_; | 692 delete object_store_; |
| 691 delete api_state_; | 693 delete api_state_; |
| 692 delete stub_code_; | 694 delete stub_code_; |
| 693 delete debugger_; | 695 delete debugger_; |
| 694 #if defined(USING_SIMULATOR) | 696 #if defined(USING_SIMULATOR) |
| 695 delete simulator_; | 697 delete simulator_; |
| 696 #endif | 698 #endif |
| 697 delete mutex_; | 699 delete mutex_; |
| 698 mutex_ = NULL; // Fail fast if interrupts are scheduled on a dead isolate. | 700 mutex_ = NULL; // Fail fast if interrupts are scheduled on a dead isolate. |
| (...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2026 serialized_message_, serialized_message_len_); | 2028 serialized_message_, serialized_message_len_); |
| 2027 } | 2029 } |
| 2028 | 2030 |
| 2029 | 2031 |
| 2030 void IsolateSpawnState::Cleanup() { | 2032 void IsolateSpawnState::Cleanup() { |
| 2031 SwitchIsolateScope switch_scope(I); | 2033 SwitchIsolateScope switch_scope(I); |
| 2032 Dart::ShutdownIsolate(); | 2034 Dart::ShutdownIsolate(); |
| 2033 } | 2035 } |
| 2034 | 2036 |
| 2035 } // namespace dart | 2037 } // namespace dart |
| OLD | NEW |