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

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

Issue 2411453003: Fix --verify-on-transition for OSR and concurrent sweep. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | runtime/vm/native_arguments.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/lockers.h" 6 #include "vm/lockers.h"
7 #include "vm/safepoint.h" 7 #include "vm/safepoint.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 11 matching lines...) Expand all
22 SafepointHandler* handler = thread->isolate()->safepoint_handler(); 22 SafepointHandler* handler = thread->isolate()->safepoint_handler();
23 handler->ExitSafepointUsingLock(thread); 23 handler->ExitSafepointUsingLock(thread);
24 } 24 }
25 thread->set_execution_state(Thread::kThreadInVM); 25 thread->set_execution_state(Thread::kThreadInVM);
26 } 26 }
27 27
28 28
29 Monitor::WaitResult MonitorLocker::WaitWithSafepointCheck(Thread* thread, 29 Monitor::WaitResult MonitorLocker::WaitWithSafepointCheck(Thread* thread,
30 int64_t millis) { 30 int64_t millis) {
31 ASSERT(thread == Thread::Current()); 31 ASSERT(thread == Thread::Current());
32 ASSERT(thread->execution_state() == Thread::kThreadInVM);
32 thread->set_execution_state(Thread::kThreadInBlockedState); 33 thread->set_execution_state(Thread::kThreadInBlockedState);
33 thread->EnterSafepoint(); 34 thread->EnterSafepoint();
34 Monitor::WaitResult result = monitor_->Wait(millis); 35 Monitor::WaitResult result = monitor_->Wait(millis);
35 // First try a fast update of the thread state to indicate it is not at a 36 // First try a fast update of the thread state to indicate it is not at a
36 // safepoint anymore. 37 // safepoint anymore.
37 uint32_t old_state = Thread::SetAtSafepoint(true, 0); 38 uint32_t old_state = Thread::SetAtSafepoint(true, 0);
38 uword addr = 39 uword addr =
39 reinterpret_cast<uword>(thread) + Thread::safepoint_state_offset(); 40 reinterpret_cast<uword>(thread) + Thread::safepoint_state_offset();
40 if (AtomicOperations::CompareAndSwapUint32( 41 if (AtomicOperations::CompareAndSwapUint32(
41 reinterpret_cast<uint32_t*>(addr), old_state, 0) != old_state) { 42 reinterpret_cast<uint32_t*>(addr), old_state, 0) != old_state) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 monitor_->Enter(); 112 monitor_->Enter();
112 } 113 }
113 thread->set_execution_state(Thread::kThreadInVM); 114 thread->set_execution_state(Thread::kThreadInVM);
114 return result; 115 return result;
115 } else { 116 } else {
116 return monitor_->Wait(millis); 117 return monitor_->Wait(millis);
117 } 118 }
118 } 119 }
119 120
120 } // namespace dart 121 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/native_arguments.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698