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 "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/json.h" | 10 #include "platform/json.h" |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 stack_frame_index_(-1), | 782 stack_frame_index_(-1), |
783 last_allocationprofile_accumulator_reset_timestamp_(0), | 783 last_allocationprofile_accumulator_reset_timestamp_(0), |
784 last_allocationprofile_gc_timestamp_(0), | 784 last_allocationprofile_gc_timestamp_(0), |
785 object_id_ring_(NULL), | 785 object_id_ring_(NULL), |
786 trace_buffer_(NULL), | 786 trace_buffer_(NULL), |
787 profiler_data_(NULL), | 787 profiler_data_(NULL), |
788 tag_table_(GrowableObjectArray::null()), | 788 tag_table_(GrowableObjectArray::null()), |
789 deoptimized_code_array_(GrowableObjectArray::null()), | 789 deoptimized_code_array_(GrowableObjectArray::null()), |
790 background_compiler_(NULL), | 790 background_compiler_(NULL), |
791 compilation_function_queue_(GrowableObjectArray::null()), | 791 compilation_function_queue_(GrowableObjectArray::null()), |
792 compilation_code_queue_(GrowableObjectArray::null()), | 792 compilation_result_queue_(GrowableObjectArray::null()), |
793 pending_service_extension_calls_(GrowableObjectArray::null()), | 793 pending_service_extension_calls_(GrowableObjectArray::null()), |
794 registered_service_extension_handlers_(GrowableObjectArray::null()), | 794 registered_service_extension_handlers_(GrowableObjectArray::null()), |
795 metrics_list_head_(NULL), | 795 metrics_list_head_(NULL), |
796 compilation_allowed_(true), | 796 compilation_allowed_(true), |
797 all_classes_finalized_(false), | 797 all_classes_finalized_(false), |
798 next_(NULL), | 798 next_(NULL), |
799 pause_loop_monitor_(NULL) { | 799 pause_loop_monitor_(NULL), |
| 800 cha_invalidation_gen_(0), |
| 801 field_invalidation_gen_(0), |
| 802 prefix_invalidation_gen_(0) { |
800 flags_.CopyFrom(api_flags); | 803 flags_.CopyFrom(api_flags); |
801 Thread::Current()->set_vm_tag(VMTag::kEmbedderTagId); | 804 Thread::Current()->set_vm_tag(VMTag::kEmbedderTagId); |
802 set_user_tag(UserTags::kDefaultUserTag); | 805 set_user_tag(UserTags::kDefaultUserTag); |
803 } | 806 } |
804 | 807 |
805 #undef REUSABLE_HANDLE_SCOPE_INIT | 808 #undef REUSABLE_HANDLE_SCOPE_INIT |
806 #undef REUSABLE_HANDLE_INITIALIZERS | 809 #undef REUSABLE_HANDLE_INITIALIZERS |
807 | 810 |
808 Isolate::~Isolate() { | 811 Isolate::~Isolate() { |
809 free(name_); | 812 free(name_); |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 // Visit the default tag which is stored in the isolate. | 1770 // Visit the default tag which is stored in the isolate. |
1768 visitor->VisitPointer(reinterpret_cast<RawObject**>(&default_tag_)); | 1771 visitor->VisitPointer(reinterpret_cast<RawObject**>(&default_tag_)); |
1769 | 1772 |
1770 // Visit the tag table which is stored in the isolate. | 1773 // Visit the tag table which is stored in the isolate. |
1771 visitor->VisitPointer(reinterpret_cast<RawObject**>(&tag_table_)); | 1774 visitor->VisitPointer(reinterpret_cast<RawObject**>(&tag_table_)); |
1772 | 1775 |
1773 visitor->VisitPointer(reinterpret_cast<RawObject**>( | 1776 visitor->VisitPointer(reinterpret_cast<RawObject**>( |
1774 &compilation_function_queue_)); | 1777 &compilation_function_queue_)); |
1775 | 1778 |
1776 visitor->VisitPointer(reinterpret_cast<RawObject**>( | 1779 visitor->VisitPointer(reinterpret_cast<RawObject**>( |
1777 &compilation_code_queue_)); | 1780 &compilation_result_queue_)); |
1778 | 1781 |
1779 // Visit the deoptimized code array which is stored in the isolate. | 1782 // Visit the deoptimized code array which is stored in the isolate. |
1780 visitor->VisitPointer( | 1783 visitor->VisitPointer( |
1781 reinterpret_cast<RawObject**>(&deoptimized_code_array_)); | 1784 reinterpret_cast<RawObject**>(&deoptimized_code_array_)); |
1782 | 1785 |
1783 // Visit the pending service extension calls. | 1786 // Visit the pending service extension calls. |
1784 visitor->VisitPointer( | 1787 visitor->VisitPointer( |
1785 reinterpret_cast<RawObject**>(&pending_service_extension_calls_)); | 1788 reinterpret_cast<RawObject**>(&pending_service_extension_calls_)); |
1786 | 1789 |
1787 // Visit the registered service extension handlers. | 1790 // Visit the registered service extension handlers. |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2000 deoptimized_code_array_ = value.raw(); | 2003 deoptimized_code_array_ = value.raw(); |
2001 } | 2004 } |
2002 | 2005 |
2003 | 2006 |
2004 void Isolate::set_compilation_function_queue( | 2007 void Isolate::set_compilation_function_queue( |
2005 const GrowableObjectArray& value) { | 2008 const GrowableObjectArray& value) { |
2006 compilation_function_queue_ = value.raw(); | 2009 compilation_function_queue_ = value.raw(); |
2007 } | 2010 } |
2008 | 2011 |
2009 | 2012 |
2010 void Isolate::set_compilation_code_queue( | 2013 void Isolate::set_compilation_result_queue( |
2011 const GrowableObjectArray& value) { | 2014 const GrowableObjectArray& value) { |
2012 compilation_code_queue_ = value.raw(); | 2015 compilation_result_queue_ = value.raw(); |
2013 } | 2016 } |
2014 | 2017 |
2015 | 2018 |
2016 void Isolate::TrackDeoptimizedCode(const Code& code) { | 2019 void Isolate::TrackDeoptimizedCode(const Code& code) { |
2017 ASSERT(!code.IsNull()); | 2020 ASSERT(!code.IsNull()); |
2018 const GrowableObjectArray& deoptimized_code = | 2021 const GrowableObjectArray& deoptimized_code = |
2019 GrowableObjectArray::Handle(deoptimized_code_array()); | 2022 GrowableObjectArray::Handle(deoptimized_code_array()); |
2020 if (deoptimized_code.IsNull()) { | 2023 if (deoptimized_code.IsNull()) { |
2021 // Not tracking deoptimized code. | 2024 // Not tracking deoptimized code. |
2022 return; | 2025 return; |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2612 serialized_message_, serialized_message_len_); | 2615 serialized_message_, serialized_message_len_); |
2613 } | 2616 } |
2614 | 2617 |
2615 | 2618 |
2616 void IsolateSpawnState::Cleanup() { | 2619 void IsolateSpawnState::Cleanup() { |
2617 SwitchIsolateScope switch_scope(I); | 2620 SwitchIsolateScope switch_scope(I); |
2618 Dart::ShutdownIsolate(); | 2621 Dart::ShutdownIsolate(); |
2619 } | 2622 } |
2620 | 2623 |
2621 } // namespace dart | 2624 } // namespace dart |
OLD | NEW |