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

Unified Diff: src/globals.h

Issue 2324783002: Include only stuff you need, part 9: variables.h (Closed)
Patch Set: rebased Created 4 years, 3 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 | « src/crankshaft/typing.cc ('k') | src/parsing/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index 94e665f571918df456f387a7cac6c9ad862708ab..0350c9223ff3451603d2ce1045c089636d3e221b 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -915,6 +915,39 @@ enum VariableMode : uint8_t {
kLastVariableMode = DYNAMIC_LOCAL
};
+// Printing support
+#ifdef DEBUG
+inline const char* VariableMode2String(VariableMode mode) {
+ switch (mode) {
+ case VAR:
+ return "VAR";
+ case LET:
+ return "LET";
+ case CONST:
+ return "CONST";
+ case DYNAMIC:
+ return "DYNAMIC";
+ case DYNAMIC_GLOBAL:
+ return "DYNAMIC_GLOBAL";
+ case DYNAMIC_LOCAL:
+ return "DYNAMIC_LOCAL";
+ case TEMPORARY:
+ return "TEMPORARY";
+ }
+ UNREACHABLE();
+ return NULL;
+}
+#endif
+
+enum VariableKind : uint8_t {
+ NORMAL_VARIABLE,
+ FUNCTION_VARIABLE,
+ THIS_VARIABLE,
+ ARGUMENTS_VARIABLE,
+ SLOPPY_FUNCTION_NAME_VARIABLE,
+ kLastKind = SLOPPY_FUNCTION_NAME_VARIABLE
+};
+
inline bool IsDynamicVariableMode(VariableMode mode) {
return mode >= DYNAMIC && mode <= DYNAMIC_LOCAL;
}
« no previous file with comments | « src/crankshaft/typing.cc ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698