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 "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 30 matching lines...) Expand all Loading... |
41 class RawBool; | 41 class RawBool; |
42 class RawObject; | 42 class RawObject; |
43 class RawCode; | 43 class RawCode; |
44 class RawError; | 44 class RawError; |
45 class RawGrowableObjectArray; | 45 class RawGrowableObjectArray; |
46 class RawString; | 46 class RawString; |
47 class RuntimeEntry; | 47 class RuntimeEntry; |
48 class Smi; | 48 class Smi; |
49 class StackResource; | 49 class StackResource; |
50 class String; | 50 class String; |
| 51 class TimelineStream; |
51 class TypeArguments; | 52 class TypeArguments; |
52 class TypeParameter; | 53 class TypeParameter; |
53 class Zone; | 54 class Zone; |
54 | 55 |
55 #define REUSABLE_HANDLE_LIST(V) \ | 56 #define REUSABLE_HANDLE_LIST(V) \ |
56 V(AbstractType) \ | 57 V(AbstractType) \ |
57 V(Array) \ | 58 V(Array) \ |
58 V(Class) \ | 59 V(Class) \ |
59 V(Code) \ | 60 V(Code) \ |
60 V(Error) \ | 61 V(Error) \ |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 void set_api_top_scope(ApiLocalScope* value) { api_top_scope_ = value; } | 264 void set_api_top_scope(ApiLocalScope* value) { api_top_scope_ = value; } |
264 | 265 |
265 // The isolate that this thread is operating on, or NULL if none. | 266 // The isolate that this thread is operating on, or NULL if none. |
266 Isolate* isolate() const { return isolate_; } | 267 Isolate* isolate() const { return isolate_; } |
267 static intptr_t isolate_offset() { | 268 static intptr_t isolate_offset() { |
268 return OFFSET_OF(Thread, isolate_); | 269 return OFFSET_OF(Thread, isolate_); |
269 } | 270 } |
270 bool IsMutatorThread() const; | 271 bool IsMutatorThread() const; |
271 bool CanCollectGarbage() const; | 272 bool CanCollectGarbage() const; |
272 | 273 |
| 274 // Offset of Dart TimelineStream object. |
| 275 static intptr_t dart_stream_offset() { |
| 276 return OFFSET_OF(Thread, dart_stream_); |
| 277 } |
| 278 |
273 // Is |this| executing Dart code? | 279 // Is |this| executing Dart code? |
274 bool IsExecutingDartCode() const; | 280 bool IsExecutingDartCode() const; |
275 | 281 |
276 // Has |this| exited Dart code? | 282 // Has |this| exited Dart code? |
277 bool HasExitedDartCode() const; | 283 bool HasExitedDartCode() const; |
278 | 284 |
279 // The (topmost) CHA for the compilation in this thread. | 285 // The (topmost) CHA for the compilation in this thread. |
280 CHA* cha() const { | 286 CHA* cha() const { |
281 ASSERT(isolate_ != NULL); | 287 ASSERT(isolate_ != NULL); |
282 return cha_; | 288 return cha_; |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 | 631 |
626 void InitVMConstants(); | 632 void InitVMConstants(); |
627 | 633 |
628 private: | 634 private: |
629 template<class T> T* AllocateReusableHandle(); | 635 template<class T> T* AllocateReusableHandle(); |
630 | 636 |
631 // Accessed from generated code: | 637 // Accessed from generated code: |
632 uword stack_limit_; | 638 uword stack_limit_; |
633 uword stack_overflow_flags_; | 639 uword stack_overflow_flags_; |
634 Isolate* isolate_; | 640 Isolate* isolate_; |
| 641 TimelineStream* dart_stream_; |
635 Heap* heap_; | 642 Heap* heap_; |
636 uword top_exit_frame_info_; | 643 uword top_exit_frame_info_; |
637 StoreBufferBlock* store_buffer_block_; | 644 StoreBufferBlock* store_buffer_block_; |
638 uword vm_tag_; | 645 uword vm_tag_; |
639 TaskKind task_kind_; | 646 TaskKind task_kind_; |
640 // State that is cached in the TLS for fast access in generated code. | 647 // State that is cached in the TLS for fast access in generated code. |
641 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ | 648 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ |
642 type_name member_name; | 649 type_name member_name; |
643 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) | 650 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) |
644 #undef DECLARE_MEMBERS | 651 #undef DECLARE_MEMBERS |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 // Disable thread interrupts. | 764 // Disable thread interrupts. |
758 class DisableThreadInterruptsScope : public StackResource { | 765 class DisableThreadInterruptsScope : public StackResource { |
759 public: | 766 public: |
760 explicit DisableThreadInterruptsScope(Thread* thread); | 767 explicit DisableThreadInterruptsScope(Thread* thread); |
761 ~DisableThreadInterruptsScope(); | 768 ~DisableThreadInterruptsScope(); |
762 }; | 769 }; |
763 | 770 |
764 } // namespace dart | 771 } // namespace dart |
765 | 772 |
766 #endif // VM_THREAD_H_ | 773 #endif // VM_THREAD_H_ |
OLD | NEW |