Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::VMTagCounters Class Reference

#include <tags.h>

Public Member Functions

 VMTagCounters ()
 
void Increment (uword tag)
 
int64_t count (uword tag)
 
void PrintToJSONObject (JSONObject *obj)
 

Detailed Description

Definition at line 91 of file tags.h.

Constructor & Destructor Documentation

◆ VMTagCounters()

dart::VMTagCounters::VMTagCounters ( )

Definition at line 98 of file tags.cc.

98 {
99 for (intptr_t i = 0; i < VMTag::kNumVMTags; i++) {
100 counters_[i] = 0;
101 }
102}
@ kNumVMTags
Definition tags.h:42

Member Function Documentation

◆ count()

int64_t dart::VMTagCounters::count ( uword  tag)

Definition at line 116 of file tags.cc.

116 {
119 return counters_[tag];
120}
@ kInvalidTagId
Definition tags.h:38
#define ASSERT(E)

◆ Increment()

void dart::VMTagCounters::Increment ( uword  tag)

Definition at line 104 of file tags.cc.

104 {
106 if (tag < VMTag::kNumVMTags) {
107 counters_[tag]++;
108 } else if (VMTag::IsRuntimeEntryTag(tag)) {
109 counters_[VMTag::kRuntimeTagId]++;
110 } else {
111 // Assume native entry.
112 counters_[VMTag::kNativeTagId]++;
113 }
114}
static bool IsRuntimeEntryTag(uword id)
Definition tags.cc:47

◆ PrintToJSONObject()

void dart::VMTagCounters::PrintToJSONObject ( JSONObject obj)

Definition at line 123 of file tags.cc.

123 {
124 {
125 JSONArray arr(obj, "names");
126 for (intptr_t i = 1; i < VMTag::kNumVMTags; i++) {
127 arr.AddValue(VMTag::TagName(i));
128 }
129 }
130 {
131 JSONArray arr(obj, "counters");
132 for (intptr_t i = 1; i < VMTag::kNumVMTags; i++) {
133 arr.AddValue64(counters_[i]);
134 }
135 }
136}
static const char * TagName(uword id)
Definition tags.cc:19

The documentation for this class was generated from the following files: