| 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 RUNTIME_VM_THREAD_H_ | 5 #ifndef RUNTIME_VM_THREAD_H_ |
| 6 #define RUNTIME_VM_THREAD_H_ | 6 #define RUNTIME_VM_THREAD_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 StackResource* top_resource() const { return top_resource_; } | 359 StackResource* top_resource() const { return top_resource_; } |
| 360 void set_top_resource(StackResource* value) { top_resource_ = value; } | 360 void set_top_resource(StackResource* value) { top_resource_ = value; } |
| 361 static intptr_t top_resource_offset() { | 361 static intptr_t top_resource_offset() { |
| 362 return OFFSET_OF(Thread, top_resource_); | 362 return OFFSET_OF(Thread, top_resource_); |
| 363 } | 363 } |
| 364 | 364 |
| 365 // Heap of the isolate that this thread is operating on. | 365 // Heap of the isolate that this thread is operating on. |
| 366 Heap* heap() const { return heap_; } | 366 Heap* heap() const { return heap_; } |
| 367 static intptr_t heap_offset() { return OFFSET_OF(Thread, heap_); } | 367 static intptr_t heap_offset() { return OFFSET_OF(Thread, heap_); } |
| 368 | 368 |
| 369 void set_top(uword value) { | |
| 370 ASSERT(heap_ != NULL); | |
| 371 top_ = value; | |
| 372 } | |
| 373 void set_end(uword value) { | |
| 374 ASSERT(heap_ != NULL); | |
| 375 end_ = value; | |
| 376 } | |
| 377 | |
| 378 uword top() { return top_; } | |
| 379 uword end() { return end_; } | |
| 380 | |
| 381 static intptr_t top_offset() { return OFFSET_OF(Thread, top_); } | |
| 382 static intptr_t end_offset() { return OFFSET_OF(Thread, end_); } | |
| 383 | |
| 384 int32_t no_handle_scope_depth() const { | 369 int32_t no_handle_scope_depth() const { |
| 385 #if defined(DEBUG) | 370 #if defined(DEBUG) |
| 386 return no_handle_scope_depth_; | 371 return no_handle_scope_depth_; |
| 387 #else | 372 #else |
| 388 return 0; | 373 return 0; |
| 389 #endif | 374 #endif |
| 390 } | 375 } |
| 391 | 376 |
| 392 void IncrementNoHandleScopeDepth() { | 377 void IncrementNoHandleScopeDepth() { |
| 393 #if defined(DEBUG) | 378 #if defined(DEBUG) |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 // Accessed from generated code. | 689 // Accessed from generated code. |
| 705 // ** This block of fields must come first! ** | 690 // ** This block of fields must come first! ** |
| 706 // For AOT cross-compilation, we rely on these members having the same offsets | 691 // For AOT cross-compilation, we rely on these members having the same offsets |
| 707 // in SIMARM(IA32) and ARM, and the same offsets in SIMARM64(X64) and ARM64. | 692 // in SIMARM(IA32) and ARM, and the same offsets in SIMARM64(X64) and ARM64. |
| 708 // We use only word-sized fields to avoid differences in struct packing on the | 693 // We use only word-sized fields to avoid differences in struct packing on the |
| 709 // different architectures. See also CheckOffsets in dart.cc. | 694 // different architectures. See also CheckOffsets in dart.cc. |
| 710 uword stack_limit_; | 695 uword stack_limit_; |
| 711 uword stack_overflow_flags_; | 696 uword stack_overflow_flags_; |
| 712 Isolate* isolate_; | 697 Isolate* isolate_; |
| 713 Heap* heap_; | 698 Heap* heap_; |
| 714 uword top_; | |
| 715 uword end_; | |
| 716 uword top_exit_frame_info_; | 699 uword top_exit_frame_info_; |
| 717 StoreBufferBlock* store_buffer_block_; | 700 StoreBufferBlock* store_buffer_block_; |
| 718 uword vm_tag_; | 701 uword vm_tag_; |
| 719 TaskKind task_kind_; | 702 TaskKind task_kind_; |
| 720 RawStackTrace* async_stack_trace_; | 703 RawStackTrace* async_stack_trace_; |
| 721 // State that is cached in the TLS for fast access in generated code. | 704 // State that is cached in the TLS for fast access in generated code. |
| 722 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ | 705 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ |
| 723 type_name member_name; | 706 type_name member_name; |
| 724 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) | 707 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) |
| 725 #undef DECLARE_MEMBERS | 708 #undef DECLARE_MEMBERS |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 // Disable thread interrupts. | 818 // Disable thread interrupts. |
| 836 class DisableThreadInterruptsScope : public StackResource { | 819 class DisableThreadInterruptsScope : public StackResource { |
| 837 public: | 820 public: |
| 838 explicit DisableThreadInterruptsScope(Thread* thread); | 821 explicit DisableThreadInterruptsScope(Thread* thread); |
| 839 ~DisableThreadInterruptsScope(); | 822 ~DisableThreadInterruptsScope(); |
| 840 }; | 823 }; |
| 841 | 824 |
| 842 } // namespace dart | 825 } // namespace dart |
| 843 | 826 |
| 844 #endif // RUNTIME_VM_THREAD_H_ | 827 #endif // RUNTIME_VM_THREAD_H_ |
| OLD | NEW |