| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/thread.h" | 5 #include "vm/thread.h" |
| 6 | 6 |
| 7 #include "vm/dart_api_state.h" | 7 #include "vm/dart_api_state.h" |
| 8 #include "vm/growable_array.h" | 8 #include "vm/growable_array.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/lockers.h" | 10 #include "vm/lockers.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 } | 255 } |
| 256 return false; | 256 return false; |
| 257 } | 257 } |
| 258 | 258 |
| 259 | 259 |
| 260 void Thread::ExitIsolateAsHelper(bool bypass_safepoint) { | 260 void Thread::ExitIsolateAsHelper(bool bypass_safepoint) { |
| 261 Thread* thread = Thread::Current(); | 261 Thread* thread = Thread::Current(); |
| 262 ASSERT(thread != NULL); | 262 ASSERT(thread != NULL); |
| 263 ASSERT(!thread->IsMutatorThread()); | 263 ASSERT(!thread->IsMutatorThread()); |
| 264 ASSERT(thread->execution_state() == Thread::kThreadInVM); | 264 ASSERT(thread->execution_state() == Thread::kThreadInVM); |
| 265 // Clear since GC will not visit the thread once it is unscheduled. |
| 266 thread->ClearReusableHandles(); |
| 265 thread->StoreBufferRelease(); | 267 thread->StoreBufferRelease(); |
| 266 Isolate* isolate = thread->isolate(); | 268 Isolate* isolate = thread->isolate(); |
| 267 ASSERT(isolate != NULL); | 269 ASSERT(isolate != NULL); |
| 268 const bool kIsNotMutatorThread = false; | 270 const bool kIsNotMutatorThread = false; |
| 269 isolate->UnscheduleThread(thread, kIsNotMutatorThread, bypass_safepoint); | 271 isolate->UnscheduleThread(thread, kIsNotMutatorThread, bypass_safepoint); |
| 270 } | 272 } |
| 271 | 273 |
| 272 | 274 |
| 273 void Thread::PrepareForGC() { | 275 void Thread::PrepareForGC() { |
| 274 ASSERT(IsAtSafepoint()); | 276 ASSERT(IsAtSafepoint()); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 506 |
| 505 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { | 507 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { |
| 506 if (thread() != NULL) { | 508 if (thread() != NULL) { |
| 507 OSThread* os_thread = thread()->os_thread(); | 509 OSThread* os_thread = thread()->os_thread(); |
| 508 ASSERT(os_thread != NULL); | 510 ASSERT(os_thread != NULL); |
| 509 os_thread->EnableThreadInterrupts(); | 511 os_thread->EnableThreadInterrupts(); |
| 510 } | 512 } |
| 511 } | 513 } |
| 512 | 514 |
| 513 } // namespace dart | 515 } // namespace dart |
| OLD | NEW |