< prev index next >

src/share/vm/runtime/commandLineFlagConstraintList.hpp

Print this page
rev 8851 : [mq]: webrev.00


  37  * See runtime "runtime/commandLineFlagConstraintsCompiler.hpp",
  38  * "runtime/commandLineFlagConstraintsGC.hpp" and
  39  * "runtime/commandLineFlagConstraintsRuntime.hpp" for the functions themselves.
  40  */
  41 
  42 typedef Flag::Error (*CommandLineFlagConstraintFunc_bool)(bool value, bool verbose);
  43 typedef Flag::Error (*CommandLineFlagConstraintFunc_int)(int value, bool verbose);
  44 typedef Flag::Error (*CommandLineFlagConstraintFunc_intx)(intx value, bool verbose);
  45 typedef Flag::Error (*CommandLineFlagConstraintFunc_uint)(uint value, bool verbose);
  46 typedef Flag::Error (*CommandLineFlagConstraintFunc_uintx)(uintx value, bool verbose);
  47 typedef Flag::Error (*CommandLineFlagConstraintFunc_uint64_t)(uint64_t value, bool verbose);
  48 typedef Flag::Error (*CommandLineFlagConstraintFunc_size_t)(size_t value, bool verbose);
  49 typedef Flag::Error (*CommandLineFlagConstraintFunc_double)(double value, bool verbose);
  50 
  51 class CommandLineFlagConstraint : public CHeapObj<mtInternal> {
  52 public:
  53   // During VM initialization, constraint validation will be done order of ConstraintType.
  54   enum ConstraintType {
  55     // Will be validated during argument processing (Arguments::parse_argument).
  56     AtParse         = 0,
  57     // Will be validated by CommandLineFlags::check_constraints_of_after_ergo().
  58     AfterErgo      = 1,
  59     // Will be validated by CommandLineFlags::check_constraints_of_after_memory_init().
  60     AfterMemoryInit = 2
  61   };
  62 
  63 private:
  64   const char* _name;
  65   ConstraintType _validate_type;
  66 
  67 public:
  68   // the "name" argument must be a string literal
  69   CommandLineFlagConstraint(const char* name, ConstraintType type) { _name=name; _validate_type=type; };
  70   ~CommandLineFlagConstraint() {};
  71   const char* name() const { return _name; }
  72   ConstraintType type() const { return _validate_type; }
  73   virtual Flag::Error apply_bool(bool value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  74   virtual Flag::Error apply_int(int value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  75   virtual Flag::Error apply_intx(intx value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  76   virtual Flag::Error apply_uint(uint value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  77   virtual Flag::Error apply_uintx(uintx value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  78   virtual Flag::Error apply_uint64_t(uint64_t value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  79   virtual Flag::Error apply_size_t(size_t value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };


  37  * See runtime "runtime/commandLineFlagConstraintsCompiler.hpp",
  38  * "runtime/commandLineFlagConstraintsGC.hpp" and
  39  * "runtime/commandLineFlagConstraintsRuntime.hpp" for the functions themselves.
  40  */
  41 
  42 typedef Flag::Error (*CommandLineFlagConstraintFunc_bool)(bool value, bool verbose);
  43 typedef Flag::Error (*CommandLineFlagConstraintFunc_int)(int value, bool verbose);
  44 typedef Flag::Error (*CommandLineFlagConstraintFunc_intx)(intx value, bool verbose);
  45 typedef Flag::Error (*CommandLineFlagConstraintFunc_uint)(uint value, bool verbose);
  46 typedef Flag::Error (*CommandLineFlagConstraintFunc_uintx)(uintx value, bool verbose);
  47 typedef Flag::Error (*CommandLineFlagConstraintFunc_uint64_t)(uint64_t value, bool verbose);
  48 typedef Flag::Error (*CommandLineFlagConstraintFunc_size_t)(size_t value, bool verbose);
  49 typedef Flag::Error (*CommandLineFlagConstraintFunc_double)(double value, bool verbose);
  50 
  51 class CommandLineFlagConstraint : public CHeapObj<mtInternal> {
  52 public:
  53   // During VM initialization, constraint validation will be done order of ConstraintType.
  54   enum ConstraintType {
  55     // Will be validated during argument processing (Arguments::parse_argument).
  56     AtParse         = 0,
  57     // Will be validated by CommandLineFlagConstraintList::check_constraints(AfterErgo).
  58     AfterErgo       = 1,
  59     // Will be validated by CommandLineFlagConstraintList::check_constraints(AfterMemoryInit).
  60     AfterMemoryInit = 2
  61   };
  62 
  63 private:
  64   const char* _name;
  65   ConstraintType _validate_type;
  66 
  67 public:
  68   // the "name" argument must be a string literal
  69   CommandLineFlagConstraint(const char* name, ConstraintType type) { _name=name; _validate_type=type; };
  70   ~CommandLineFlagConstraint() {};
  71   const char* name() const { return _name; }
  72   ConstraintType type() const { return _validate_type; }
  73   virtual Flag::Error apply_bool(bool value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  74   virtual Flag::Error apply_int(int value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  75   virtual Flag::Error apply_intx(intx value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  76   virtual Flag::Error apply_uint(uint value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  77   virtual Flag::Error apply_uintx(uintx value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  78   virtual Flag::Error apply_uint64_t(uint64_t value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
  79   virtual Flag::Error apply_size_t(size_t value, bool verbose = true) { ShouldNotReachHere(); return Flag::ERR_OTHER; };
< prev index next >