| 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" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 static intptr_t name##_entry_point_offset() { \ | 254 static intptr_t name##_entry_point_offset() { \ |
| 255 return OFFSET_OF(Thread, name##_entry_point_); \ | 255 return OFFSET_OF(Thread, name##_entry_point_); \ |
| 256 } | 256 } |
| 257 LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD) | 257 LEAF_RUNTIME_ENTRY_LIST(DEFINE_OFFSET_METHOD) |
| 258 #undef DEFINE_OFFSET_METHOD | 258 #undef DEFINE_OFFSET_METHOD |
| 259 | 259 |
| 260 static bool CanLoadFromThread(const Object& object); | 260 static bool CanLoadFromThread(const Object& object); |
| 261 static intptr_t OffsetFromThread(const Object& object); | 261 static intptr_t OffsetFromThread(const Object& object); |
| 262 static intptr_t OffsetFromThread(const RuntimeEntry* runtime_entry); | 262 static intptr_t OffsetFromThread(const RuntimeEntry* runtime_entry); |
| 263 | 263 |
| 264 Mutex* timeline_block_lock() { |
| 265 return &timeline_block_lock_; |
| 266 } |
| 267 |
| 268 // Only safe to access when holding |timeline_block_lock_|. |
| 264 TimelineEventBlock* timeline_block() const { | 269 TimelineEventBlock* timeline_block() const { |
| 265 return state_.timeline_block; | 270 return state_.timeline_block; |
| 266 } | 271 } |
| 267 | 272 |
| 273 // Only safe to access when holding |timeline_block_lock_|. |
| 268 void set_timeline_block(TimelineEventBlock* block) { | 274 void set_timeline_block(TimelineEventBlock* block) { |
| 269 state_.timeline_block = block; | 275 state_.timeline_block = block; |
| 270 } | 276 } |
| 271 | 277 |
| 272 void CloseTimelineBlock(); | 278 void CloseTimelineBlock(); |
| 273 class Log* log() const; | 279 class Log* log() const; |
| 274 | 280 |
| 275 LongJumpScope* long_jump_base() const { return state_.long_jump_base; } | 281 LongJumpScope* long_jump_base() const { return state_.long_jump_base; } |
| 276 void set_long_jump_base(LongJumpScope* value) { | 282 void set_long_jump_base(LongJumpScope* value) { |
| 277 state_.long_jump_base = value; | 283 state_.long_jump_base = value; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 289 | 295 |
| 290 private: | 296 private: |
| 291 static ThreadLocalKey thread_key_; | 297 static ThreadLocalKey thread_key_; |
| 292 | 298 |
| 293 const ThreadId id_; | 299 const ThreadId id_; |
| 294 ThreadInterruptCallback thread_interrupt_callback_; | 300 ThreadInterruptCallback thread_interrupt_callback_; |
| 295 void* thread_interrupt_data_; | 301 void* thread_interrupt_data_; |
| 296 Isolate* isolate_; | 302 Isolate* isolate_; |
| 297 Heap* heap_; | 303 Heap* heap_; |
| 298 State state_; | 304 State state_; |
| 305 Mutex timeline_block_lock_; |
| 299 StoreBufferBlock* store_buffer_block_; | 306 StoreBufferBlock* store_buffer_block_; |
| 300 class Log* log_; | 307 class Log* log_; |
| 301 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ | 308 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ |
| 302 type_name member_name; | 309 type_name member_name; |
| 303 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) | 310 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) |
| 304 #undef DECLARE_MEMBERS | 311 #undef DECLARE_MEMBERS |
| 305 | 312 |
| 306 #define DECLARE_MEMBERS(name) \ | 313 #define DECLARE_MEMBERS(name) \ |
| 307 uword name##_entry_point_; | 314 uword name##_entry_point_; |
| 308 RUNTIME_ENTRY_LIST(DECLARE_MEMBERS) | 315 RUNTIME_ENTRY_LIST(DECLARE_MEMBERS) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 friend class ApiZone; | 348 friend class ApiZone; |
| 342 friend class Isolate; | 349 friend class Isolate; |
| 343 friend class StackZone; | 350 friend class StackZone; |
| 344 friend class ThreadRegistry; | 351 friend class ThreadRegistry; |
| 345 DISALLOW_COPY_AND_ASSIGN(Thread); | 352 DISALLOW_COPY_AND_ASSIGN(Thread); |
| 346 }; | 353 }; |
| 347 | 354 |
| 348 } // namespace dart | 355 } // namespace dart |
| 349 | 356 |
| 350 #endif // VM_THREAD_H_ | 357 #endif // VM_THREAD_H_ |
| OLD | NEW |