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 VM_ISOLATE_H_ | 5 #ifndef VM_ISOLATE_H_ |
6 #define VM_ISOLATE_H_ | 6 #define 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 void set_current_tag(const UserTag& tag); | 607 void set_current_tag(const UserTag& tag); |
608 | 608 |
609 RawUserTag* default_tag() const { return default_tag_; } | 609 RawUserTag* default_tag() const { return default_tag_; } |
610 void set_default_tag(const UserTag& tag); | 610 void set_default_tag(const UserTag& tag); |
611 | 611 |
612 RawGrowableObjectArray* compilation_function_queue() const { | 612 RawGrowableObjectArray* compilation_function_queue() const { |
613 return compilation_function_queue_; | 613 return compilation_function_queue_; |
614 } | 614 } |
615 void set_compilation_function_queue(const GrowableObjectArray& value); | 615 void set_compilation_function_queue(const GrowableObjectArray& value); |
616 | 616 |
617 RawGrowableObjectArray* compilation_code_queue() const { | 617 RawGrowableObjectArray* compilation_result_queue() const { |
618 return compilation_code_queue_; | 618 return compilation_result_queue_; |
619 } | 619 } |
620 void set_compilation_code_queue(const GrowableObjectArray& value); | 620 void set_compilation_result_queue(const GrowableObjectArray& value); |
621 | 621 |
622 Metric* metrics_list_head() { | 622 Metric* metrics_list_head() { |
623 return metrics_list_head_; | 623 return metrics_list_head_; |
624 } | 624 } |
625 | 625 |
626 void set_metrics_list_head(Metric* metric) { | 626 void set_metrics_list_head(Metric* metric) { |
627 metrics_list_head_ = metric; | 627 metrics_list_head_ = metric; |
628 } | 628 } |
629 | 629 |
630 RawGrowableObjectArray* deoptimized_code_array() const { | 630 RawGrowableObjectArray* deoptimized_code_array() const { |
631 return deoptimized_code_array_; | 631 return deoptimized_code_array_; |
632 } | 632 } |
633 void set_deoptimized_code_array(const GrowableObjectArray& value); | 633 void set_deoptimized_code_array(const GrowableObjectArray& value); |
634 void TrackDeoptimizedCode(const Code& code); | 634 void TrackDeoptimizedCode(const Code& code); |
635 | 635 |
636 bool compilation_allowed() const { return compilation_allowed_; } | 636 bool compilation_allowed() const { return compilation_allowed_; } |
637 void set_compilation_allowed(bool allowed) { | 637 void set_compilation_allowed(bool allowed) { |
638 compilation_allowed_ = allowed; | 638 compilation_allowed_ = allowed; |
639 } | 639 } |
640 | 640 |
641 // In precompilation we finalize all regular classes before compiling. | 641 // In precompilation we finalize all regular classes before compiling. |
642 bool all_classes_finalized() const { return all_classes_finalized_; } | 642 bool all_classes_finalized() const { return all_classes_finalized_; } |
643 void set_all_classes_finalized(bool value) { | 643 void set_all_classes_finalized(bool value) { |
644 all_classes_finalized_ = value; | 644 all_classes_finalized_ = value; |
645 } | 645 } |
646 | 646 |
| 647 void IncrCHAInvalidationGen() { cha_invalidation_gen_++; } |
| 648 void ResetCHAInvalidationGen() { cha_invalidation_gen_ = 0; } |
| 649 uint32_t cha_invalidation_gen() const { return cha_invalidation_gen_; } |
| 650 |
| 651 void IncrFieldInvalidationGen() { field_invalidation_gen_++; } |
| 652 void ResetFieldInvalidationGen() { field_invalidation_gen_ = 0; } |
| 653 uint32_t field_invalidation_gen() const { return field_invalidation_gen_; } |
| 654 |
| 655 void IncrPrefixInvalidationGen() { prefix_invalidation_gen_++; } |
| 656 void ResetPrefixInvalidationGen() { prefix_invalidation_gen_ = 0; } |
| 657 uint32_t prefix_invalidation_gen() const { return prefix_invalidation_gen_; } |
| 658 |
647 RawObject* InvokePendingServiceExtensionCalls(); | 659 RawObject* InvokePendingServiceExtensionCalls(); |
648 void AppendServiceExtensionCall(const Instance& closure, | 660 void AppendServiceExtensionCall(const Instance& closure, |
649 const String& method_name, | 661 const String& method_name, |
650 const Array& parameter_keys, | 662 const Array& parameter_keys, |
651 const Array& parameter_values, | 663 const Array& parameter_values, |
652 const Instance& reply_port, | 664 const Instance& reply_port, |
653 const Instance& id); | 665 const Instance& id); |
654 void RegisterServiceExtensionHandler(const String& name, | 666 void RegisterServiceExtensionHandler(const String& name, |
655 const Instance& closure); | 667 const Instance& closure); |
656 RawInstance* LookupServiceExtensionHandler(const String& name); | 668 RawInstance* LookupServiceExtensionHandler(const String& name); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 Mutex profiler_data_mutex_; | 810 Mutex profiler_data_mutex_; |
799 | 811 |
800 VMTagCounters vm_tag_counters_; | 812 VMTagCounters vm_tag_counters_; |
801 RawGrowableObjectArray* tag_table_; | 813 RawGrowableObjectArray* tag_table_; |
802 | 814 |
803 RawGrowableObjectArray* deoptimized_code_array_; | 815 RawGrowableObjectArray* deoptimized_code_array_; |
804 | 816 |
805 // Background compilation. | 817 // Background compilation. |
806 BackgroundCompiler* background_compiler_; | 818 BackgroundCompiler* background_compiler_; |
807 RawGrowableObjectArray* compilation_function_queue_; | 819 RawGrowableObjectArray* compilation_function_queue_; |
808 RawGrowableObjectArray* compilation_code_queue_; | 820 RawGrowableObjectArray* compilation_result_queue_; |
809 | 821 |
810 // We use 6 list entries for each pending service extension calls. | 822 // We use 6 list entries for each pending service extension calls. |
811 enum { | 823 enum { |
812 kPendingHandlerIndex = 0, | 824 kPendingHandlerIndex = 0, |
813 kPendingMethodNameIndex, | 825 kPendingMethodNameIndex, |
814 kPendingKeysIndex, | 826 kPendingKeysIndex, |
815 kPendingValuesIndex, | 827 kPendingValuesIndex, |
816 kPendingReplyPortIndex, | 828 kPendingReplyPortIndex, |
817 kPendingIdIndex, | 829 kPendingIdIndex, |
818 kPendingEntrySize | 830 kPendingEntrySize |
(...skipping 12 matching lines...) Expand all Loading... |
831 | 843 |
832 bool compilation_allowed_; | 844 bool compilation_allowed_; |
833 bool all_classes_finalized_; | 845 bool all_classes_finalized_; |
834 | 846 |
835 // Isolate list next pointer. | 847 // Isolate list next pointer. |
836 Isolate* next_; | 848 Isolate* next_; |
837 | 849 |
838 // Used to wake the isolate when it is in the pause event loop. | 850 // Used to wake the isolate when it is in the pause event loop. |
839 Monitor* pause_loop_monitor_; | 851 Monitor* pause_loop_monitor_; |
840 | 852 |
| 853 // Invalidation generations; used to track events occuring in parallel |
| 854 // to background compilation. The counters may overflow, which is OK |
| 855 // since we check for equality to detect if an event occured. |
| 856 uint32_t cha_invalidation_gen_; |
| 857 uint32_t field_invalidation_gen_; |
| 858 uint32_t prefix_invalidation_gen_; |
| 859 |
841 #define ISOLATE_METRIC_VARIABLE(type, variable, name, unit) \ | 860 #define ISOLATE_METRIC_VARIABLE(type, variable, name, unit) \ |
842 type metric_##variable##_; | 861 type metric_##variable##_; |
843 ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE); | 862 ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE); |
844 #undef ISOLATE_METRIC_VARIABLE | 863 #undef ISOLATE_METRIC_VARIABLE |
845 | 864 |
846 #define ISOLATE_TIMELINE_STREAM_VARIABLE(name, not_used) \ | 865 #define ISOLATE_TIMELINE_STREAM_VARIABLE(name, not_used) \ |
847 TimelineStream stream_##name##_; | 866 TimelineStream stream_##name##_; |
848 ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_VARIABLE) | 867 ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_VARIABLE) |
849 #undef ISOLATE_TIMELINE_STREAM_VARIABLE | 868 #undef ISOLATE_TIMELINE_STREAM_VARIABLE |
850 | 869 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 uint8_t* serialized_message_; | 1043 uint8_t* serialized_message_; |
1025 intptr_t serialized_message_len_; | 1044 intptr_t serialized_message_len_; |
1026 Isolate::Flags isolate_flags_; | 1045 Isolate::Flags isolate_flags_; |
1027 bool paused_; | 1046 bool paused_; |
1028 bool errors_are_fatal_; | 1047 bool errors_are_fatal_; |
1029 }; | 1048 }; |
1030 | 1049 |
1031 } // namespace dart | 1050 } // namespace dart |
1032 | 1051 |
1033 #endif // VM_ISOLATE_H_ | 1052 #endif // VM_ISOLATE_H_ |
OLD | NEW |