| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 thread->heap_ = NULL; | 166 thread->heap_ = NULL; |
| 167 } | 167 } |
| 168 | 168 |
| 169 | 169 |
| 170 void Thread::EnterIsolateAsHelper(Isolate* isolate) { | 170 void Thread::EnterIsolateAsHelper(Isolate* isolate) { |
| 171 Thread* thread = Thread::Current(); | 171 Thread* thread = Thread::Current(); |
| 172 ASSERT(thread != NULL); | 172 ASSERT(thread != NULL); |
| 173 ASSERT(thread->isolate() == NULL); | 173 ASSERT(thread->isolate() == NULL); |
| 174 thread->isolate_ = isolate; | 174 thread->isolate_ = isolate; |
| 175 ASSERT(thread->store_buffer_block_ == NULL); | 175 ASSERT(thread->store_buffer_block_ == NULL); |
| 176 thread->StoreBufferAcquire(); | 176 // TODO(koda): Use StoreBufferAcquire once we properly flush before Scavenge. |
| 177 thread->store_buffer_block_ = |
| 178 thread->isolate()->store_buffer()->PopEmptyBlock(); |
| 177 ASSERT(isolate->heap() != NULL); | 179 ASSERT(isolate->heap() != NULL); |
| 178 thread->heap_ = isolate->heap(); | 180 thread->heap_ = isolate->heap(); |
| 179 ASSERT(thread->thread_state() == NULL); | 181 ASSERT(thread->thread_state() == NULL); |
| 180 // Do not update isolate->mutator_thread, but perform sanity check: | 182 // Do not update isolate->mutator_thread, but perform sanity check: |
| 181 // this thread should not be both the main mutator and helper. | 183 // this thread should not be both the main mutator and helper. |
| 182 ASSERT(!isolate->MutatorThreadIsCurrentThread()); | 184 ASSERT(!isolate->MutatorThreadIsCurrentThread()); |
| 183 thread->Schedule(isolate); | 185 thread->Schedule(isolate); |
| 184 } | 186 } |
| 185 | 187 |
| 186 | 188 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 #define COMPUTE_OFFSET(type_name, member_name, expr, default_init_value) \ | 272 #define COMPUTE_OFFSET(type_name, member_name, expr, default_init_value) \ |
| 271 ASSERT((expr)->IsVMHeapObject()); \ | 273 ASSERT((expr)->IsVMHeapObject()); \ |
| 272 if (object.raw() == expr) return Thread::member_name##offset(); | 274 if (object.raw() == expr) return Thread::member_name##offset(); |
| 273 CACHED_VM_OBJECTS_LIST(COMPUTE_OFFSET) | 275 CACHED_VM_OBJECTS_LIST(COMPUTE_OFFSET) |
| 274 #undef COMPUTE_OFFSET | 276 #undef COMPUTE_OFFSET |
| 275 UNREACHABLE(); | 277 UNREACHABLE(); |
| 276 return -1; | 278 return -1; |
| 277 } | 279 } |
| 278 | 280 |
| 279 } // namespace dart | 281 } // namespace dart |
| OLD | NEW |