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 2344263002: Fix bad commit of stale patch set of original CL "Make NoReloadScope thread safe" (Closed)
Patch Set: Created 4 years, 3 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') | no next file » | 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 NoOOBMessageScope::~NoOOBMessageScope() { 141 NoOOBMessageScope::~NoOOBMessageScope() {
142 thread()->RestoreOOBMessageInterrupts(); 142 thread()->RestoreOOBMessageInterrupts();
143 } 143 }
144 144
145 145
146 NoReloadScope::NoReloadScope(Isolate* isolate, Thread* thread) 146 NoReloadScope::NoReloadScope(Isolate* isolate, Thread* thread)
147 : StackResource(thread), 147 : StackResource(thread),
148 isolate_(isolate) { 148 isolate_(isolate) {
149 ASSERT(isolate_ != NULL); 149 ASSERT(isolate_ != NULL);
150 AtomicOperations::FetchAndIncrement(&(isolate_->no_reload_scope_depth_)); 150 AtomicOperations::FetchAndIncrement(&(isolate_->no_reload_scope_depth_));
151 ASSERT(
152 AtomicOperations::LoadRelaxed(&(isolate_->no_reload_scope_depth_)) >= 0);
151 } 153 }
152 154
153 155
154 NoReloadScope::~NoReloadScope() { 156 NoReloadScope::~NoReloadScope() {
155 uintptr_t previous_value = 157 AtomicOperations::FetchAndDecrement(&(isolate_->no_reload_scope_depth_));
156 AtomicOperations::FetchAndDecrement(&(isolate_->no_reload_scope_depth_)); 158 ASSERT(
157 // If the previous value was 0 we have underflowed. 159 AtomicOperations::LoadRelaxed(&(isolate_->no_reload_scope_depth_)) >= 0);
158 ASSERT(previous_value != 0);
159 } 160 }
160 161
161 162
162 void Isolate::RegisterClass(const Class& cls) { 163 void Isolate::RegisterClass(const Class& cls) {
163 NOT_IN_PRODUCT( 164 NOT_IN_PRODUCT(
164 if (IsReloading()) { 165 if (IsReloading()) {
165 reload_context()->RegisterClass(cls); 166 reload_context()->RegisterClass(cls);
166 return; 167 return;
167 } 168 }
168 ) 169 )
(...skipping 2726 matching lines...) Expand 10 before | Expand all | Expand 10 after
2895 void IsolateSpawnState::DecrementSpawnCount() { 2896 void IsolateSpawnState::DecrementSpawnCount() {
2896 ASSERT(spawn_count_monitor_ != NULL); 2897 ASSERT(spawn_count_monitor_ != NULL);
2897 ASSERT(spawn_count_ != NULL); 2898 ASSERT(spawn_count_ != NULL);
2898 MonitorLocker ml(spawn_count_monitor_); 2899 MonitorLocker ml(spawn_count_monitor_);
2899 ASSERT(*spawn_count_ > 0); 2900 ASSERT(*spawn_count_ > 0);
2900 *spawn_count_ = *spawn_count_ - 1; 2901 *spawn_count_ = *spawn_count_ - 1;
2901 ml.Notify(); 2902 ml.Notify();
2902 } 2903 }
2903 2904
2904 } // namespace dart 2905 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698