OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file defines all of the flags. It is separated into different section, | 5 // This file defines all of the flags. It is separated into different section, |
6 // for Debug, Release, Logging and Profiling, etc. To add a new flag, find the | 6 // for Debug, Release, Logging and Profiling, etc. To add a new flag, find the |
7 // correct section, and use one of the DEFINE_ macros, without a trailing ';'. | 7 // correct section, and use one of the DEFINE_ macros, without a trailing ';'. |
8 // | 8 // |
9 // This include does not have a guard, because it is a template-style include, | 9 // This include does not have a guard, because it is a template-style include, |
10 // which can be included multiple times in different modes. It expects to have | 10 // which can be included multiple times in different modes. It expects to have |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 #else | 119 #else |
120 #define ENABLE_32DREGS_DEFAULT false | 120 #define ENABLE_32DREGS_DEFAULT false |
121 #endif | 121 #endif |
122 #if (defined CAN_USE_NEON) || !(defined ARM_TEST_NO_FEATURE_PROBE) | 122 #if (defined CAN_USE_NEON) || !(defined ARM_TEST_NO_FEATURE_PROBE) |
123 # define ENABLE_NEON_DEFAULT true | 123 # define ENABLE_NEON_DEFAULT true |
124 #else | 124 #else |
125 # define ENABLE_NEON_DEFAULT false | 125 # define ENABLE_NEON_DEFAULT false |
126 #endif | 126 #endif |
127 | 127 |
128 #define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) | 128 #define DEFINE_BOOL(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) |
| 129 #define DEFINE_BOOL_READONLY(nam, def, cmt) \ |
| 130 FLAG_READONLY(BOOL, bool, nam, def, cmt) |
129 #define DEFINE_MAYBE_BOOL(nam, cmt) \ | 131 #define DEFINE_MAYBE_BOOL(nam, cmt) \ |
130 FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, {false COMMA false}, cmt) | 132 FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, {false COMMA false}, cmt) |
131 #define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt) | 133 #define DEFINE_INT(nam, def, cmt) FLAG(INT, int, nam, def, cmt) |
132 #define DEFINE_FLOAT(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) | 134 #define DEFINE_FLOAT(nam, def, cmt) FLAG(FLOAT, double, nam, def, cmt) |
133 #define DEFINE_STRING(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt) | 135 #define DEFINE_STRING(nam, def, cmt) FLAG(STRING, const char*, nam, def, cmt) |
134 #define DEFINE_ARGS(nam, cmt) FLAG(ARGS, JSArguments, nam, {0 COMMA NULL}, cmt) | 136 #define DEFINE_ARGS(nam, cmt) FLAG(ARGS, JSArguments, nam, {0 COMMA NULL}, cmt) |
135 | 137 |
136 #define DEFINE_ALIAS_BOOL(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam) | 138 #define DEFINE_ALIAS_BOOL(alias, nam) FLAG_ALIAS(BOOL, bool, alias, nam) |
137 #define DEFINE_ALIAS_INT(alias, nam) FLAG_ALIAS(INT, int, alias, nam) | 139 #define DEFINE_ALIAS_INT(alias, nam) FLAG_ALIAS(INT, int, alias, nam) |
138 #define DEFINE_ALIAS_FLOAT(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam) | 140 #define DEFINE_ALIAS_FLOAT(alias, nam) FLAG_ALIAS(FLOAT, double, alias, nam) |
139 #define DEFINE_ALIAS_STRING(alias, nam) \ | 141 #define DEFINE_ALIAS_STRING(alias, nam) \ |
140 FLAG_ALIAS(STRING, const char*, alias, nam) | 142 FLAG_ALIAS(STRING, const char*, alias, nam) |
141 #define DEFINE_ALIAS_ARGS(alias, nam) FLAG_ALIAS(ARGS, JSArguments, alias, nam) | 143 #define DEFINE_ALIAS_ARGS(alias, nam) FLAG_ALIAS(ARGS, JSArguments, alias, nam) |
142 | 144 |
143 // | 145 // |
144 // Flags in all modes. | 146 // Flags in all modes. |
145 // | 147 // |
146 #define FLAG FLAG_FULL | 148 #define FLAG FLAG_FULL |
147 | 149 |
148 // Flags for language modes and experimental language features. | 150 // Flags for language modes and experimental language features. |
149 DEFINE_BOOL(use_strict, false, "enforce strict mode") | 151 DEFINE_BOOL(use_strict, false, "enforce strict mode") |
| 152 |
150 DEFINE_BOOL(es_staging, false, "enable upcoming ES6+ features") | 153 DEFINE_BOOL(es_staging, false, "enable upcoming ES6+ features") |
| 154 DEFINE_BOOL(harmony, false, "enable all harmony features (except proxies)") |
| 155 DEFINE_IMPLICATION(harmony, es_staging) |
151 | 156 |
152 DEFINE_BOOL(harmony_scoping, false, "enable harmony block scoping") | 157 #define HARMONY_FEATURES(V) \ |
153 DEFINE_BOOL(harmony_modules, false, | 158 V(harmony_scoping, "harmony block scoping") \ |
154 "enable harmony modules (implies block scoping)") | 159 V(harmony_modules, "harmony modules (implies block scoping)") \ |
155 DEFINE_BOOL(harmony_proxies, false, "enable harmony proxies") | 160 V(harmony_strings, "harmony strings") \ |
156 DEFINE_BOOL(harmony_numeric_literals, false, | 161 V(harmony_arrays, "harmony arrays") \ |
157 "enable harmony numeric literals (0o77, 0b11)") | 162 V(harmony_classes, "harmony classes") \ |
158 DEFINE_BOOL(harmony_strings, false, "enable harmony string") | 163 V(harmony_object_literals, "harmony object literal extensions") \ |
159 DEFINE_BOOL(harmony_arrays, false, "enable harmony arrays") | 164 V(harmony_regexps, "reg-exp related harmony features") \ |
160 DEFINE_BOOL(harmony_arrow_functions, false, "enable harmony arrow functions") | 165 V(harmony_arrow_functions, "harmony arrow functions") |
161 DEFINE_BOOL(harmony_classes, false, "enable harmony classes") | |
162 DEFINE_BOOL(harmony_object_literals, false, | |
163 "enable harmony object literal extensions") | |
164 DEFINE_BOOL(harmony_regexps, false, "enable regexp-related harmony features") | |
165 DEFINE_BOOL(harmony, false, "enable all harmony features (except proxies)") | |
166 | 166 |
167 DEFINE_IMPLICATION(harmony, harmony_scoping) | 167 #define STAGED_FEATURES(V) \ |
168 DEFINE_IMPLICATION(harmony, harmony_modules) | 168 V(harmony_numeric_literals, "harmony numeric literals (0o77, 0b11)") |
169 // TODO(rossberg): Reenable when problems are sorted out. | 169 |
170 // DEFINE_IMPLICATION(harmony, harmony_proxies) | 170 #define SHIPPING_FEATURES(V) |
171 DEFINE_IMPLICATION(harmony, harmony_strings) | 171 |
172 DEFINE_IMPLICATION(harmony, harmony_arrays) | 172 #define FLAG_FEATURES(id, description) \ |
173 DEFINE_IMPLICATION(harmony, harmony_arrow_functions) | 173 DEFINE_BOOL(id, false, "enable " #description) \ |
174 DEFINE_IMPLICATION(harmony, harmony_classes) | 174 DEFINE_IMPLICATION(harmony, id) |
175 DEFINE_IMPLICATION(harmony, harmony_object_literals) | 175 |
176 DEFINE_IMPLICATION(harmony, harmony_regexps) | 176 HARMONY_FEATURES(FLAG_FEATURES) |
| 177 STAGED_FEATURES(FLAG_FEATURES) |
| 178 #undef FLAG_FEATURES |
| 179 |
| 180 #define FLAG_STAGED_FEATURES(id, description) DEFINE_IMPLICATION(es_staging, id) |
| 181 |
| 182 STAGED_FEATURES(FLAG_STAGED_FEATURES) |
| 183 #undef FLAG_STAGED_FEATURES |
| 184 |
| 185 #define FLAG_SHIPPING_FEATURES(id, description) \ |
| 186 DEFINE_BOOL_READONLY(id, true, "enable " #description) |
| 187 |
| 188 SHIPPING_FEATURES(FLAG_SHIPPING_FEATURES) |
| 189 #undef FLAG_SHIPPING_FEATURES |
| 190 |
| 191 // Feature dependencies. |
177 DEFINE_IMPLICATION(harmony_modules, harmony_scoping) | 192 DEFINE_IMPLICATION(harmony_modules, harmony_scoping) |
178 DEFINE_IMPLICATION(harmony_classes, harmony_scoping) | 193 DEFINE_IMPLICATION(harmony_classes, harmony_scoping) |
179 DEFINE_IMPLICATION(harmony_classes, harmony_object_literals) | 194 DEFINE_IMPLICATION(harmony_classes, harmony_object_literals) |
180 | 195 |
181 DEFINE_IMPLICATION(harmony, es_staging) | 196 DEFINE_BOOL(harmony_proxies, false, "enable harmony proxies") |
182 DEFINE_IMPLICATION(es_staging, harmony_numeric_literals) | 197 // TODO(rossberg): Reenable when problems are sorted out. |
| 198 // DEFINE_IMPLICATION(harmony, harmony_proxies) |
| 199 |
183 | 200 |
184 // Flags for experimental implementation features. | 201 // Flags for experimental implementation features. |
185 DEFINE_BOOL(compiled_keyed_generic_loads, false, | 202 DEFINE_BOOL(compiled_keyed_generic_loads, false, |
186 "use optimizing compiler to generate keyed generic load stubs") | 203 "use optimizing compiler to generate keyed generic load stubs") |
187 DEFINE_BOOL(clever_optimizations, true, | 204 DEFINE_BOOL(clever_optimizations, true, |
188 "Optimize object size, Array shift, DOM strings and string +") | 205 "Optimize object size, Array shift, DOM strings and string +") |
189 // TODO(hpayer): We will remove this flag as soon as we have pretenuring | 206 // TODO(hpayer): We will remove this flag as soon as we have pretenuring |
190 // support for specific allocation sites. | 207 // support for specific allocation sites. |
191 DEFINE_BOOL(pretenuring_call_new, false, "pretenure call new") | 208 DEFINE_BOOL(pretenuring_call_new, false, "pretenure call new") |
192 DEFINE_BOOL(allocation_site_pretenuring, true, | 209 DEFINE_BOOL(allocation_site_pretenuring, true, |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 #undef DEFINE_ALIAS_FLOAT | 948 #undef DEFINE_ALIAS_FLOAT |
932 #undef DEFINE_ALIAS_ARGS | 949 #undef DEFINE_ALIAS_ARGS |
933 | 950 |
934 #undef FLAG_MODE_DECLARE | 951 #undef FLAG_MODE_DECLARE |
935 #undef FLAG_MODE_DEFINE | 952 #undef FLAG_MODE_DEFINE |
936 #undef FLAG_MODE_DEFINE_DEFAULTS | 953 #undef FLAG_MODE_DEFINE_DEFAULTS |
937 #undef FLAG_MODE_META | 954 #undef FLAG_MODE_META |
938 #undef FLAG_MODE_DEFINE_IMPLICATIONS | 955 #undef FLAG_MODE_DEFINE_IMPLICATIONS |
939 | 956 |
940 #undef COMMA | 957 #undef COMMA |
OLD | NEW |