| 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 |
| 11 // a mode defined before it's included. The modes are FLAG_MODE_... below: | 11 // a mode defined before it's included. The modes are FLAG_MODE_... below: |
| 12 | 12 |
| 13 #define DEFINE_IMPLICATION(whenflag, thenflag) \ | 13 #define DEFINE_IMPLICATION(whenflag, thenflag) \ |
| 14 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, true) | 14 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, true) |
| 15 | 15 |
| 16 #define DEFINE_NEG_IMPLICATION(whenflag, thenflag) \ | 16 #define DEFINE_NEG_IMPLICATION(whenflag, thenflag) \ |
| 17 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false) | 17 DEFINE_VALUE_IMPLICATION(whenflag, thenflag, false) |
| 18 | 18 |
| 19 #define DEFINE_NEG_NEG_IMPLICATION(whenflag, thenflag) \ | 19 #define DEFINE_NEG_NEG_IMPLICATION(whenflag, thenflag) \ |
| 20 DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, false) | 20 DEFINE_NEG_VALUE_IMPLICATION(whenflag, thenflag, false) |
| 21 | 21 |
| 22 // We want to declare the names of the variables for the header file. Normally | 22 // We want to declare the names of the variables for the header file. Normally |
| 23 // this will just be an extern declaration, but for a readonly flag we let the | 23 // this will just be an extern declaration, but for a readonly flag we let the |
| 24 // compiler make better optimizations by giving it the value. | 24 // compiler make better optimizations by giving it the value. |
| 25 #if defined(FLAG_MODE_DECLARE) | 25 #if defined(FLAG_MODE_DECLARE) |
| 26 #define FLAG_FULL(ftype, ctype, nam, def, cmt) extern ctype FLAG_##nam; | 26 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ |
| 27 V8_EXPORT_PRIVATE extern ctype FLAG_##nam; |
| 27 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \ | 28 #define FLAG_READONLY(ftype, ctype, nam, def, cmt) \ |
| 28 static ctype const FLAG_##nam = def; | 29 static ctype const FLAG_##nam = def; |
| 29 | 30 |
| 30 // We want to supply the actual storage and value for the flag variable in the | 31 // We want to supply the actual storage and value for the flag variable in the |
| 31 // .cc file. We only do this for writable flags. | 32 // .cc file. We only do this for writable flags. |
| 32 #elif defined(FLAG_MODE_DEFINE) | 33 #elif defined(FLAG_MODE_DEFINE) |
| 33 #define FLAG_FULL(ftype, ctype, nam, def, cmt) ctype FLAG_##nam = def; | 34 #ifdef USING_V8_SHARED |
| 35 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ |
| 36 V8_EXPORT_PRIVATE extern ctype FLAG_##nam; |
| 37 #else |
| 38 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ |
| 39 V8_EXPORT_PRIVATE ctype FLAG_##nam = def; |
| 40 #endif |
| 34 | 41 |
| 35 // We need to define all of our default values so that the Flag structure can | 42 // We need to define all of our default values so that the Flag structure can |
| 36 // access them by pointer. These are just used internally inside of one .cc, | 43 // access them by pointer. These are just used internally inside of one .cc, |
| 37 // for MODE_META, so there is no impact on the flags interface. | 44 // for MODE_META, so there is no impact on the flags interface. |
| 38 #elif defined(FLAG_MODE_DEFINE_DEFAULTS) | 45 #elif defined(FLAG_MODE_DEFINE_DEFAULTS) |
| 39 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ | 46 #define FLAG_FULL(ftype, ctype, nam, def, cmt) \ |
| 40 static ctype const FLAGDEFAULT_##nam = def; | 47 static ctype const FLAGDEFAULT_##nam = def; |
| 41 | 48 |
| 42 // We want to write entries into our meta data table, for internal parsing and | 49 // We want to write entries into our meta data table, for internal parsing and |
| 43 // printing / etc in the flag parser code. We only do this for writable flags. | 50 // printing / etc in the flag parser code. We only do this for writable flags. |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 #undef DEFINE_ALIAS_FLOAT | 1209 #undef DEFINE_ALIAS_FLOAT |
| 1203 #undef DEFINE_ALIAS_ARGS | 1210 #undef DEFINE_ALIAS_ARGS |
| 1204 | 1211 |
| 1205 #undef FLAG_MODE_DECLARE | 1212 #undef FLAG_MODE_DECLARE |
| 1206 #undef FLAG_MODE_DEFINE | 1213 #undef FLAG_MODE_DEFINE |
| 1207 #undef FLAG_MODE_DEFINE_DEFAULTS | 1214 #undef FLAG_MODE_DEFINE_DEFAULTS |
| 1208 #undef FLAG_MODE_META | 1215 #undef FLAG_MODE_META |
| 1209 #undef FLAG_MODE_DEFINE_IMPLICATIONS | 1216 #undef FLAG_MODE_DEFINE_IMPLICATIONS |
| 1210 | 1217 |
| 1211 #undef COMMA | 1218 #undef COMMA |
| OLD | NEW |