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