| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ISOLATE_H_ | 5 #ifndef RUNTIME_VM_ISOLATE_H_ |
| 6 #define RUNTIME_VM_ISOLATE_H_ | 6 #define RUNTIME_VM_ISOLATE_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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 private: | 123 private: |
| 124 Isolate* isolate_; | 124 Isolate* isolate_; |
| 125 DISALLOW_COPY_AND_ASSIGN(NoReloadScope); | 125 DISALLOW_COPY_AND_ASSIGN(NoReloadScope); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 | 128 |
| 129 // Fixed cache for exception handler lookup. | 129 // Fixed cache for exception handler lookup. |
| 130 typedef FixedCache<intptr_t, ExceptionHandlerInfo, 16> HandlerInfoCache; | 130 typedef FixedCache<intptr_t, ExceptionHandlerInfo, 16> HandlerInfoCache; |
| 131 | 131 |
| 132 // List of Isolate flags with corresponding members of Dart_IsolateFlags and |
| 133 // corresponding global command line flags. |
| 134 // |
| 135 // V(name, Dart_IsolateFlags-member-name, command-line-flag-name) |
| 136 // |
| 137 #define ISOLATE_FLAG_LIST(V) \ |
| 138 V(type_checks, enable_type_checks, FLAG_enable_type_checks) \ |
| 139 V(asserts, enable_asserts, FLAG_enable_asserts) \ |
| 140 V(error_on_bad_type, enable_error_on_bad_type, FLAG_error_on_bad_type) \ |
| 141 V(error_on_bad_override, enable_error_on_bad_override, \ |
| 142 FLAG_error_on_bad_override) \ |
| 143 V(use_field_guards, use_field_guards, FLAG_use_field_guards) \ |
| 144 V(use_osr, use_osr, FLAG_use_osr) |
| 132 | 145 |
| 133 class Isolate : public BaseIsolate { | 146 class Isolate : public BaseIsolate { |
| 134 public: | 147 public: |
| 135 // Keep both these enums in sync with isolate_patch.dart. | 148 // Keep both these enums in sync with isolate_patch.dart. |
| 136 // The different Isolate API message types. | 149 // The different Isolate API message types. |
| 137 enum LibMsgId { | 150 enum LibMsgId { |
| 138 kPauseMsg = 1, | 151 kPauseMsg = 1, |
| 139 kResumeMsg = 2, | 152 kResumeMsg = 2, |
| 140 kPingMsg = 3, | 153 kPingMsg = 3, |
| 141 kKillMsg = 4, | 154 kKillMsg = 4, |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 RawFunction* ClosureFunctionFromIndex(intptr_t idx) const; | 640 RawFunction* ClosureFunctionFromIndex(intptr_t idx) const; |
| 628 | 641 |
| 629 bool is_service_isolate() const { return is_service_isolate_; } | 642 bool is_service_isolate() const { return is_service_isolate_; } |
| 630 | 643 |
| 631 // Isolate-specific flag handling. | 644 // Isolate-specific flag handling. |
| 632 static void FlagsInitialize(Dart_IsolateFlags* api_flags); | 645 static void FlagsInitialize(Dart_IsolateFlags* api_flags); |
| 633 void FlagsCopyTo(Dart_IsolateFlags* api_flags) const; | 646 void FlagsCopyTo(Dart_IsolateFlags* api_flags) const; |
| 634 void FlagsCopyFrom(const Dart_IsolateFlags& api_flags); | 647 void FlagsCopyFrom(const Dart_IsolateFlags& api_flags); |
| 635 | 648 |
| 636 #if defined(PRODUCT) | 649 #if defined(PRODUCT) |
| 637 bool type_checks() const { return FLAG_enable_type_checks; } | 650 #define DECLARE_GETTER(name, isolate_flag_name, flag_name) \ |
| 638 bool asserts() const { return FLAG_enable_asserts; } | 651 bool name() const { return flag_name; } |
| 639 bool error_on_bad_type() const { return FLAG_error_on_bad_type; } | 652 ISOLATE_FLAG_LIST(DECLARE_GETTER) |
| 640 bool error_on_bad_override() const { return FLAG_error_on_bad_override; } | 653 #undef DECLARE_GETTER |
| 641 bool use_field_guards() const { return FLAG_use_field_guards; } | 654 void set_use_osr(bool use_osr) { ASSERT(!use_osr); } |
| 642 #else // defined(PRODUCT) | 655 #else // defined(PRODUCT) |
| 643 bool type_checks() const { return type_checks_; } | 656 #define DECLARE_GETTER(name, isolate_flag_name, flag_name) \ |
| 644 bool asserts() const { return asserts_; } | 657 bool name() const { return name##_; } |
| 645 bool error_on_bad_type() const { return error_on_bad_type_; } | 658 ISOLATE_FLAG_LIST(DECLARE_GETTER) |
| 646 bool error_on_bad_override() const { return error_on_bad_override_; } | 659 #undef DECLARE_GETTER |
| 647 bool use_field_guards() const { return use_field_guards_; } | 660 void set_use_osr(bool use_osr) { use_osr_ = use_osr; } |
| 648 #endif // defined(PRODUCT) | 661 #endif // defined(PRODUCT) |
| 649 | 662 |
| 650 static void KillAllIsolates(LibMsgId msg_id); | 663 static void KillAllIsolates(LibMsgId msg_id); |
| 651 static void KillIfExists(Isolate* isolate, LibMsgId msg_id); | 664 static void KillIfExists(Isolate* isolate, LibMsgId msg_id); |
| 652 | 665 |
| 653 static void DisableIsolateCreation(); | 666 static void DisableIsolateCreation(); |
| 654 static void EnableIsolateCreation(); | 667 static void EnableIsolateCreation(); |
| 655 static bool IsolateCreationEnabled(); | 668 static bool IsolateCreationEnabled(); |
| 656 | 669 |
| 657 void StopBackgroundCompiler(); | 670 void StopBackgroundCompiler(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 Dart_GcPrologueCallback gc_prologue_callback_; | 776 Dart_GcPrologueCallback gc_prologue_callback_; |
| 764 Dart_GcEpilogueCallback gc_epilogue_callback_; | 777 Dart_GcEpilogueCallback gc_epilogue_callback_; |
| 765 intptr_t defer_finalization_count_; | 778 intptr_t defer_finalization_count_; |
| 766 MallocGrowableArray<PendingLazyDeopt>* pending_deopts_; | 779 MallocGrowableArray<PendingLazyDeopt>* pending_deopts_; |
| 767 DeoptContext* deopt_context_; | 780 DeoptContext* deopt_context_; |
| 768 | 781 |
| 769 bool is_service_isolate_; | 782 bool is_service_isolate_; |
| 770 | 783 |
| 771 // Isolate-specific flags. | 784 // Isolate-specific flags. |
| 772 #if !defined(PRODUCT) | 785 #if !defined(PRODUCT) |
| 773 bool type_checks_; | 786 #define DECLARE_FIELD(name, isolate_flag_name, flag_name) bool name##_; |
| 774 bool asserts_; | 787 ISOLATE_FLAG_LIST(DECLARE_FIELD) |
| 775 bool error_on_bad_type_; | 788 #undef DECLARE_FIELD |
| 776 bool error_on_bad_override_; | |
| 777 bool use_field_guards_; | |
| 778 #endif // !defined(PRODUCT) | 789 #endif // !defined(PRODUCT) |
| 779 | 790 |
| 780 // Timestamps of last operation via service. | 791 // Timestamps of last operation via service. |
| 781 int64_t last_allocationprofile_accumulator_reset_timestamp_; | 792 int64_t last_allocationprofile_accumulator_reset_timestamp_; |
| 782 int64_t last_allocationprofile_gc_timestamp_; | 793 int64_t last_allocationprofile_gc_timestamp_; |
| 783 | 794 |
| 784 // Ring buffer of objects assigned an id. | 795 // Ring buffer of objects assigned an id. |
| 785 ObjectIdRing* object_id_ring_; | 796 ObjectIdRing* object_id_ring_; |
| 786 | 797 |
| 787 VMTagCounters vm_tag_counters_; | 798 VMTagCounters vm_tag_counters_; |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 intptr_t* spawn_count_; | 1028 intptr_t* spawn_count_; |
| 1018 | 1029 |
| 1019 Dart_IsolateFlags isolate_flags_; | 1030 Dart_IsolateFlags isolate_flags_; |
| 1020 bool paused_; | 1031 bool paused_; |
| 1021 bool errors_are_fatal_; | 1032 bool errors_are_fatal_; |
| 1022 }; | 1033 }; |
| 1023 | 1034 |
| 1024 } // namespace dart | 1035 } // namespace dart |
| 1025 | 1036 |
| 1026 #endif // RUNTIME_VM_ISOLATE_H_ | 1037 #endif // RUNTIME_VM_ISOLATE_H_ |
| OLD | NEW |