File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,12 @@ namespace {
24
24
25
25
// Helper for collecting HeapTypes and their frequencies.
26
26
struct Counts : public InsertOrderedMap <HeapType, size_t > {
27
+ int notes = 0 ;
28
+ int includes = 0 ;
27
29
void note (HeapType type) {
28
30
if (!type.isBasic ()) {
29
31
(*this )[type]++;
32
+ notes++;
30
33
}
31
34
}
32
35
void note (Type type) {
@@ -38,6 +41,7 @@ struct Counts : public InsertOrderedMap<HeapType, size_t> {
38
41
void include (HeapType type) {
39
42
if (!type.isBasic ()) {
40
43
(*this )[type];
44
+ includes++;
41
45
}
42
46
}
43
47
void include (Type type) {
@@ -137,6 +141,8 @@ Counts getHeapTypeCounts(Module& wasm) {
137
141
for (auto & [sig, count] : functionCounts) {
138
142
counts[sig] += count;
139
143
}
144
+ counts.notes += functionCounts.notes ;
145
+ counts.includes += functionCounts.includes ;
140
146
}
141
147
142
148
// Recursively traverse each reference type, which may have a child type that
@@ -191,6 +197,8 @@ Counts getHeapTypeCounts(Module& wasm) {
191
197
for (auto & [type, count] : counts) {
192
198
std::cout << ((type.getID () << 2 ) % 997 ) << " , count: " << count << " \n " ;
193
199
}
200
+ std::cout << " total notes: " << counts.notes
201
+ << " , includes: " << counts.includes << " \n " ;
194
202
return counts;
195
203
}
196
204
You can’t perform that action at this time.
0 commit comments