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/base_isolate.h" | 10 #include "vm/base_isolate.h" |
11 #include "vm/class_table.h" | 11 #include "vm/class_table.h" |
12 #include "vm/counters.h" | 12 #include "vm/counters.h" |
13 #include "vm/handles.h" | 13 #include "vm/handles.h" |
14 #include "vm/megamorphic_cache_table.h" | 14 #include "vm/megamorphic_cache_table.h" |
15 #include "vm/metrics.h" | 15 #include "vm/metrics.h" |
16 #include "vm/random.h" | 16 #include "vm/random.h" |
17 #include "vm/store_buffer.h" | 17 #include "vm/store_buffer.h" |
18 #include "vm/tags.h" | 18 #include "vm/tags.h" |
19 #include "vm/thread.h" | 19 #include "vm/thread.h" |
20 #include "vm/os_thread.h" | 20 #include "vm/os_thread.h" |
| 21 #include "vm/timeline.h" |
| 22 #include "vm/timer.h" |
21 #include "vm/trace_buffer.h" | 23 #include "vm/trace_buffer.h" |
22 #include "vm/timer.h" | |
23 | 24 |
24 namespace dart { | 25 namespace dart { |
25 | 26 |
26 // Forward declarations. | 27 // Forward declarations. |
27 class AbstractType; | 28 class AbstractType; |
28 class ApiState; | 29 class ApiState; |
29 class Array; | 30 class Array; |
30 class Capability; | 31 class Capability; |
31 class CHA; | 32 class CHA; |
32 class Class; | 33 class Class; |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 return object_id_ring_; | 546 return object_id_ring_; |
546 } | 547 } |
547 | 548 |
548 void set_trace_buffer(TraceBuffer* buffer) { | 549 void set_trace_buffer(TraceBuffer* buffer) { |
549 trace_buffer_ = buffer; | 550 trace_buffer_ = buffer; |
550 } | 551 } |
551 TraceBuffer* trace_buffer() { | 552 TraceBuffer* trace_buffer() { |
552 return trace_buffer_; | 553 return trace_buffer_; |
553 } | 554 } |
554 | 555 |
| 556 void SetTimelineEventBuffer(TimelineEventBuffer* timeline_event_buffer); |
| 557 |
| 558 TimelineEventBuffer* timeline_event_buffer() const { |
| 559 return timeline_event_buffer_; |
| 560 } |
| 561 |
| 562 void RemoveTimelineEventBuffer(); |
| 563 |
555 DeoptContext* deopt_context() const { return deopt_context_; } | 564 DeoptContext* deopt_context() const { return deopt_context_; } |
556 void set_deopt_context(DeoptContext* value) { | 565 void set_deopt_context(DeoptContext* value) { |
557 ASSERT(value == NULL || deopt_context_ == NULL); | 566 ASSERT(value == NULL || deopt_context_ == NULL); |
558 deopt_context_ = value; | 567 deopt_context_ = value; |
559 } | 568 } |
560 | 569 |
561 int32_t edge_counter_increment_size() const { | 570 int32_t edge_counter_increment_size() const { |
562 return edge_counter_increment_size_; | 571 return edge_counter_increment_size_; |
563 } | 572 } |
564 void set_edge_counter_increment_size(int32_t size) { | 573 void set_edge_counter_increment_size(int32_t size) { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 } | 653 } |
645 static intptr_t default_tag_offset() { | 654 static intptr_t default_tag_offset() { |
646 return OFFSET_OF(Isolate, default_tag_); | 655 return OFFSET_OF(Isolate, default_tag_); |
647 } | 656 } |
648 | 657 |
649 #define ISOLATE_METRIC_ACCESSOR(type, variable, name, unit) \ | 658 #define ISOLATE_METRIC_ACCESSOR(type, variable, name, unit) \ |
650 type* Get##variable##Metric() { return &metric_##variable##_; } | 659 type* Get##variable##Metric() { return &metric_##variable##_; } |
651 ISOLATE_METRIC_LIST(ISOLATE_METRIC_ACCESSOR); | 660 ISOLATE_METRIC_LIST(ISOLATE_METRIC_ACCESSOR); |
652 #undef ISOLATE_METRIC_ACCESSOR | 661 #undef ISOLATE_METRIC_ACCESSOR |
653 | 662 |
| 663 #define ISOLATE_TIMELINE_STREAM_ACCESSOR(name, enabled_by_default) \ |
| 664 TimelineStream* Get##name##Stream() { return &stream_##name##_; } |
| 665 ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_ACCESSOR) |
| 666 #undef ISOLATE_TIMELINE_STREAM_ACCESSOR |
| 667 |
654 static intptr_t IsolateListLength(); | 668 static intptr_t IsolateListLength(); |
655 | 669 |
656 RawGrowableObjectArray* tag_table() const { return tag_table_; } | 670 RawGrowableObjectArray* tag_table() const { return tag_table_; } |
657 void set_tag_table(const GrowableObjectArray& value); | 671 void set_tag_table(const GrowableObjectArray& value); |
658 | 672 |
659 RawUserTag* current_tag() const { return current_tag_; } | 673 RawUserTag* current_tag() const { return current_tag_; } |
660 void set_current_tag(const UserTag& tag); | 674 void set_current_tag(const UserTag& tag); |
661 | 675 |
662 RawUserTag* default_tag() const { return default_tag_; } | 676 RawUserTag* default_tag() const { return default_tag_; } |
663 void set_default_tag(const UserTag& tag); | 677 void set_default_tag(const UserTag& tag); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 // Timestamps of last operation via service. | 794 // Timestamps of last operation via service. |
781 int64_t last_allocationprofile_accumulator_reset_timestamp_; | 795 int64_t last_allocationprofile_accumulator_reset_timestamp_; |
782 int64_t last_allocationprofile_gc_timestamp_; | 796 int64_t last_allocationprofile_gc_timestamp_; |
783 | 797 |
784 // Ring buffer of objects assigned an id. | 798 // Ring buffer of objects assigned an id. |
785 ObjectIdRing* object_id_ring_; | 799 ObjectIdRing* object_id_ring_; |
786 | 800 |
787 // Trace buffer support. | 801 // Trace buffer support. |
788 TraceBuffer* trace_buffer_; | 802 TraceBuffer* trace_buffer_; |
789 | 803 |
| 804 // TimelineEvent buffer. |
| 805 TimelineEventBuffer* timeline_event_buffer_; |
| 806 |
790 IsolateProfilerData* profiler_data_; | 807 IsolateProfilerData* profiler_data_; |
791 Mutex profiler_data_mutex_; | 808 Mutex profiler_data_mutex_; |
792 InterruptableThreadState* thread_state_; | 809 InterruptableThreadState* thread_state_; |
793 | 810 |
794 VMTagCounters vm_tag_counters_; | 811 VMTagCounters vm_tag_counters_; |
795 uword user_tag_; | 812 uword user_tag_; |
796 RawGrowableObjectArray* tag_table_; | 813 RawGrowableObjectArray* tag_table_; |
797 RawUserTag* current_tag_; | 814 RawUserTag* current_tag_; |
798 RawUserTag* default_tag_; | 815 RawUserTag* default_tag_; |
799 RawGrowableObjectArray* deoptimized_code_array_; | 816 RawGrowableObjectArray* deoptimized_code_array_; |
(...skipping 22 matching lines...) Expand all Loading... |
822 bool reusable_##object##_handle_scope_active_; | 839 bool reusable_##object##_handle_scope_active_; |
823 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_VARIABLE); | 840 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_VARIABLE); |
824 #undef REUSABLE_HANDLE_SCOPE_VARIABLE | 841 #undef REUSABLE_HANDLE_SCOPE_VARIABLE |
825 #endif // defined(DEBUG) | 842 #endif // defined(DEBUG) |
826 | 843 |
827 #define ISOLATE_METRIC_VARIABLE(type, variable, name, unit) \ | 844 #define ISOLATE_METRIC_VARIABLE(type, variable, name, unit) \ |
828 type metric_##variable##_; | 845 type metric_##variable##_; |
829 ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE); | 846 ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE); |
830 #undef ISOLATE_METRIC_VARIABLE | 847 #undef ISOLATE_METRIC_VARIABLE |
831 | 848 |
| 849 #define ISOLATE_TIMELINE_STREAM_VARIABLE(name, enabled_by_default) \ |
| 850 TimelineStream stream_##name##_; |
| 851 ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_VARIABLE) |
| 852 #undef ISOLATE_TIMELINE_STREAM_VARIABLE |
| 853 |
832 VMHandles reusable_handles_; | 854 VMHandles reusable_handles_; |
833 | 855 |
834 static Dart_IsolateCreateCallback create_callback_; | 856 static Dart_IsolateCreateCallback create_callback_; |
835 static Dart_IsolateInterruptCallback interrupt_callback_; | 857 static Dart_IsolateInterruptCallback interrupt_callback_; |
836 static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_; | 858 static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_; |
837 static Dart_IsolateShutdownCallback shutdown_callback_; | 859 static Dart_IsolateShutdownCallback shutdown_callback_; |
838 static Dart_FileOpenCallback file_open_callback_; | 860 static Dart_FileOpenCallback file_open_callback_; |
839 static Dart_FileReadCallback file_read_callback_; | 861 static Dart_FileReadCallback file_read_callback_; |
840 static Dart_FileWriteCallback file_write_callback_; | 862 static Dart_FileWriteCallback file_write_callback_; |
841 static Dart_FileCloseCallback file_close_callback_; | 863 static Dart_FileCloseCallback file_close_callback_; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 intptr_t serialized_args_len_; | 1013 intptr_t serialized_args_len_; |
992 uint8_t* serialized_message_; | 1014 uint8_t* serialized_message_; |
993 intptr_t serialized_message_len_; | 1015 intptr_t serialized_message_len_; |
994 Isolate::Flags isolate_flags_; | 1016 Isolate::Flags isolate_flags_; |
995 bool paused_; | 1017 bool paused_; |
996 }; | 1018 }; |
997 | 1019 |
998 } // namespace dart | 1020 } // namespace dart |
999 | 1021 |
1000 #endif // VM_ISOLATE_H_ | 1022 #endif // VM_ISOLATE_H_ |
OLD | NEW |