| 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/globals.h" | 8 #include "vm/globals.h" |
| 9 #include "vm/os_thread.h" | 9 #include "vm/os_thread.h" |
| 10 #include "vm/store_buffer.h" | 10 #include "vm/store_buffer.h" |
| 11 #include "vm/runtime_entry_list.h" | 11 #include "vm/runtime_entry_list.h" |
| 12 | 12 |
| 13 namespace dart { | 13 namespace dart { |
| 14 | 14 |
| 15 class CHA; | 15 class CHA; |
| 16 class HandleScope; | 16 class HandleScope; |
| 17 class Heap; | 17 class Heap; |
| 18 class Isolate; | 18 class Isolate; |
| 19 class Log; |
| 19 class LongJumpScope; | 20 class LongJumpScope; |
| 20 class Object; | 21 class Object; |
| 21 class RawBool; | 22 class RawBool; |
| 22 class RawObject; | 23 class RawObject; |
| 23 class RawString; | 24 class RawString; |
| 24 class RuntimeEntry; | 25 class RuntimeEntry; |
| 25 class StackResource; | 26 class StackResource; |
| 26 class TimelineEventBlock; | 27 class TimelineEventBlock; |
| 27 class Zone; | 28 class Zone; |
| 28 | 29 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 static intptr_t OffsetFromThread(const RuntimeEntry* runtime_entry); | 250 static intptr_t OffsetFromThread(const RuntimeEntry* runtime_entry); |
| 250 | 251 |
| 251 TimelineEventBlock* timeline_block() const { | 252 TimelineEventBlock* timeline_block() const { |
| 252 return state_.timeline_block; | 253 return state_.timeline_block; |
| 253 } | 254 } |
| 254 | 255 |
| 255 void set_timeline_block(TimelineEventBlock* block) { | 256 void set_timeline_block(TimelineEventBlock* block) { |
| 256 state_.timeline_block = block; | 257 state_.timeline_block = block; |
| 257 } | 258 } |
| 258 | 259 |
| 260 class Log* log() const; |
| 261 |
| 259 LongJumpScope* long_jump_base() const { return state_.long_jump_base; } | 262 LongJumpScope* long_jump_base() const { return state_.long_jump_base; } |
| 260 void set_long_jump_base(LongJumpScope* value) { | 263 void set_long_jump_base(LongJumpScope* value) { |
| 261 state_.long_jump_base = value; | 264 state_.long_jump_base = value; |
| 262 } | 265 } |
| 263 | 266 |
| 264 ThreadId id() const { | 267 ThreadId id() const { |
| 265 ASSERT(id_ != OSThread::kInvalidThreadId); | 268 ASSERT(id_ != OSThread::kInvalidThreadId); |
| 266 return id_; | 269 return id_; |
| 267 } | 270 } |
| 268 | 271 |
| 269 void SetThreadInterrupter(ThreadInterruptCallback callback, void* data); | 272 void SetThreadInterrupter(ThreadInterruptCallback callback, void* data); |
| 270 | 273 |
| 271 bool IsThreadInterrupterEnabled(ThreadInterruptCallback* callback, | 274 bool IsThreadInterrupterEnabled(ThreadInterruptCallback* callback, |
| 272 void** data) const; | 275 void** data) const; |
| 273 | 276 |
| 274 private: | 277 private: |
| 275 static ThreadLocalKey thread_key_; | 278 static ThreadLocalKey thread_key_; |
| 276 | 279 |
| 277 const ThreadId id_; | 280 const ThreadId id_; |
| 278 ThreadInterruptCallback thread_interrupt_callback_; | 281 ThreadInterruptCallback thread_interrupt_callback_; |
| 279 void* thread_interrupt_data_; | 282 void* thread_interrupt_data_; |
| 280 Isolate* isolate_; | 283 Isolate* isolate_; |
| 281 Heap* heap_; | 284 Heap* heap_; |
| 282 State state_; | 285 State state_; |
| 283 StoreBufferBlock* store_buffer_block_; | 286 StoreBufferBlock* store_buffer_block_; |
| 287 class Log* log_; |
| 284 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ | 288 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ |
| 285 type_name member_name; | 289 type_name member_name; |
| 286 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) | 290 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) |
| 287 #undef DECLARE_MEMBERS | 291 #undef DECLARE_MEMBERS |
| 288 | 292 |
| 289 #define DECLARE_MEMBERS(name) \ | 293 #define DECLARE_MEMBERS(name) \ |
| 290 uword name##_entry_point_; | 294 uword name##_entry_point_; |
| 291 RUNTIME_ENTRY_LIST(DECLARE_MEMBERS) | 295 RUNTIME_ENTRY_LIST(DECLARE_MEMBERS) |
| 292 #undef DECLARE_MEMBERS | 296 #undef DECLARE_MEMBERS |
| 293 | 297 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 323 friend class ApiZone; | 327 friend class ApiZone; |
| 324 friend class Isolate; | 328 friend class Isolate; |
| 325 friend class StackZone; | 329 friend class StackZone; |
| 326 friend class ThreadRegistry; | 330 friend class ThreadRegistry; |
| 327 DISALLOW_COPY_AND_ASSIGN(Thread); | 331 DISALLOW_COPY_AND_ASSIGN(Thread); |
| 328 }; | 332 }; |
| 329 | 333 |
| 330 } // namespace dart | 334 } // namespace dart |
| 331 | 335 |
| 332 #endif // VM_THREAD_H_ | 336 #endif // VM_THREAD_H_ |
| OLD | NEW |