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

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

Issue 1747073002: Make type canonicalization thread safe (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months 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
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/text_buffer.h" 10 #include "platform/text_buffer.h"
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 library_tag_handler_(NULL), 783 library_tag_handler_(NULL),
784 api_state_(NULL), 784 api_state_(NULL),
785 debugger_(NULL), 785 debugger_(NULL),
786 resume_request_(false), 786 resume_request_(false),
787 last_resume_timestamp_(OS::GetCurrentTimeMillis()), 787 last_resume_timestamp_(OS::GetCurrentTimeMillis()),
788 has_compiled_code_(false), 788 has_compiled_code_(false),
789 random_(), 789 random_(),
790 simulator_(NULL), 790 simulator_(NULL),
791 mutex_(new Mutex()), 791 mutex_(new Mutex()),
792 symbols_mutex_(new Mutex()), 792 symbols_mutex_(new Mutex()),
793 type_canonicalization_mutex_(new Mutex()),
793 saved_stack_limit_(0), 794 saved_stack_limit_(0),
794 deferred_interrupts_mask_(0), 795 deferred_interrupts_mask_(0),
795 deferred_interrupts_(0), 796 deferred_interrupts_(0),
796 stack_overflow_flags_(0), 797 stack_overflow_flags_(0),
797 stack_overflow_count_(0), 798 stack_overflow_count_(0),
798 message_handler_(NULL), 799 message_handler_(NULL),
799 spawn_state_(NULL), 800 spawn_state_(NULL),
800 is_runnable_(false), 801 is_runnable_(false),
801 gc_prologue_callback_(NULL), 802 gc_prologue_callback_(NULL),
802 gc_epilogue_callback_(NULL), 803 gc_epilogue_callback_(NULL),
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 if (FLAG_support_debugger) { 847 if (FLAG_support_debugger) {
847 delete debugger_; 848 delete debugger_;
848 } 849 }
849 #if defined(USING_SIMULATOR) 850 #if defined(USING_SIMULATOR)
850 delete simulator_; 851 delete simulator_;
851 #endif 852 #endif
852 delete mutex_; 853 delete mutex_;
853 mutex_ = NULL; // Fail fast if interrupts are scheduled on a dead isolate. 854 mutex_ = NULL; // Fail fast if interrupts are scheduled on a dead isolate.
854 delete symbols_mutex_; 855 delete symbols_mutex_;
855 symbols_mutex_ = NULL; 856 symbols_mutex_ = NULL;
857 delete type_canonicalization_mutex_;
858 type_canonicalization_mutex_ = NULL;
856 delete message_handler_; 859 delete message_handler_;
857 message_handler_ = NULL; // Fail fast if we send messages to a dead isolate. 860 message_handler_ = NULL; // Fail fast if we send messages to a dead isolate.
858 ASSERT(deopt_context_ == NULL); // No deopt in progress when isolate deleted. 861 ASSERT(deopt_context_ == NULL); // No deopt in progress when isolate deleted.
859 delete spawn_state_; 862 delete spawn_state_;
860 if (FLAG_support_service) { 863 if (FLAG_support_service) {
861 delete object_id_ring_; 864 delete object_id_ring_;
862 } 865 }
863 object_id_ring_ = NULL; 866 object_id_ring_ = NULL;
864 delete pause_loop_monitor_; 867 delete pause_loop_monitor_;
865 pause_loop_monitor_ = NULL; 868 pause_loop_monitor_ = NULL;
(...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after
2810 void IsolateSpawnState::DecrementSpawnCount() { 2813 void IsolateSpawnState::DecrementSpawnCount() {
2811 ASSERT(spawn_count_monitor_ != NULL); 2814 ASSERT(spawn_count_monitor_ != NULL);
2812 ASSERT(spawn_count_ != NULL); 2815 ASSERT(spawn_count_ != NULL);
2813 MonitorLocker ml(spawn_count_monitor_); 2816 MonitorLocker ml(spawn_count_monitor_);
2814 ASSERT(*spawn_count_ > 0); 2817 ASSERT(*spawn_count_ > 0);
2815 *spawn_count_ = *spawn_count_ - 1; 2818 *spawn_count_ = *spawn_count_ - 1;
2816 ml.Notify(); 2819 ml.Notify();
2817 } 2820 }
2818 2821
2819 } // namespace dart 2822 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698