equal
deleted
inserted
replaced
218 |
218 |
219 // Generate func argument to pass into emit_constraint_xxx functions |
219 // Generate func argument to pass into emit_constraint_xxx functions |
220 #define EMIT_CONSTRAINT_CHECK(func, type) , func, CommandLineFlagConstraint::type |
220 #define EMIT_CONSTRAINT_CHECK(func, type) , func, CommandLineFlagConstraint::type |
221 |
221 |
222 // the "name" argument must be a string literal |
222 // the "name" argument must be a string literal |
223 #define INITIAL_CONSTRAINTS_SIZE 16 |
223 #define INITIAL_CONSTRAINTS_SIZE 40 |
224 GrowableArray<CommandLineFlagConstraint*>* CommandLineFlagConstraintList::_constraints = NULL; |
224 GrowableArray<CommandLineFlagConstraint*>* CommandLineFlagConstraintList::_constraints = NULL; |
225 CommandLineFlagConstraint::ConstraintType CommandLineFlagConstraintList::_validating_type = CommandLineFlagConstraint::AtParse; |
225 CommandLineFlagConstraint::ConstraintType CommandLineFlagConstraintList::_validating_type = CommandLineFlagConstraint::AtParse; |
226 |
226 |
227 // Check the ranges of all flags that have them or print them out and exit if requested |
227 // Check the ranges of all flags that have them or print them out and exit if requested |
228 void CommandLineFlagConstraintList::init(void) { |
228 void CommandLineFlagConstraintList::init(void) { |
272 EMIT_CONSTRAINT_NOTPRODUCT_FLAG, |
272 EMIT_CONSTRAINT_NOTPRODUCT_FLAG, |
273 IGNORE_RANGE, |
273 IGNORE_RANGE, |
274 EMIT_CONSTRAINT_CHECK)); |
274 EMIT_CONSTRAINT_CHECK)); |
275 #endif // COMPILER2 |
275 #endif // COMPILER2 |
276 |
276 |
277 #ifndef INCLUDE_ALL_GCS |
277 #if INCLUDE_ALL_GCS |
278 emit_constraint_no(NULL G1_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG, |
278 emit_constraint_no(NULL G1_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG, |
279 EMIT_CONSTRAINT_PD_DEVELOPER_FLAG, |
279 EMIT_CONSTRAINT_PD_DEVELOPER_FLAG, |
280 EMIT_CONSTRAINT_PRODUCT_FLAG, |
280 EMIT_CONSTRAINT_PRODUCT_FLAG, |
281 EMIT_CONSTRAINT_PD_PRODUCT_FLAG, |
281 EMIT_CONSTRAINT_PD_PRODUCT_FLAG, |
282 EMIT_CONSTRAINT_DIAGNOSTIC_FLAG, |
282 EMIT_CONSTRAINT_DIAGNOSTIC_FLAG, |
303 return found; |
303 return found; |
304 } |
304 } |
305 |
305 |
306 // Check constraints for specific constraint type. |
306 // Check constraints for specific constraint type. |
307 bool CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::ConstraintType type) { |
307 bool CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::ConstraintType type) { |
308 // Skip if we already checked. |
308 guarantee(type > _validating_type, "Constraint check is out of order."); |
309 if (type < _validating_type) { |
|
310 return true; |
|
311 } |
|
312 _validating_type = type; |
309 _validating_type = type; |
313 |
310 |
314 bool status = true; |
311 bool status = true; |
315 for (int i=0; i<length(); i++) { |
312 for (int i=0; i<length(); i++) { |
316 CommandLineFlagConstraint* constraint = at(i); |
313 CommandLineFlagConstraint* constraint = at(i); |