OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_FLAGS_H_ | 5 #ifndef VM_FLAGS_H_ |
6 #define VM_FLAGS_H_ | 6 #define VM_FLAGS_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/flag_list.h" | 9 #include "vm/flag_list.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 extern type FLAG_##name; | 103 extern type FLAG_##name; |
104 | 104 |
105 #if defined(DEBUG) | 105 #if defined(DEBUG) |
106 #define DEBUG_FLAG_MARCO(name, type, default_value, comment) \ | 106 #define DEBUG_FLAG_MARCO(name, type, default_value, comment) \ |
107 extern type FLAG_##name; | 107 extern type FLAG_##name; |
108 #else // defined(DEBUG) | 108 #else // defined(DEBUG) |
109 #define DEBUG_FLAG_MARCO(name, type, default_value, comment) \ | 109 #define DEBUG_FLAG_MARCO(name, type, default_value, comment) \ |
110 const type FLAG_##name = default_value; | 110 const type FLAG_##name = default_value; |
111 #endif // defined(DEBUG) | 111 #endif // defined(DEBUG) |
112 | 112 |
113 #if defined(PRODUCT) | 113 #if defined(PRODUCT) && defined(DART_PRECOMPILED_RUNTIME) |
| 114 #define RELEASE_FLAG_MARCO(name, precompiled_value, product_value, type, \ |
| 115 default_value, comment) \ |
| 116 const type FLAG_##name = product_value; |
| 117 #define PRECOMPILE_FLAG_MARCO(name, precompiled_value, product_value, type, \ |
| 118 default_value, comment) \ |
| 119 const type FLAG_##name = precompiled_value; |
| 120 |
| 121 #elif defined(PRODUCT) // !PRECOMPILED |
114 #define RELEASE_FLAG_MARCO(name, product_value, type, default_value, comment) \ | 122 #define RELEASE_FLAG_MARCO(name, product_value, type, default_value, comment) \ |
115 const type FLAG_##name = product_value; | 123 const type FLAG_##name = product_value; |
| 124 #define PRECOMPILE_FLAG_MARCO(name, precompiled_value, product_value, type, \ |
| 125 default_value, comment) \ |
| 126 extern type FLAG_##name; |
116 | 127 |
117 #else // defined(PRODUCT) | 128 #elif defined(DART_PRECOMPILED_RUNTIME) // !PRODUCT |
118 | |
119 #define RELEASE_FLAG_MARCO(name, product_value, type, default_value, comment) \ | 129 #define RELEASE_FLAG_MARCO(name, product_value, type, default_value, comment) \ |
120 extern type FLAG_##name; | 130 extern type FLAG_##name; |
| 131 #define PRECOMPILE_FLAG_MARCO(name, precompiled_value, product_value, type, \ |
| 132 default_value, comment) \ |
| 133 const type FLAG_##name = precompiled_value; |
121 | 134 |
122 #endif // defined(PRODUCT) | 135 #else // !PRODUCT && !PRECOMPILED |
| 136 #define RELEASE_FLAG_MARCO(name, product_value, type, default_value, comment) \ |
| 137 extern type FLAG_##name; |
| 138 #define PRECOMPILE_FLAG_MARCO(name, precompiled_value, product_value, type, \ |
| 139 default_value, comment) \ |
| 140 extern type FLAG_##name; |
| 141 |
| 142 #endif |
123 | 143 |
124 // Now declare all flags here. | 144 // Now declare all flags here. |
125 FLAG_LIST(PRODUCT_FLAG_MARCO, RELEASE_FLAG_MARCO, DEBUG_FLAG_MARCO) | 145 FLAG_LIST(PRODUCT_FLAG_MARCO, |
| 146 RELEASE_FLAG_MARCO, |
| 147 DEBUG_FLAG_MARCO, |
| 148 PRECOMPILE_FLAG_MARCO) |
126 | 149 |
127 #undef RELEASE_FLAG_MARCO | 150 #undef RELEASE_FLAG_MARCO |
128 #undef DEBUG_FLAG_MARCO | 151 #undef DEBUG_FLAG_MARCO |
129 #undef PRODUCT_FLAG_MARCO | 152 #undef PRODUCT_FLAG_MARCO |
| 153 #undef PRECOMPILE_FLAG_MARCO |
130 | 154 |
131 } // namespace dart | 155 } // namespace dart |
132 | 156 |
133 #endif // VM_FLAGS_H_ | 157 #endif // VM_FLAGS_H_ |
OLD | NEW |