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

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

Issue 1754813004: Add thread safe constant canonicalization. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Move allocation 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
« 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/text_buffer.h" 10 #include "platform/text_buffer.h"
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 type_canonicalization_mutex_(new Mutex()),
794 constant_canonicalization_mutex_(new Mutex()),
794 saved_stack_limit_(0), 795 saved_stack_limit_(0),
795 deferred_interrupts_mask_(0), 796 deferred_interrupts_mask_(0),
796 deferred_interrupts_(0), 797 deferred_interrupts_(0),
797 stack_overflow_flags_(0), 798 stack_overflow_flags_(0),
798 stack_overflow_count_(0), 799 stack_overflow_count_(0),
799 message_handler_(NULL), 800 message_handler_(NULL),
800 spawn_state_(NULL), 801 spawn_state_(NULL),
801 is_runnable_(false), 802 is_runnable_(false),
802 gc_prologue_callback_(NULL), 803 gc_prologue_callback_(NULL),
803 gc_epilogue_callback_(NULL), 804 gc_epilogue_callback_(NULL),
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 } 850 }
850 #if defined(USING_SIMULATOR) 851 #if defined(USING_SIMULATOR)
851 delete simulator_; 852 delete simulator_;
852 #endif 853 #endif
853 delete mutex_; 854 delete mutex_;
854 mutex_ = NULL; // Fail fast if interrupts are scheduled on a dead isolate. 855 mutex_ = NULL; // Fail fast if interrupts are scheduled on a dead isolate.
855 delete symbols_mutex_; 856 delete symbols_mutex_;
856 symbols_mutex_ = NULL; 857 symbols_mutex_ = NULL;
857 delete type_canonicalization_mutex_; 858 delete type_canonicalization_mutex_;
858 type_canonicalization_mutex_ = NULL; 859 type_canonicalization_mutex_ = NULL;
860 delete constant_canonicalization_mutex_;
861 constant_canonicalization_mutex_ = NULL;
859 delete message_handler_; 862 delete message_handler_;
860 message_handler_ = NULL; // Fail fast if we send messages to a dead isolate. 863 message_handler_ = NULL; // Fail fast if we send messages to a dead isolate.
861 ASSERT(deopt_context_ == NULL); // No deopt in progress when isolate deleted. 864 ASSERT(deopt_context_ == NULL); // No deopt in progress when isolate deleted.
862 delete spawn_state_; 865 delete spawn_state_;
863 if (FLAG_support_service) { 866 if (FLAG_support_service) {
864 delete object_id_ring_; 867 delete object_id_ring_;
865 } 868 }
866 object_id_ring_ = NULL; 869 object_id_ring_ = NULL;
867 delete pause_loop_monitor_; 870 delete pause_loop_monitor_;
868 pause_loop_monitor_ = NULL; 871 pause_loop_monitor_ = NULL;
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after
2829 void IsolateSpawnState::DecrementSpawnCount() { 2832 void IsolateSpawnState::DecrementSpawnCount() {
2830 ASSERT(spawn_count_monitor_ != NULL); 2833 ASSERT(spawn_count_monitor_ != NULL);
2831 ASSERT(spawn_count_ != NULL); 2834 ASSERT(spawn_count_ != NULL);
2832 MonitorLocker ml(spawn_count_monitor_); 2835 MonitorLocker ml(spawn_count_monitor_);
2833 ASSERT(*spawn_count_ > 0); 2836 ASSERT(*spawn_count_ > 0);
2834 *spawn_count_ = *spawn_count_ - 1; 2837 *spawn_count_ = *spawn_count_ - 1;
2835 ml.Notify(); 2838 ml.Notify();
2836 } 2839 }
2837 2840
2838 } // namespace dart 2841 } // 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