Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Side by Side Diff: runtime/vm/isolate.h

Issue 1170503004: Initial Timeline Events (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 return object_id_ring_; 549 return object_id_ring_;
549 } 550 }
550 551
551 void set_trace_buffer(TraceBuffer* buffer) { 552 void set_trace_buffer(TraceBuffer* buffer) {
552 trace_buffer_ = buffer; 553 trace_buffer_ = buffer;
553 } 554 }
554 TraceBuffer* trace_buffer() { 555 TraceBuffer* trace_buffer() {
555 return trace_buffer_; 556 return trace_buffer_;
556 } 557 }
557 558
559 void SetTimelineEventBuffer(TimelineEventBuffer* timeline_event_buffer);
560
561 TimelineEventBuffer* timeline_event_buffer() const {
562 return timeline_event_buffer_;
563 }
564
565 void RemoveTimelineEventBuffer();
566
558 DeoptContext* deopt_context() const { return deopt_context_; } 567 DeoptContext* deopt_context() const { return deopt_context_; }
559 void set_deopt_context(DeoptContext* value) { 568 void set_deopt_context(DeoptContext* value) {
560 ASSERT(value == NULL || deopt_context_ == NULL); 569 ASSERT(value == NULL || deopt_context_ == NULL);
561 deopt_context_ = value; 570 deopt_context_ = value;
562 } 571 }
563 572
564 int32_t edge_counter_increment_size() const { 573 int32_t edge_counter_increment_size() const {
565 return edge_counter_increment_size_; 574 return edge_counter_increment_size_;
566 } 575 }
567 void set_edge_counter_increment_size(int32_t size) { 576 void set_edge_counter_increment_size(int32_t size) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 } 656 }
648 static intptr_t default_tag_offset() { 657 static intptr_t default_tag_offset() {
649 return OFFSET_OF(Isolate, default_tag_); 658 return OFFSET_OF(Isolate, default_tag_);
650 } 659 }
651 660
652 #define ISOLATE_METRIC_ACCESSOR(type, variable, name, unit) \ 661 #define ISOLATE_METRIC_ACCESSOR(type, variable, name, unit) \
653 type* Get##variable##Metric() { return &metric_##variable##_; } 662 type* Get##variable##Metric() { return &metric_##variable##_; }
654 ISOLATE_METRIC_LIST(ISOLATE_METRIC_ACCESSOR); 663 ISOLATE_METRIC_LIST(ISOLATE_METRIC_ACCESSOR);
655 #undef ISOLATE_METRIC_ACCESSOR 664 #undef ISOLATE_METRIC_ACCESSOR
656 665
666 #define ISOLATE_TIMELINE_STREAM_ACCESSOR(name, enabled_by_default) \
667 TimelineStream* Get##name##Stream() { return &stream_##name##_; }
668 ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_ACCESSOR)
669 #undef ISOLATE_TIMELINE_STREAM_ACCESSOR
670
657 static intptr_t IsolateListLength(); 671 static intptr_t IsolateListLength();
658 672
659 RawGrowableObjectArray* tag_table() const { return tag_table_; } 673 RawGrowableObjectArray* tag_table() const { return tag_table_; }
660 void set_tag_table(const GrowableObjectArray& value); 674 void set_tag_table(const GrowableObjectArray& value);
661 675
662 RawUserTag* current_tag() const { return current_tag_; } 676 RawUserTag* current_tag() const { return current_tag_; }
663 void set_current_tag(const UserTag& tag); 677 void set_current_tag(const UserTag& tag);
664 678
665 RawUserTag* default_tag() const { return default_tag_; } 679 RawUserTag* default_tag() const { return default_tag_; }
666 void set_default_tag(const UserTag& tag); 680 void set_default_tag(const UserTag& tag);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 // Timestamps of last operation via service. 797 // Timestamps of last operation via service.
784 int64_t last_allocationprofile_accumulator_reset_timestamp_; 798 int64_t last_allocationprofile_accumulator_reset_timestamp_;
785 int64_t last_allocationprofile_gc_timestamp_; 799 int64_t last_allocationprofile_gc_timestamp_;
786 800
787 // Ring buffer of objects assigned an id. 801 // Ring buffer of objects assigned an id.
788 ObjectIdRing* object_id_ring_; 802 ObjectIdRing* object_id_ring_;
789 803
790 // Trace buffer support. 804 // Trace buffer support.
791 TraceBuffer* trace_buffer_; 805 TraceBuffer* trace_buffer_;
792 806
807 // TimelineEvent buffer.
808 TimelineEventBuffer* timeline_event_buffer_;
809
793 IsolateProfilerData* profiler_data_; 810 IsolateProfilerData* profiler_data_;
794 Mutex profiler_data_mutex_; 811 Mutex profiler_data_mutex_;
795 InterruptableThreadState* thread_state_; 812 InterruptableThreadState* thread_state_;
796 813
797 VMTagCounters vm_tag_counters_; 814 VMTagCounters vm_tag_counters_;
798 uword user_tag_; 815 uword user_tag_;
799 RawGrowableObjectArray* tag_table_; 816 RawGrowableObjectArray* tag_table_;
800 RawUserTag* current_tag_; 817 RawUserTag* current_tag_;
801 RawUserTag* default_tag_; 818 RawUserTag* default_tag_;
802 RawGrowableObjectArray* deoptimized_code_array_; 819 RawGrowableObjectArray* deoptimized_code_array_;
(...skipping 22 matching lines...) Expand all
825 bool reusable_##object##_handle_scope_active_; 842 bool reusable_##object##_handle_scope_active_;
826 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_VARIABLE); 843 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_VARIABLE);
827 #undef REUSABLE_HANDLE_SCOPE_VARIABLE 844 #undef REUSABLE_HANDLE_SCOPE_VARIABLE
828 #endif // defined(DEBUG) 845 #endif // defined(DEBUG)
829 846
830 #define ISOLATE_METRIC_VARIABLE(type, variable, name, unit) \ 847 #define ISOLATE_METRIC_VARIABLE(type, variable, name, unit) \
831 type metric_##variable##_; 848 type metric_##variable##_;
832 ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE); 849 ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE);
833 #undef ISOLATE_METRIC_VARIABLE 850 #undef ISOLATE_METRIC_VARIABLE
834 851
852 #define ISOLATE_TIMELINE_STREAM_VARIABLE(name, enabled_by_default) \
853 TimelineStream stream_##name##_;
854 ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_VARIABLE)
855 #undef ISOLATE_TIMELINE_STREAM_VARIABLE
856
835 VMHandles reusable_handles_; 857 VMHandles reusable_handles_;
836 858
837 static Dart_IsolateCreateCallback create_callback_; 859 static Dart_IsolateCreateCallback create_callback_;
838 static Dart_IsolateInterruptCallback interrupt_callback_; 860 static Dart_IsolateInterruptCallback interrupt_callback_;
839 static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_; 861 static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_;
840 static Dart_IsolateShutdownCallback shutdown_callback_; 862 static Dart_IsolateShutdownCallback shutdown_callback_;
841 static Dart_FileOpenCallback file_open_callback_; 863 static Dart_FileOpenCallback file_open_callback_;
842 static Dart_FileReadCallback file_read_callback_; 864 static Dart_FileReadCallback file_read_callback_;
843 static Dart_FileWriteCallback file_write_callback_; 865 static Dart_FileWriteCallback file_write_callback_;
844 static Dart_FileCloseCallback file_close_callback_; 866 static Dart_FileCloseCallback file_close_callback_;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 intptr_t serialized_args_len_; 1016 intptr_t serialized_args_len_;
995 uint8_t* serialized_message_; 1017 uint8_t* serialized_message_;
996 intptr_t serialized_message_len_; 1018 intptr_t serialized_message_len_;
997 Isolate::Flags isolate_flags_; 1019 Isolate::Flags isolate_flags_;
998 bool paused_; 1020 bool paused_;
999 }; 1021 };
1000 1022
1001 } // namespace dart 1023 } // namespace dart
1002 1024
1003 #endif // VM_ISOLATE_H_ 1025 #endif // VM_ISOLATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698