< prev index next >

src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp

Print this page
   1 /*
   2  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 249 JVMFlagConstraint::ConstraintType JVMFlagConstraintList::_validating_type = JVMFlagConstraint::AtParse;
 250 
 251 // Check the ranges of all flags that have them or print them out and exit if requested
 252 void JVMFlagConstraintList::init(void) {
 253   _constraints = new (ResourceObj::C_HEAP, mtArguments) GrowableArray<JVMFlagConstraint*>(INITIAL_CONSTRAINTS_SIZE, true);
 254 
 255   EMIT_CONSTRAINT_START
 256 
 257   ALL_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
 258             EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,
 259             EMIT_CONSTRAINT_PRODUCT_FLAG,
 260             EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
 261             EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
 262             EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
 263             EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
 264             EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
 265             EMIT_CONSTRAINT_MANAGEABLE_FLAG,
 266             EMIT_CONSTRAINT_PRODUCT_RW_FLAG,
 267             EMIT_CONSTRAINT_LP64_PRODUCT_FLAG,
 268             IGNORE_RANGE,
 269             EMIT_CONSTRAINT_CHECK,
 270             IGNORE_WRITEABLE)
 271 
 272   EMIT_CONSTRAINT_END
 273 }
 274 
 275 JVMFlagConstraint* JVMFlagConstraintList::find(const JVMFlag* flag) {
 276   JVMFlagConstraint* found = NULL;
 277   for (int i=0; i<length(); i++) {
 278     JVMFlagConstraint* constraint = at(i);
 279     if (constraint->flag() == flag) {
 280       found = constraint;
 281       break;
 282     }
 283   }
 284   return found;
 285 }
 286 
 287 // Find constraints and return only if found constraint's type is equal or lower than current validating type.
 288 JVMFlagConstraint* JVMFlagConstraintList::find_if_needs_check(const JVMFlag* flag) {
 289   JVMFlagConstraint* found = NULL;
 290   JVMFlagConstraint* constraint = find(flag);
   1 /*
   2  * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 249 JVMFlagConstraint::ConstraintType JVMFlagConstraintList::_validating_type = JVMFlagConstraint::AtParse;
 250 
 251 // Check the ranges of all flags that have them or print them out and exit if requested
 252 void JVMFlagConstraintList::init(void) {
 253   _constraints = new (ResourceObj::C_HEAP, mtArguments) GrowableArray<JVMFlagConstraint*>(INITIAL_CONSTRAINTS_SIZE, true);
 254 
 255   EMIT_CONSTRAINT_START
 256 
 257   ALL_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG,
 258             EMIT_CONSTRAINT_PD_DEVELOPER_FLAG,
 259             EMIT_CONSTRAINT_PRODUCT_FLAG,
 260             EMIT_CONSTRAINT_PD_PRODUCT_FLAG,
 261             EMIT_CONSTRAINT_DIAGNOSTIC_FLAG,
 262             EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG,
 263             EMIT_CONSTRAINT_EXPERIMENTAL_FLAG,
 264             EMIT_CONSTRAINT_NOTPRODUCT_FLAG,
 265             EMIT_CONSTRAINT_MANAGEABLE_FLAG,
 266             EMIT_CONSTRAINT_PRODUCT_RW_FLAG,
 267             EMIT_CONSTRAINT_LP64_PRODUCT_FLAG,
 268             IGNORE_RANGE,
 269             EMIT_CONSTRAINT_CHECK)

 270 
 271   EMIT_CONSTRAINT_END
 272 }
 273 
 274 JVMFlagConstraint* JVMFlagConstraintList::find(const JVMFlag* flag) {
 275   JVMFlagConstraint* found = NULL;
 276   for (int i=0; i<length(); i++) {
 277     JVMFlagConstraint* constraint = at(i);
 278     if (constraint->flag() == flag) {
 279       found = constraint;
 280       break;
 281     }
 282   }
 283   return found;
 284 }
 285 
 286 // Find constraints and return only if found constraint's type is equal or lower than current validating type.
 287 JVMFlagConstraint* JVMFlagConstraintList::find_if_needs_check(const JVMFlag* flag) {
 288   JVMFlagConstraint* found = NULL;
 289   JVMFlagConstraint* constraint = find(flag);
< prev index next >