| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 // The api local scope for this thread, this where all local handles | 294 // The api local scope for this thread, this where all local handles |
| 295 // are allocated. | 295 // are allocated. |
| 296 ApiLocalScope* api_top_scope() const { return api_top_scope_; } | 296 ApiLocalScope* api_top_scope() const { return api_top_scope_; } |
| 297 void set_api_top_scope(ApiLocalScope* value) { api_top_scope_ = value; } | 297 void set_api_top_scope(ApiLocalScope* value) { api_top_scope_ = value; } |
| 298 | 298 |
| 299 // The isolate that this thread is operating on, or NULL if none. | 299 // The isolate that this thread is operating on, or NULL if none. |
| 300 Isolate* isolate() const { return isolate_; } | 300 Isolate* isolate() const { return isolate_; } |
| 301 static intptr_t isolate_offset() { return OFFSET_OF(Thread, isolate_); } | 301 static intptr_t isolate_offset() { return OFFSET_OF(Thread, isolate_); } |
| 302 bool IsMutatorThread() const; | 302 bool IsMutatorThread() const; |
| 303 bool IsInsideParser() const { return inside_parser_; } |
| 303 bool CanCollectGarbage() const; | 304 bool CanCollectGarbage() const; |
| 304 | 305 |
| 305 // Offset of Dart TimelineStream object. | 306 // Offset of Dart TimelineStream object. |
| 306 static intptr_t dart_stream_offset() { | 307 static intptr_t dart_stream_offset() { |
| 307 return OFFSET_OF(Thread, dart_stream_); | 308 return OFFSET_OF(Thread, dart_stream_); |
| 308 } | 309 } |
| 309 | 310 |
| 310 // Is |this| executing Dart code? | 311 // Is |this| executing Dart code? |
| 311 bool IsExecutingDartCode() const; | 312 bool IsExecutingDartCode() const; |
| 312 | 313 |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 | 689 |
| 689 // Accessed from generated code. | 690 // Accessed from generated code. |
| 690 // ** This block of fields must come first! ** | 691 // ** This block of fields must come first! ** |
| 691 // For AOT cross-compilation, we rely on these members having the same offsets | 692 // 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. | 693 // 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 | 694 // We use only word-sized fields to avoid differences in struct packing on the |
| 694 // different architectures. See also CheckOffsets in dart.cc. | 695 // different architectures. See also CheckOffsets in dart.cc. |
| 695 uword stack_limit_; | 696 uword stack_limit_; |
| 696 uword stack_overflow_flags_; | 697 uword stack_overflow_flags_; |
| 697 Isolate* isolate_; | 698 Isolate* isolate_; |
| 699 bool inside_parser_; |
| 700 friend class EnterParserScope; |
| 701 friend class LeaveParserScope; |
| 698 Heap* heap_; | 702 Heap* heap_; |
| 699 uword top_exit_frame_info_; | 703 uword top_exit_frame_info_; |
| 700 StoreBufferBlock* store_buffer_block_; | 704 StoreBufferBlock* store_buffer_block_; |
| 701 uword vm_tag_; | 705 uword vm_tag_; |
| 702 TaskKind task_kind_; | 706 TaskKind task_kind_; |
| 703 RawStackTrace* async_stack_trace_; | 707 RawStackTrace* async_stack_trace_; |
| 704 // State that is cached in the TLS for fast access in generated code. | 708 // 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) \ | 709 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ |
| 706 type_name member_name; | 710 type_name member_name; |
| 707 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) | 711 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 // Disable thread interrupts. | 822 // Disable thread interrupts. |
| 819 class DisableThreadInterruptsScope : public StackResource { | 823 class DisableThreadInterruptsScope : public StackResource { |
| 820 public: | 824 public: |
| 821 explicit DisableThreadInterruptsScope(Thread* thread); | 825 explicit DisableThreadInterruptsScope(Thread* thread); |
| 822 ~DisableThreadInterruptsScope(); | 826 ~DisableThreadInterruptsScope(); |
| 823 }; | 827 }; |
| 824 | 828 |
| 825 } // namespace dart | 829 } // namespace dart |
| 826 | 830 |
| 827 #endif // RUNTIME_VM_THREAD_H_ | 831 #endif // RUNTIME_VM_THREAD_H_ |
| OLD | NEW |