| 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 #ifndef VM_THREAD_H_ | 5 #ifndef VM_THREAD_H_ |
| 6 #define VM_THREAD_H_ | 6 #define VM_THREAD_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/handles.h" | 10 #include "vm/handles.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 static void ExitIsolate(); | 127 static void ExitIsolate(); |
| 128 | 128 |
| 129 // A VM thread other than the main mutator thread can enter an isolate as a | 129 // A VM thread other than the main mutator thread can enter an isolate as a |
| 130 // "helper" to gain limited concurrent access to the isolate. One example is | 130 // "helper" to gain limited concurrent access to the isolate. One example is |
| 131 // SweeperTask (which uses the class table, which is copy-on-write). | 131 // SweeperTask (which uses the class table, which is copy-on-write). |
| 132 // TODO(koda): Properly synchronize heap access to expand allowed operations. | 132 // TODO(koda): Properly synchronize heap access to expand allowed operations. |
| 133 static void EnterIsolateAsHelper(Isolate* isolate, | 133 static void EnterIsolateAsHelper(Isolate* isolate, |
| 134 bool bypass_safepoint = false); | 134 bool bypass_safepoint = false); |
| 135 static void ExitIsolateAsHelper(bool bypass_safepoint = false); | 135 static void ExitIsolateAsHelper(bool bypass_safepoint = false); |
| 136 | 136 |
| 137 // Called when the current thread transitions from mutator to collector. | |
| 138 // Empties the store buffer block into the isolate. | 137 // Empties the store buffer block into the isolate. |
| 139 // TODO(koda): Always run GC in separate thread. | 138 void PrepareForGC(); |
| 140 static void PrepareForGC(); | |
| 141 | 139 |
| 142 // OSThread corresponding to this thread. | 140 // OSThread corresponding to this thread. |
| 143 OSThread* os_thread() const { return os_thread_; } | 141 OSThread* os_thread() const { return os_thread_; } |
| 144 void set_os_thread(OSThread* os_thread) { | 142 void set_os_thread(OSThread* os_thread) { |
| 145 os_thread_ = os_thread; | 143 os_thread_ = os_thread; |
| 146 } | 144 } |
| 147 | 145 |
| 148 // The topmost zone used for allocation in this thread. | 146 // The topmost zone used for allocation in this thread. |
| 149 Zone* zone() const { return zone_; } | 147 Zone* zone() const { return zone_; } |
| 150 | 148 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 // Disable thread interrupts. | 496 // Disable thread interrupts. |
| 499 class DisableThreadInterruptsScope : public StackResource { | 497 class DisableThreadInterruptsScope : public StackResource { |
| 500 public: | 498 public: |
| 501 explicit DisableThreadInterruptsScope(Thread* thread); | 499 explicit DisableThreadInterruptsScope(Thread* thread); |
| 502 ~DisableThreadInterruptsScope(); | 500 ~DisableThreadInterruptsScope(); |
| 503 }; | 501 }; |
| 504 | 502 |
| 505 } // namespace dart | 503 } // namespace dart |
| 506 | 504 |
| 507 #endif // VM_THREAD_H_ | 505 #endif // VM_THREAD_H_ |
| OLD | NEW |