| 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/object.h" | 10 #include "vm/object.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 if (current != NULL) { | 95 if (current != NULL) { |
| 96 delete current; | 96 delete current; |
| 97 } | 97 } |
| 98 SetCurrent(NULL); | 98 SetCurrent(NULL); |
| 99 } | 99 } |
| 100 #endif | 100 #endif |
| 101 | 101 |
| 102 | 102 |
| 103 Thread::Thread(bool init_vm_constants) | 103 Thread::Thread(bool init_vm_constants) |
| 104 : id_(OSThread::GetCurrentThreadId()), | 104 : id_(OSThread::GetCurrentThreadId()), |
| 105 thread_interrupt_callback_(NULL), |
| 106 thread_interrupt_data_(NULL), |
| 105 isolate_(NULL), | 107 isolate_(NULL), |
| 108 heap_(NULL), |
| 106 store_buffer_block_(NULL) { | 109 store_buffer_block_(NULL) { |
| 107 ClearState(); | 110 ClearState(); |
| 108 #define DEFAULT_INIT(type_name, member_name, init_expr, default_init_value) \ | 111 #define DEFAULT_INIT(type_name, member_name, init_expr, default_init_value) \ |
| 109 member_name = default_init_value; | 112 member_name = default_init_value; |
| 110 CACHED_CONSTANTS_LIST(DEFAULT_INIT) | 113 CACHED_CONSTANTS_LIST(DEFAULT_INIT) |
| 111 #undef DEFAULT_INIT | 114 #undef DEFAULT_INIT |
| 112 if (init_vm_constants) { | 115 if (init_vm_constants) { |
| 113 InitVMConstants(); | 116 InitVMConstants(); |
| 114 } | 117 } |
| 115 SetCurrent(this); | 118 SetCurrent(this); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 #define COMPUTE_OFFSET(type_name, member_name, expr, default_init_value) \ | 320 #define COMPUTE_OFFSET(type_name, member_name, expr, default_init_value) \ |
| 318 ASSERT((expr)->IsVMHeapObject()); \ | 321 ASSERT((expr)->IsVMHeapObject()); \ |
| 319 if (object.raw() == expr) return Thread::member_name##offset(); | 322 if (object.raw() == expr) return Thread::member_name##offset(); |
| 320 CACHED_VM_OBJECTS_LIST(COMPUTE_OFFSET) | 323 CACHED_VM_OBJECTS_LIST(COMPUTE_OFFSET) |
| 321 #undef COMPUTE_OFFSET | 324 #undef COMPUTE_OFFSET |
| 322 UNREACHABLE(); | 325 UNREACHABLE(); |
| 323 return -1; | 326 return -1; |
| 324 } | 327 } |
| 325 | 328 |
| 326 } // namespace dart | 329 } // namespace dart |
| OLD | NEW |