5#ifndef RUNTIME_VM_TOKEN_POSITION_H_
6#define RUNTIME_VM_TOKEN_POSITION_H_
43#define SENTINEL_TOKEN_DESCRIPTORS(V) \
52 V(MethodExtractor, -9) \
53 V(DeferredSlowPath, -10) \
54 V(DeferredDeoptInfo, -11) \
55 V(DartCodePrologue, -12) \
56 V(DartCodeEpilogue, -13) \
77 return Pos() <
b.Pos();
100 if (
IsReal())
return (
a.value() <= value()) && (value() <=
b.value());
109 if (!
b.IsReal())
return a;
110 if (!
a.IsReal())
return b;
111 return b.value() <
a.value() ?
b :
a;
117 if (!
b.IsReal())
return a;
118 if (!
a.IsReal())
return b;
119 return b.value() >
a.value() ?
b :
a;
131 return a.value() -
b.value();
136#define DECLARE_VALUES(name, value) \
137 static constexpr int32_t k##name##Pos = value; \
138 static const TokenPosition k##name;
142#define CHECK_VALUES(name, value) \
143 static_assert(k##name##Pos < 0, "Non-negative sentinel descriptor"); \
145 k##name##Pos == kNoSourcePos || k##name##Pos <= kBoxPos, \
146 "Box sentinel descriptor is not greatest classifying sentinel value"); \
147 static_assert(kLastPos <= k##name##Pos, \
148 "Last sentinel descriptor is not least sentinel valu"); \
149 SENTINEL_TOKEN_DESCRIPTORS(CHECK_VALUES);
152 "More sentinel descriptors than expected");
173 inline intptr_t
Pos()
const {
182 return (value_ >= kBox.value()) && (value_ <= kLast.value());
186 inline bool IsNoSource()
const {
return value_ == kNoSourcePos; }
210 bool* is_branch_coverage);
218 intptr_t value()
const {
return value_; }
222 DISALLOW_ALLOCATION();
SENTINEL_TOKEN_DESCRIPTORS(DECLARE_VALUES)
bool operator!=(const TokenPosition &b) const
static const TokenPosition & Min(const TokenPosition &a, const TokenPosition &b)
static TokenPosition DecodeCoveragePosition(intptr_t encoded_position, bool *is_branch_coverage)
bool IsDebugPause() const
intptr_t EncodeCoveragePosition(bool is_branch_coverage)
bool operator>=(const TokenPosition &b) const
static TokenPosition Synthetic(intptr_t value)
static constexpr int32_t kMaxSentinelDescriptors
static constexpr int32_t kMinSourcePos
bool operator<=(const TokenPosition &b) const
static intptr_t CompareForSorting(const TokenPosition &a, const TokenPosition &b)
bool operator<(const TokenPosition &b) const
const char * ToCString() const
int32_t Serialize() const
static TokenPosition Deserialize(int32_t value)
bool operator==(const TokenPosition &b) const
static constexpr int32_t kMaxSourcePos
bool operator>(const TokenPosition &b) const
static const TokenPosition & Max(const TokenPosition &a, const TokenPosition &b)
bool IsWithin(const TokenPosition &a, const TokenPosition &b) const
static const TokenPosition kMaxSource
static const TokenPosition kMinSource
bool IsClassifying() const
#define DECLARE_VALUES(name, value)