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

Unified Diff: src/flag-definitions.h

Issue 642233003: Simplify language feature management. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 6 years, 2 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/bootstrapper.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index c2abd0f5a1553ddf5a2bb031f71e14f7d234c80b..47076350945f4214c71a3b282883ace43258ec43 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -126,6 +126,8 @@ struct MaybeBoolFlag {
#endif
#define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt)
+#define DEFINE_BOOL_READONLY(nam, def, cmt) \
+ FLAG_READONLY(BOOL, bool, nam, def, cmt)
#define DEFINE_MAYBE_BOOL(nam, cmt) \
FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, {false COMMA false}, cmt)
#define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt)
@@ -147,39 +149,54 @@ struct MaybeBoolFlag {
// Flags for language modes and experimental language features.
DEFINE_BOOL(use_strict, false, "enforce strict mode")
-DEFINE_BOOL(es_staging, false, "enable upcoming ES6+ features")
-DEFINE_BOOL(harmony_scoping, false, "enable harmony block scoping")
-DEFINE_BOOL(harmony_modules, false,
- "enable harmony modules (implies block scoping)")
-DEFINE_BOOL(harmony_proxies, false, "enable harmony proxies")
-DEFINE_BOOL(harmony_numeric_literals, false,
- "enable harmony numeric literals (0o77, 0b11)")
-DEFINE_BOOL(harmony_strings, false, "enable harmony string")
-DEFINE_BOOL(harmony_arrays, false, "enable harmony arrays")
-DEFINE_BOOL(harmony_arrow_functions, false, "enable harmony arrow functions")
-DEFINE_BOOL(harmony_classes, false, "enable harmony classes")
-DEFINE_BOOL(harmony_object_literals, false,
- "enable harmony object literal extensions")
-DEFINE_BOOL(harmony_regexps, false, "enable regexp-related harmony features")
+DEFINE_BOOL(es_staging, false, "enable upcoming ES6+ features")
DEFINE_BOOL(harmony, false, "enable all harmony features (except proxies)")
+DEFINE_IMPLICATION(harmony, es_staging)
-DEFINE_IMPLICATION(harmony, harmony_scoping)
-DEFINE_IMPLICATION(harmony, harmony_modules)
-// TODO(rossberg): Reenable when problems are sorted out.
-// DEFINE_IMPLICATION(harmony, harmony_proxies)
-DEFINE_IMPLICATION(harmony, harmony_strings)
-DEFINE_IMPLICATION(harmony, harmony_arrays)
-DEFINE_IMPLICATION(harmony, harmony_arrow_functions)
-DEFINE_IMPLICATION(harmony, harmony_classes)
-DEFINE_IMPLICATION(harmony, harmony_object_literals)
-DEFINE_IMPLICATION(harmony, harmony_regexps)
+#define HARMONY_FEATURES(V) \
+ V(harmony_scoping, "harmony block scoping") \
+ V(harmony_modules, "harmony modules (implies block scoping)") \
+ V(harmony_strings, "harmony strings") \
+ V(harmony_arrays, "harmony arrays") \
+ V(harmony_classes, "harmony classes") \
+ V(harmony_object_literals, "harmony object literal extensions") \
+ V(harmony_regexps, "reg-exp related harmony features") \
+ V(harmony_arrow_functions, "harmony arrow functions")
+
+#define STAGED_FEATURES(V) \
+ V(harmony_numeric_literals, "harmony numeric literals (0o77, 0b11)")
+
+#define SHIPPING_FEATURES(V)
+
+#define FLAG_FEATURES(id, description) \
+ DEFINE_BOOL(id, false, "enable " #description) \
+ DEFINE_IMPLICATION(harmony, id)
+
+HARMONY_FEATURES(FLAG_FEATURES)
+STAGED_FEATURES(FLAG_FEATURES)
+#undef FLAG_FEATURES
+
+#define FLAG_STAGED_FEATURES(id, description) DEFINE_IMPLICATION(es_staging, id)
+
+STAGED_FEATURES(FLAG_STAGED_FEATURES)
+#undef FLAG_STAGED_FEATURES
+
+#define FLAG_SHIPPING_FEATURES(id, description) \
+ DEFINE_BOOL_READONLY(id, true, "enable " #description)
+
+SHIPPING_FEATURES(FLAG_SHIPPING_FEATURES)
+#undef FLAG_SHIPPING_FEATURES
+
+// Feature dependencies.
DEFINE_IMPLICATION(harmony_modules, harmony_scoping)
DEFINE_IMPLICATION(harmony_classes, harmony_scoping)
DEFINE_IMPLICATION(harmony_classes, harmony_object_literals)
-DEFINE_IMPLICATION(harmony, es_staging)
-DEFINE_IMPLICATION(es_staging, harmony_numeric_literals)
+DEFINE_BOOL(harmony_proxies, false, "enable harmony proxies")
+// TODO(rossberg): Reenable when problems are sorted out.
+// DEFINE_IMPLICATION(harmony, harmony_proxies)
+
// Flags for experimental implementation features.
DEFINE_BOOL(compiled_keyed_generic_loads, false,
« no previous file with comments | « src/bootstrapper.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698