| 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 last_allocationprofile_accumulator_reset_timestamp_(0), | 674 last_allocationprofile_accumulator_reset_timestamp_(0), |
| 675 last_allocationprofile_gc_timestamp_(0), | 675 last_allocationprofile_gc_timestamp_(0), |
| 676 object_id_ring_(NULL), | 676 object_id_ring_(NULL), |
| 677 trace_buffer_(NULL), | 677 trace_buffer_(NULL), |
| 678 timeline_event_recorder_(NULL), | 678 timeline_event_recorder_(NULL), |
| 679 profiler_data_(NULL), | 679 profiler_data_(NULL), |
| 680 thread_state_(NULL), | 680 thread_state_(NULL), |
| 681 tag_table_(GrowableObjectArray::null()), | 681 tag_table_(GrowableObjectArray::null()), |
| 682 current_tag_(UserTag::null()), | 682 current_tag_(UserTag::null()), |
| 683 default_tag_(UserTag::null()), | 683 default_tag_(UserTag::null()), |
| 684 collected_closures_(GrowableObjectArray::null()), |
| 684 deoptimized_code_array_(GrowableObjectArray::null()), | 685 deoptimized_code_array_(GrowableObjectArray::null()), |
| 685 metrics_list_head_(NULL), | 686 metrics_list_head_(NULL), |
| 687 compilation_allowed_(true), |
| 686 cha_(NULL), | 688 cha_(NULL), |
| 687 next_(NULL), | 689 next_(NULL), |
| 688 pause_loop_monitor_(NULL), | 690 pause_loop_monitor_(NULL), |
| 689 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) | 691 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) |
| 690 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) | 692 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) |
| 691 reusable_handles_() { | 693 reusable_handles_() { |
| 692 flags_.CopyFrom(api_flags); | 694 flags_.CopyFrom(api_flags); |
| 693 set_vm_tag(VMTag::kEmbedderTagId); | 695 set_vm_tag(VMTag::kEmbedderTagId); |
| 694 set_user_tag(UserTags::kDefaultUserTag); | 696 set_user_tag(UserTags::kDefaultUserTag); |
| 695 } | 697 } |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1598 | 1600 |
| 1599 // Visit the current tag which is stored in the isolate. | 1601 // Visit the current tag which is stored in the isolate. |
| 1600 visitor->VisitPointer(reinterpret_cast<RawObject**>(¤t_tag_)); | 1602 visitor->VisitPointer(reinterpret_cast<RawObject**>(¤t_tag_)); |
| 1601 | 1603 |
| 1602 // Visit the default tag which is stored in the isolate. | 1604 // Visit the default tag which is stored in the isolate. |
| 1603 visitor->VisitPointer(reinterpret_cast<RawObject**>(&default_tag_)); | 1605 visitor->VisitPointer(reinterpret_cast<RawObject**>(&default_tag_)); |
| 1604 | 1606 |
| 1605 // Visit the tag table which is stored in the isolate. | 1607 // Visit the tag table which is stored in the isolate. |
| 1606 visitor->VisitPointer(reinterpret_cast<RawObject**>(&tag_table_)); | 1608 visitor->VisitPointer(reinterpret_cast<RawObject**>(&tag_table_)); |
| 1607 | 1609 |
| 1610 // Visit array of closures pending precompilation. |
| 1611 visitor->VisitPointer(reinterpret_cast<RawObject**>(&collected_closures_)); |
| 1612 |
| 1608 // Visit the deoptimized code array which is stored in the isolate. | 1613 // Visit the deoptimized code array which is stored in the isolate. |
| 1609 visitor->VisitPointer( | 1614 visitor->VisitPointer( |
| 1610 reinterpret_cast<RawObject**>(&deoptimized_code_array_)); | 1615 reinterpret_cast<RawObject**>(&deoptimized_code_array_)); |
| 1611 | 1616 |
| 1612 // Visit objects in the debugger. | 1617 // Visit objects in the debugger. |
| 1613 debugger()->VisitObjectPointers(visitor); | 1618 debugger()->VisitObjectPointers(visitor); |
| 1614 | 1619 |
| 1615 // Visit objects that are being used for deoptimization. | 1620 // Visit objects that are being used for deoptimization. |
| 1616 if (deopt_context() != NULL) { | 1621 if (deopt_context() != NULL) { |
| 1617 deopt_context()->VisitObjectPointers(visitor); | 1622 deopt_context()->VisitObjectPointers(visitor); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1798 set_user_tag(user_tag); | 1803 set_user_tag(user_tag); |
| 1799 current_tag_ = tag.raw(); | 1804 current_tag_ = tag.raw(); |
| 1800 } | 1805 } |
| 1801 | 1806 |
| 1802 | 1807 |
| 1803 void Isolate::set_default_tag(const UserTag& tag) { | 1808 void Isolate::set_default_tag(const UserTag& tag) { |
| 1804 default_tag_ = tag.raw(); | 1809 default_tag_ = tag.raw(); |
| 1805 } | 1810 } |
| 1806 | 1811 |
| 1807 | 1812 |
| 1813 void Isolate::set_collected_closures(const GrowableObjectArray& value) { |
| 1814 collected_closures_ = value.raw(); |
| 1815 } |
| 1816 |
| 1817 |
| 1808 void Isolate::set_deoptimized_code_array(const GrowableObjectArray& value) { | 1818 void Isolate::set_deoptimized_code_array(const GrowableObjectArray& value) { |
| 1809 deoptimized_code_array_ = value.raw(); | 1819 deoptimized_code_array_ = value.raw(); |
| 1810 } | 1820 } |
| 1811 | 1821 |
| 1812 | 1822 |
| 1813 void Isolate::TrackDeoptimizedCode(const Code& code) { | 1823 void Isolate::TrackDeoptimizedCode(const Code& code) { |
| 1814 ASSERT(!code.IsNull()); | 1824 ASSERT(!code.IsNull()); |
| 1815 const GrowableObjectArray& deoptimized_code = | 1825 const GrowableObjectArray& deoptimized_code = |
| 1816 GrowableObjectArray::Handle(deoptimized_code_array()); | 1826 GrowableObjectArray::Handle(deoptimized_code_array()); |
| 1817 if (deoptimized_code.IsNull()) { | 1827 if (deoptimized_code.IsNull()) { |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2145 serialized_message_, serialized_message_len_); | 2155 serialized_message_, serialized_message_len_); |
| 2146 } | 2156 } |
| 2147 | 2157 |
| 2148 | 2158 |
| 2149 void IsolateSpawnState::Cleanup() { | 2159 void IsolateSpawnState::Cleanup() { |
| 2150 SwitchIsolateScope switch_scope(I); | 2160 SwitchIsolateScope switch_scope(I); |
| 2151 Dart::ShutdownIsolate(); | 2161 Dart::ShutdownIsolate(); |
| 2152 } | 2162 } |
| 2153 | 2163 |
| 2154 } // namespace dart | 2164 } // namespace dart |
| OLD | NEW |