Flutter Engine
The Flutter Engine
Classes | Public Types | Static Public Member Functions | List of all members
dart::VMTag Class Reference

#include <tags.h>

Inheritance diagram for dart::VMTag:
dart::AllStatic

Public Types

enum  VMTagId {
  kInvalidTagId = 0 , kNumVMTags , kRootTagId , kTruncatedTagId ,
  kNoneCodeTagId , kOptimizedCodeTagId , kUnoptimizedCodeTagId , kNativeCodeTagId ,
  kInlineStartCodeTagId , kInlineEndCodeTagId , kLastTagId
}
 

Static Public Member Functions

static bool IsVMTag (uword id)
 
static const char * TagName (uword id)
 
static bool IsNativeEntryTag (uword id)
 
static bool IsDartTag (uword id)
 
static bool IsExitFrameTag (uword id)
 
static bool IsRuntimeEntryTag (uword id)
 
static const char * RuntimeEntryTagName (uword id)
 
static void RegisterRuntimeEntry (RuntimeEntry *runtime_entry)
 

Detailed Description

Definition at line 35 of file tags.h.

Member Enumeration Documentation

◆ VMTagId

Enumerator
kInvalidTagId 
kNumVMTags 
kRootTagId 
kTruncatedTagId 
kNoneCodeTagId 
kOptimizedCodeTagId 
kUnoptimizedCodeTagId 
kNativeCodeTagId 
kInlineStartCodeTagId 
kInlineEndCodeTagId 
kLastTagId 

Definition at line 37 of file tags.h.

37 {
38 kInvalidTagId = 0,
39#define DEFINE_VM_TAG_ID(tag) k##tag##TagId,
41#undef DEFINE_VM_TAG_KIND
43 //
44 // All tags below |kNumVMTags| are special meta-data tags and do not
45 // indicate the state of the VM during a sample.
46 //
47 kRootTagId, // Special tag used as root of all profiles.
48 kTruncatedTagId, // Special tag used to indicate a truncated call stack.
49 // Code transition tags (used by unit tests).
57 };
@ kUnoptimizedCodeTagId
Definition: tags.h:52
@ kNoneCodeTagId
Definition: tags.h:50
@ kLastTagId
Definition: tags.h:56
@ kInlineStartCodeTagId
Definition: tags.h:54
@ kInvalidTagId
Definition: tags.h:38
@ kNumVMTags
Definition: tags.h:42
@ kNativeCodeTagId
Definition: tags.h:53
@ kInlineEndCodeTagId
Definition: tags.h:55
@ kTruncatedTagId
Definition: tags.h:48
@ kRootTagId
Definition: tags.h:47
@ kOptimizedCodeTagId
Definition: tags.h:51
#define VM_TAG_LIST(V)
Definition: tags.h:19
#define DEFINE_VM_TAG_ID(tag)
Definition: tags.h:39

Member Function Documentation

◆ IsDartTag()

static bool dart::VMTag::IsDartTag ( uword  id)
inlinestatic

Definition at line 64 of file tags.h.

64{ return id == kDartTagId; }

◆ IsExitFrameTag()

bool dart::VMTag::IsExitFrameTag ( uword  id)
static

Definition at line 42 of file tags.cc.

42 {
43 return (id != 0) && !IsDartTag(id) && (id != kIdleTagId) &&
44 (id != kVMTagId) && (id != kEmbedderTagId);
45}
static bool IsDartTag(uword id)
Definition: tags.h:64

◆ IsNativeEntryTag()

bool dart::VMTag::IsNativeEntryTag ( uword  id)
static

Definition at line 38 of file tags.cc.

38 {
39 return (tag > kLastTagId) && !IsRuntimeEntryTag(tag);
40}
static bool IsRuntimeEntryTag(uword id)
Definition: tags.cc:47

◆ IsRuntimeEntryTag()

bool dart::VMTag::IsRuntimeEntryTag ( uword  id)
static

Definition at line 47 of file tags.cc.

47 {
48 return RuntimeEntryTagName(id) != nullptr;
49}
static const char * RuntimeEntryTagName(uword id)
Definition: tags.cc:51

◆ IsVMTag()

static bool dart::VMTag::IsVMTag ( uword  id)
inlinestatic

Definition at line 59 of file tags.h.

59 {
60 return (id != kInvalidTagId) && (id < kNumVMTags);
61 }

◆ RegisterRuntimeEntry()

static void dart::VMTag::RegisterRuntimeEntry ( RuntimeEntry runtime_entry)
static

◆ RuntimeEntryTagName()

const char * dart::VMTag::RuntimeEntryTagName ( uword  id)
static

Definition at line 51 of file tags.cc.

51 {
52 const void* address = reinterpret_cast<const void*>(id);
53
54#define CHECK_RUNTIME_ADDRESS(n) \
55 if (address == k##n##RuntimeEntry.function()) \
56 return k##n##RuntimeEntry.name();
58#undef CHECK_RUNTIME_ADDRESS
59
60#define CHECK_LEAF_RUNTIME_ADDRESS(type, n, ...) \
61 if (address == k##n##RuntimeEntry.function()) \
62 return k##n##RuntimeEntry.name();
64#undef CHECK_LEAF_RUNTIME_ADDRESS
65
66 return nullptr;
67}
#define RUNTIME_ENTRY_LIST(V)
#define LEAF_RUNTIME_ENTRY_LIST(V)
#define CHECK_LEAF_RUNTIME_ADDRESS(type, n,...)
#define CHECK_RUNTIME_ADDRESS(n)
const uintptr_t id

◆ TagName()

const char * dart::VMTag::TagName ( uword  id)
static

Definition at line 19 of file tags.cc.

19 {
20 if (IsNativeEntryTag(tag)) {
21 const uint8_t* native_reverse_lookup = NativeEntry::ResolveSymbol(tag);
22 if (native_reverse_lookup != nullptr) {
23 return reinterpret_cast<const char*>(native_reverse_lookup);
24 }
25 return "Unknown native entry";
26 } else if (IsRuntimeEntryTag(tag)) {
27 const char* runtime_entry_name = RuntimeEntryTagName(tag);
28 ASSERT(runtime_entry_name != nullptr);
29 return runtime_entry_name;
30 }
31 ASSERT(tag != kInvalidTagId);
32 ASSERT(tag < kNumVMTags);
33 const TagEntry& entry = entries_[tag];
34 ASSERT(entry.id == tag);
35 return entry.name;
36}
static const uint8_t * ResolveSymbol(uword pc)
Definition: native_entry.cc:73
static bool IsNativeEntryTag(uword id)
Definition: tags.cc:38
#define ASSERT(E)

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