OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/isolate.h" | 5 #include "vm/isolate.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/text_buffer.h" | 10 #include "platform/text_buffer.h" |
(...skipping 2640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2651 // Now get a free Thread structure. | 2651 // Now get a free Thread structure. |
2652 thread = thread_registry()->GetFreeThreadLocked(this, is_mutator); | 2652 thread = thread_registry()->GetFreeThreadLocked(this, is_mutator); |
2653 ASSERT(thread != NULL); | 2653 ASSERT(thread != NULL); |
2654 | 2654 |
2655 thread->ResetHighWatermark(); | 2655 thread->ResetHighWatermark(); |
2656 | 2656 |
2657 // Set up other values and set the TLS value. | 2657 // Set up other values and set the TLS value. |
2658 thread->isolate_ = this; | 2658 thread->isolate_ = this; |
2659 ASSERT(heap() != NULL); | 2659 ASSERT(heap() != NULL); |
2660 thread->heap_ = heap(); | 2660 thread->heap_ = heap(); |
2661 thread->top_ = *(heap()->new_space()->TopAddress()); | |
rmacnak
2017/06/22 22:31:50
Since we don't yet have background new-space alloc
danunez
2017/06/30 20:35:57
Done.
| |
2662 thread->end_ = *(heap()->new_space()->EndAddress()); | |
2661 thread->set_os_thread(os_thread); | 2663 thread->set_os_thread(os_thread); |
2662 ASSERT(thread->execution_state() == Thread::kThreadInNative); | 2664 ASSERT(thread->execution_state() == Thread::kThreadInNative); |
2663 thread->set_execution_state(Thread::kThreadInVM); | 2665 thread->set_execution_state(Thread::kThreadInVM); |
2664 thread->set_safepoint_state(0); | 2666 thread->set_safepoint_state(0); |
2665 thread->set_vm_tag(VMTag::kVMTagId); | 2667 thread->set_vm_tag(VMTag::kVMTagId); |
2666 ASSERT(thread->no_safepoint_scope_depth() == 0); | 2668 ASSERT(thread->no_safepoint_scope_depth() == 0); |
2667 os_thread->set_thread(thread); | 2669 os_thread->set_thread(thread); |
2668 if (is_mutator) { | 2670 if (is_mutator) { |
2669 mutator_thread_ = thread; | 2671 mutator_thread_ = thread; |
2670 } | 2672 } |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2946 void IsolateSpawnState::DecrementSpawnCount() { | 2948 void IsolateSpawnState::DecrementSpawnCount() { |
2947 ASSERT(spawn_count_monitor_ != NULL); | 2949 ASSERT(spawn_count_monitor_ != NULL); |
2948 ASSERT(spawn_count_ != NULL); | 2950 ASSERT(spawn_count_ != NULL); |
2949 MonitorLocker ml(spawn_count_monitor_); | 2951 MonitorLocker ml(spawn_count_monitor_); |
2950 ASSERT(*spawn_count_ > 0); | 2952 ASSERT(*spawn_count_ > 0); |
2951 *spawn_count_ = *spawn_count_ - 1; | 2953 *spawn_count_ = *spawn_count_ - 1; |
2952 ml.Notify(); | 2954 ml.Notify(); |
2953 } | 2955 } |
2954 | 2956 |
2955 } // namespace dart | 2957 } // namespace dart |
OLD | NEW |