Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: runtime/vm/isolate.cc

Issue 1410363005: Make ICData changes thread safe (first compute array, then set it). Install code in the main thread… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 stacktrace_(NULL), 781 stacktrace_(NULL),
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 background_compilation_queue_(GrowableObjectArray::null()), 791 compilation_function_queue_(GrowableObjectArray::null()),
792 compilation_code_queue_(GrowableObjectArray::null()),
792 pending_service_extension_calls_(GrowableObjectArray::null()), 793 pending_service_extension_calls_(GrowableObjectArray::null()),
793 registered_service_extension_handlers_(GrowableObjectArray::null()), 794 registered_service_extension_handlers_(GrowableObjectArray::null()),
794 metrics_list_head_(NULL), 795 metrics_list_head_(NULL),
795 compilation_allowed_(true), 796 compilation_allowed_(true),
796 all_classes_finalized_(false), 797 all_classes_finalized_(false),
797 next_(NULL), 798 next_(NULL),
798 pause_loop_monitor_(NULL) { 799 pause_loop_monitor_(NULL) {
799 flags_.CopyFrom(api_flags); 800 flags_.CopyFrom(api_flags);
800 Thread::Current()->set_vm_tag(VMTag::kEmbedderTagId); 801 Thread::Current()->set_vm_tag(VMTag::kEmbedderTagId);
801 set_user_tag(UserTags::kDefaultUserTag); 802 set_user_tag(UserTags::kDefaultUserTag);
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 // Visit the current tag which is stored in the isolate. 1763 // Visit the current tag which is stored in the isolate.
1763 visitor->VisitPointer(reinterpret_cast<RawObject**>(&current_tag_)); 1764 visitor->VisitPointer(reinterpret_cast<RawObject**>(&current_tag_));
1764 1765
1765 // Visit the default tag which is stored in the isolate. 1766 // Visit the default tag which is stored in the isolate.
1766 visitor->VisitPointer(reinterpret_cast<RawObject**>(&default_tag_)); 1767 visitor->VisitPointer(reinterpret_cast<RawObject**>(&default_tag_));
1767 1768
1768 // Visit the tag table which is stored in the isolate. 1769 // Visit the tag table which is stored in the isolate.
1769 visitor->VisitPointer(reinterpret_cast<RawObject**>(&tag_table_)); 1770 visitor->VisitPointer(reinterpret_cast<RawObject**>(&tag_table_));
1770 1771
1771 visitor->VisitPointer(reinterpret_cast<RawObject**>( 1772 visitor->VisitPointer(reinterpret_cast<RawObject**>(
1772 &background_compilation_queue_)); 1773 &compilation_function_queue_));
1774
1775 visitor->VisitPointer(reinterpret_cast<RawObject**>(
1776 &compilation_code_queue_));
1773 1777
1774 // Visit the deoptimized code array which is stored in the isolate. 1778 // Visit the deoptimized code array which is stored in the isolate.
1775 visitor->VisitPointer( 1779 visitor->VisitPointer(
1776 reinterpret_cast<RawObject**>(&deoptimized_code_array_)); 1780 reinterpret_cast<RawObject**>(&deoptimized_code_array_));
1777 1781
1778 // Visit the pending service extension calls. 1782 // Visit the pending service extension calls.
1779 visitor->VisitPointer( 1783 visitor->VisitPointer(
1780 reinterpret_cast<RawObject**>(&pending_service_extension_calls_)); 1784 reinterpret_cast<RawObject**>(&pending_service_extension_calls_));
1781 1785
1782 // Visit the registered service extension handlers. 1786 // Visit the registered service extension handlers.
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 void Isolate::set_default_tag(const UserTag& tag) { 1993 void Isolate::set_default_tag(const UserTag& tag) {
1990 default_tag_ = tag.raw(); 1994 default_tag_ = tag.raw();
1991 } 1995 }
1992 1996
1993 1997
1994 void Isolate::set_deoptimized_code_array(const GrowableObjectArray& value) { 1998 void Isolate::set_deoptimized_code_array(const GrowableObjectArray& value) {
1995 deoptimized_code_array_ = value.raw(); 1999 deoptimized_code_array_ = value.raw();
1996 } 2000 }
1997 2001
1998 2002
1999 void Isolate::set_background_compilation_queue( 2003 void Isolate::set_compilation_function_queue(
2000 const GrowableObjectArray& value) { 2004 const GrowableObjectArray& value) {
2001 background_compilation_queue_ = value.raw(); 2005 compilation_function_queue_ = value.raw();
2002 } 2006 }
2003 2007
2004 2008
2009 void Isolate::set_compilation_code_queue(
2010 const GrowableObjectArray& value) {
2011 compilation_code_queue_ = value.raw();
2012 }
2013
2014
2005 void Isolate::TrackDeoptimizedCode(const Code& code) { 2015 void Isolate::TrackDeoptimizedCode(const Code& code) {
2006 ASSERT(!code.IsNull()); 2016 ASSERT(!code.IsNull());
2007 const GrowableObjectArray& deoptimized_code = 2017 const GrowableObjectArray& deoptimized_code =
2008 GrowableObjectArray::Handle(deoptimized_code_array()); 2018 GrowableObjectArray::Handle(deoptimized_code_array());
2009 if (deoptimized_code.IsNull()) { 2019 if (deoptimized_code.IsNull()) {
2010 // Not tracking deoptimized code. 2020 // Not tracking deoptimized code.
2011 return; 2021 return;
2012 } 2022 }
2013 // TODO(johnmccutchan): Scan this array and the isolate's profile before 2023 // TODO(johnmccutchan): Scan this array and the isolate's profile before
2014 // old space GC and remove the keep_code flag. 2024 // old space GC and remove the keep_code flag.
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
2601 serialized_message_, serialized_message_len_); 2611 serialized_message_, serialized_message_len_);
2602 } 2612 }
2603 2613
2604 2614
2605 void IsolateSpawnState::Cleanup() { 2615 void IsolateSpawnState::Cleanup() {
2606 SwitchIsolateScope switch_scope(I); 2616 SwitchIsolateScope switch_scope(I);
2607 Dart::ShutdownIsolate(); 2617 Dart::ShutdownIsolate();
2608 } 2618 }
2609 2619
2610 } // namespace dart 2620 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698