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

Unified Diff: runtime/vm/token_position.h

Issue 2772193004: Resolve initialization order fiasco between code_descriptors.cc and token_position.cc. (Closed)
Patch Set: Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_descriptors.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/token_position.h
diff --git a/runtime/vm/token_position.h b/runtime/vm/token_position.h
index 65dd3ed353eff1f555b41fef6bf97c2135c79f55..c28f9a49661aec95371f85ecd2654fc8f23d5d71 100644
--- a/runtime/vm/token_position.h
+++ b/runtime/vm/token_position.h
@@ -79,10 +79,14 @@ class TokenPosition {
static const intptr_t kMaxSentinelDescriptors = 64;
-#define DECLARE_VALUES(name, value) static const TokenPosition k##name;
+#define DECLARE_VALUES(name, value) \
+ static const intptr_t k##name##Pos = value; \
+ static const TokenPosition k##name;
SENTINEL_TOKEN_DESCRIPTORS(DECLARE_VALUES);
#undef DECLARE_VALUES
+ static const intptr_t kMinSourcePos = 0;
static const TokenPosition kMinSource;
+ static const intptr_t kMaxSourcePos = kSmiMax32 - kMaxSentinelDescriptors - 2;
static const TokenPosition kMaxSource;
// Decode from a snapshot.
@@ -110,11 +114,6 @@ class TokenPosition {
return value_;
}
- // Token position constants.
- static const intptr_t kNoSourcePos = -1;
- static const intptr_t kMinSourcePos = 0;
- static const intptr_t kMaxSourcePos = kSmiMax32 - kMaxSentinelDescriptors - 2;
-
// Is |this| a classifying sentinel source position?
// Classifying positions are used by the profiler to group instructions whose
// cost isn't naturally attributable to a source location.
« no previous file with comments | « runtime/vm/code_descriptors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698