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

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

Issue 2584613002: PATCH (not to be comitted): Support for printing instruction statistics
Patch Set: Fixed polymorphic call inside try, added more tags for remaining unknown code Created 4 years 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
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | runtime/vm/code_statistics.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef VM_CODE_STATISTICS_H_
6 #define VM_CODE_STATISTICS_H_
7
8 #include "vm/object.h"
9 #include "vm/assembler.h"
10 #include "vm/intermediate_language.h"
11
12 namespace dart {
13
14 class CombinedCodeStatistics {
15 public:
16 enum EntryCounter {
17 #define DO(type) kTag##type,
18 FOR_EACH_INSTRUCTION(DO)
19 #undef DO
20
21 kPolymorphicInstanceCallAsStaticCall,
22
23 kTagCheckedSmiSlowPath,
24 kTagCheckedSmiCmpSlowPath,
25 kTagBoxAllocationSlowPath,
26 kTagAllocateContextSlowPath,
27 kTagCheckStackOverflowSlowPath,
28 kTagMegamorphicSlowPath,
29
30 kTagCheckArgumentCount,
31 kTagCopyParameters,
32 kTagStubCode,
33 kTagCheckedEntry,
34 kTagFrameEntry,
35 kTagLoadClosureContext,
36 kTagIntrinsics,
37 kDebugAfterBody,
38
39 kTagTrySyncSpilling,
40
41 kNumEntries,
42 };
43
44 CombinedCodeStatistics();
45
46 void Begin(Instruction* instruction);
47 void End(Instruction* instruction);
48
49 void DumpStatistics();
50
51 private:
52 friend class CodeStatistics;
53
54 void SlowSort();
55 void Swap(intptr_t a, intptr_t b);
56
57 typedef struct {
58 const char* name;
59 intptr_t bytes;
60 intptr_t count;
61 } Entry;
62
63 Entry entries_[kNumEntries];
64 intptr_t unaccounted_bytes_;
65 intptr_t alignment_bytes_;
66 intptr_t object_header_bytes_;
67 intptr_t wasteful_function_count_;
68 intptr_t return_const_count_;
69 intptr_t return_const_with_load_field_count_;
70 };
71
72 class CodeStatistics {
73 public:
74 explicit CodeStatistics(Assembler* assembler);
75
76 void Begin(Instruction* instruction);
77 void End(Instruction* instruction);
78
79 void SpecialBegin(intptr_t tag);
80 void SpecialEnd(intptr_t tag);
81
82 void AppendTo(CombinedCodeStatistics* stat);
83
84 void Finalize();
85
86 private:
87 static const int kStackSize = 8;
88
89 Assembler* assembler_;
90
91 typedef struct {
92 intptr_t bytes;
93 intptr_t count;
94 } Entry;
95
96 Entry entries_[CombinedCodeStatistics::kNumEntries];
97 intptr_t instruction_bytes_;
98 intptr_t unaccounted_bytes_;
99 intptr_t alignment_bytes_;
100
101 intptr_t stack_[kStackSize];
102 intptr_t stack_index_;
103 };
104
105 } // namespace dart
106
107 #endif // VM_CODE_STATISTICS_H_
OLDNEW
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | runtime/vm/code_statistics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698