| 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/growable_array.h" | 7 #include "vm/growable_array.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/lockers.h" | 9 #include "vm/lockers.h" |
| 10 #include "vm/log.h" | 10 #include "vm/log.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 thread_interrupt_data_(NULL), | 188 thread_interrupt_data_(NULL), |
| 189 isolate_(NULL), | 189 isolate_(NULL), |
| 190 heap_(NULL), | 190 heap_(NULL), |
| 191 store_buffer_block_(NULL), | 191 store_buffer_block_(NULL), |
| 192 log_(new class Log()), | 192 log_(new class Log()), |
| 193 deopt_id_(0), | 193 deopt_id_(0), |
| 194 vm_tag_(0), | 194 vm_tag_(0), |
| 195 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) | 195 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) |
| 196 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) | 196 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) |
| 197 reusable_handles_(), | 197 reusable_handles_(), |
| 198 cha_(NULL), |
| 199 no_callback_scope_depth_(0), |
| 198 thread_list_next_(NULL) { | 200 thread_list_next_(NULL) { |
| 199 ClearState(); | 201 ClearState(); |
| 200 | 202 |
| 201 #define DEFAULT_INIT(type_name, member_name, init_expr, default_init_value) \ | 203 #define DEFAULT_INIT(type_name, member_name, init_expr, default_init_value) \ |
| 202 member_name = default_init_value; | 204 member_name = default_init_value; |
| 203 CACHED_CONSTANTS_LIST(DEFAULT_INIT) | 205 CACHED_CONSTANTS_LIST(DEFAULT_INIT) |
| 204 #undef DEFAULT_INIT | 206 #undef DEFAULT_INIT |
| 205 | 207 |
| 206 #define DEFAULT_INIT(name) \ | 208 #define DEFAULT_INIT(name) \ |
| 207 name##_entry_point_ = 0; | 209 name##_entry_point_ = 0; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 } | 391 } |
| 390 | 392 |
| 391 | 393 |
| 392 void Thread::StoreBufferAcquire() { | 394 void Thread::StoreBufferAcquire() { |
| 393 store_buffer_block_ = isolate()->store_buffer()->PopNonFullBlock(); | 395 store_buffer_block_ = isolate()->store_buffer()->PopNonFullBlock(); |
| 394 } | 396 } |
| 395 | 397 |
| 396 | 398 |
| 397 CHA* Thread::cha() const { | 399 CHA* Thread::cha() const { |
| 398 ASSERT(isolate_ != NULL); | 400 ASSERT(isolate_ != NULL); |
| 399 return isolate_->cha_; | 401 return cha_; |
| 400 } | 402 } |
| 401 | 403 |
| 402 | 404 |
| 403 void Thread::set_cha(CHA* value) { | 405 void Thread::set_cha(CHA* value) { |
| 404 ASSERT(isolate_ != NULL); | 406 ASSERT(isolate_ != NULL); |
| 405 isolate_->cha_ = value; | 407 cha_ = value; |
| 406 } | 408 } |
| 407 | 409 |
| 408 | 410 |
| 409 Log* Thread::log() const { | 411 Log* Thread::log() const { |
| 410 return log_; | 412 return log_; |
| 411 } | 413 } |
| 412 | 414 |
| 413 | 415 |
| 414 template<class C> | 416 template<class C> |
| 415 C* Thread::AllocateReusableHandle() { | 417 C* Thread::AllocateReusableHandle() { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 Thread* ThreadIterator::Next() { | 528 Thread* ThreadIterator::Next() { |
| 527 ASSERT(Thread::thread_list_lock_ != NULL); | 529 ASSERT(Thread::thread_list_lock_ != NULL); |
| 528 ASSERT(Thread::thread_list_lock_->IsOwnedByCurrentThread()); | 530 ASSERT(Thread::thread_list_lock_->IsOwnedByCurrentThread()); |
| 529 Thread* current = next_; | 531 Thread* current = next_; |
| 530 next_ = next_->thread_list_next_; | 532 next_ = next_->thread_list_next_; |
| 531 return current; | 533 return current; |
| 532 } | 534 } |
| 533 | 535 |
| 534 | 536 |
| 535 } // namespace dart | 537 } // namespace dart |
| OLD | NEW |