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 22 matching lines...) Expand all Loading... |
33 class Instance; | 33 class Instance; |
34 class Isolate; | 34 class Isolate; |
35 class Library; | 35 class Library; |
36 class LongJumpScope; | 36 class LongJumpScope; |
37 class Object; | 37 class Object; |
38 class OSThread; | 38 class OSThread; |
39 class PcDescriptors; | 39 class PcDescriptors; |
40 class RawBool; | 40 class RawBool; |
41 class RawObject; | 41 class RawObject; |
42 class RawCode; | 42 class RawCode; |
| 43 class RawError; |
43 class RawGrowableObjectArray; | 44 class RawGrowableObjectArray; |
44 class RawString; | 45 class RawString; |
45 class RuntimeEntry; | 46 class RuntimeEntry; |
46 class StackResource; | 47 class StackResource; |
47 class String; | 48 class String; |
48 class TypeArguments; | 49 class TypeArguments; |
49 class TypeParameter; | 50 class TypeParameter; |
50 class Zone; | 51 class Zone; |
51 | 52 |
52 #define REUSABLE_HANDLE_LIST(V) \ | 53 #define REUSABLE_HANDLE_LIST(V) \ |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 return vm_tag_; | 359 return vm_tag_; |
359 } | 360 } |
360 void set_vm_tag(uword tag) { | 361 void set_vm_tag(uword tag) { |
361 vm_tag_ = tag; | 362 vm_tag_ = tag; |
362 } | 363 } |
363 static intptr_t vm_tag_offset() { | 364 static intptr_t vm_tag_offset() { |
364 return OFFSET_OF(Thread, vm_tag_); | 365 return OFFSET_OF(Thread, vm_tag_); |
365 } | 366 } |
366 | 367 |
367 RawGrowableObjectArray* pending_functions(); | 368 RawGrowableObjectArray* pending_functions(); |
| 369 void clear_pending_functions(); |
| 370 |
| 371 RawError* sticky_error() const; |
| 372 void set_sticky_error(const Error& value); |
| 373 void clear_sticky_error(); |
368 | 374 |
369 #if defined(DEBUG) | 375 #if defined(DEBUG) |
370 #define REUSABLE_HANDLE_SCOPE_ACCESSORS(object) \ | 376 #define REUSABLE_HANDLE_SCOPE_ACCESSORS(object) \ |
371 void set_reusable_##object##_handle_scope_active(bool value) { \ | 377 void set_reusable_##object##_handle_scope_active(bool value) { \ |
372 reusable_##object##_handle_scope_active_ = value; \ | 378 reusable_##object##_handle_scope_active_ = value; \ |
373 } \ | 379 } \ |
374 bool reusable_##object##_handle_scope_active() const { \ | 380 bool reusable_##object##_handle_scope_active() const { \ |
375 return reusable_##object##_handle_scope_active_; \ | 381 return reusable_##object##_handle_scope_active_; \ |
376 } | 382 } |
377 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_ACCESSORS) | 383 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_ACCESSORS) |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 int32_t no_safepoint_scope_depth_; | 547 int32_t no_safepoint_scope_depth_; |
542 #endif | 548 #endif |
543 VMHandles reusable_handles_; | 549 VMHandles reusable_handles_; |
544 | 550 |
545 // Compiler state: | 551 // Compiler state: |
546 CHA* cha_; | 552 CHA* cha_; |
547 intptr_t deopt_id_; // Compilation specific counter. | 553 intptr_t deopt_id_; // Compilation specific counter. |
548 uword vm_tag_; | 554 uword vm_tag_; |
549 RawGrowableObjectArray* pending_functions_; | 555 RawGrowableObjectArray* pending_functions_; |
550 | 556 |
| 557 RawError* sticky_error_; |
| 558 |
551 // State that is cached in the TLS for fast access in generated code. | 559 // State that is cached in the TLS for fast access in generated code. |
552 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ | 560 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ |
553 type_name member_name; | 561 type_name member_name; |
554 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) | 562 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) |
555 #undef DECLARE_MEMBERS | 563 #undef DECLARE_MEMBERS |
556 | 564 |
557 #define DECLARE_MEMBERS(name) \ | 565 #define DECLARE_MEMBERS(name) \ |
558 uword name##_entry_point_; | 566 uword name##_entry_point_; |
559 RUNTIME_ENTRY_LIST(DECLARE_MEMBERS) | 567 RUNTIME_ENTRY_LIST(DECLARE_MEMBERS) |
560 #undef DECLARE_MEMBERS | 568 #undef DECLARE_MEMBERS |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 // Disable thread interrupts. | 642 // Disable thread interrupts. |
635 class DisableThreadInterruptsScope : public StackResource { | 643 class DisableThreadInterruptsScope : public StackResource { |
636 public: | 644 public: |
637 explicit DisableThreadInterruptsScope(Thread* thread); | 645 explicit DisableThreadInterruptsScope(Thread* thread); |
638 ~DisableThreadInterruptsScope(); | 646 ~DisableThreadInterruptsScope(); |
639 }; | 647 }; |
640 | 648 |
641 } // namespace dart | 649 } // namespace dart |
642 | 650 |
643 #endif // VM_THREAD_H_ | 651 #endif // VM_THREAD_H_ |
OLD | NEW |