| 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 "vm/base_isolate.h" | 8 #include "vm/base_isolate.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/os_thread.h" | 10 #include "vm/os_thread.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 static void InitOnce(); | 39 static void InitOnce(); |
| 40 | 40 |
| 41 // The topmost zone used for allocation in this thread. | 41 // The topmost zone used for allocation in this thread. |
| 42 Zone* zone() { | 42 Zone* zone() { |
| 43 return reinterpret_cast<BaseIsolate*>(isolate())->current_zone(); | 43 return reinterpret_cast<BaseIsolate*>(isolate())->current_zone(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 // The isolate that this thread is operating on, or NULL if none. | 46 // The isolate that this thread is operating on, or NULL if none. |
| 47 Isolate* isolate() const { return isolate_; } | 47 Isolate* isolate() const { return isolate_; } |
| 48 | 48 |
| 49 // The (topmost) CHA for the compilation in this thread. | 49 // The (topmost) CHA for the compilation in the isolate of this thread. |
| 50 CHA* cha() const { return cha_; } | 50 // TODO(23153): Move this out of Isolate/Thread. |
| 51 void set_cha(CHA* value) { cha_ = value; } | 51 CHA* cha() const; |
| 52 void set_cha(CHA* value); |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 static ThreadLocalKey thread_key_; | 55 static ThreadLocalKey thread_key_; |
| 55 | 56 |
| 56 Isolate* isolate_; | 57 Isolate* isolate_; |
| 57 CHA* cha_; | |
| 58 | 58 |
| 59 Thread() | 59 Thread() |
| 60 : isolate_(NULL), | 60 : isolate_(NULL) {} |
| 61 cha_(NULL) {} | |
| 62 | 61 |
| 63 static void SetCurrent(Thread* current); | 62 static void SetCurrent(Thread* current); |
| 64 | 63 |
| 65 DISALLOW_COPY_AND_ASSIGN(Thread); | 64 DISALLOW_COPY_AND_ASSIGN(Thread); |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 } // namespace dart | 67 } // namespace dart |
| 69 | 68 |
| 70 #endif // VM_THREAD_H_ | 69 #endif // VM_THREAD_H_ |
| OLD | NEW |