src/share/vm/runtime/globals.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/runtime/globals.cpp Thu Jun 25 10:07:02 2015
--- new/src/share/vm/runtime/globals.cpp Thu Jun 25 10:07:02 2015
*** 721,730 ****
--- 721,744 ----
static Flag* address_of_flag(CommandLineFlagWithType flag) {
assert((size_t)flag < Flag::numFlags, "bad command line flag index");
return &Flag::flags[flag];
}
+ const char* Flag::flag_error_str(Flag::Error error) {
+ switch (error) {
+ case Flag::MISSING_NAME: return "MISSING_NAME";
+ case Flag::MISSING_VALUE: return "MISSING_VALUE";
+ case Flag::NON_WRITABLE: return "NON_WRITABLE";
+ case Flag::OUT_OF_BOUNDS: return "OUT_OF_BOUNDS";
+ case Flag::VIOLATES_CONSTRAINT: return "VIOLATES_CONSTRAINT";
+ case Flag::INVALID_FLAG: return "INVALID_FLAG";
+ case Flag::ERR_OTHER: return "ERR_OTHER";
+ case Flag::SUCCESS: return "SUCCESS";
+ default: return "NULL";
+ }
+ }
+
bool CommandLineFlagsEx::is_default(CommandLineFlag flag) {
assert((size_t)flag < Flag::numFlags, "bad command line flag index");
Flag* f = &Flag::flags[flag];
return f->is_default();
}
*** 756,775 ****
--- 770,779 ----
e.set_new_value(new_value);
e.set_origin(origin);
e.commit();
}
static Flag::Error get_status_error(Flag::Error status_range, Flag::Error status_constraint) {
if (status_range != Flag::SUCCESS) {
return status_range;
} else if (status_constraint != Flag::SUCCESS) {
return status_constraint;
} else {
return Flag::SUCCESS;
}
}
static Flag::Error apply_constraint_and_check_range_bool(const char* name, bool* new_value, bool verbose = true) {
Flag::Error status = Flag::SUCCESS;
CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
if (constraint != NULL) {
status = constraint->apply_bool(new_value, verbose);
*** 809,829 ****
--- 813,834 ----
faddr->set_origin(origin);
return Flag::SUCCESS;
}
static Flag::Error apply_constraint_and_check_range_int(const char* name, int* new_value, bool verbose = true) {
- Flag::Error range_status = Flag::SUCCESS;
CommandLineFlagRange* range = CommandLineFlagRangeList::find(name);
if (range != NULL) {
- range_status = range->check_int(*new_value, verbose);
}
Flag::Error constraint_status = Flag::SUCCESS;
+ if (status == Flag::SUCCESS) {
CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
if (constraint != NULL) {
! constraint_status = constraint->apply_int(new_value, verbose);
! status = constraint->apply_int(new_value, verbose);
+ }
}
! return get_status_error(range_status, constraint_status);
}
Flag::Error CommandLineFlags::intAt(const char* name, size_t len, int* value, bool allow_locked, bool return_flag) {
Flag* result = Flag::find_flag(name, len, allow_locked, return_flag);
if (result == NULL) return Flag::INVALID_FLAG;
*** 854,874 ****
--- 859,880 ----
faddr->set_origin(origin);
return Flag::SUCCESS;
}
static Flag::Error apply_constraint_and_check_range_uint(const char* name, uint* new_value, bool verbose = true) {
- Flag::Error range_status = Flag::SUCCESS;
CommandLineFlagRange* range = CommandLineFlagRangeList::find(name);
if (range != NULL) {
- range_status = range->check_uint(*new_value, verbose);
}
Flag::Error constraint_status = Flag::SUCCESS;
+ if (status == Flag::SUCCESS) {
CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
if (constraint != NULL) {
! constraint_status = constraint->apply_uint(new_value, verbose);
! status = constraint->apply_uint(new_value, verbose);
}
return get_status_error(range_status, constraint_status);
+ }
+ return status;
}
Flag::Error CommandLineFlags::uintAt(const char* name, size_t len, uint* value, bool allow_locked, bool return_flag) {
Flag* result = Flag::find_flag(name, len, allow_locked, return_flag);
if (result == NULL) return Flag::INVALID_FLAG;
*** 907,927 ****
--- 913,934 ----
*value = result->get_intx();
return Flag::SUCCESS;
}
static Flag::Error apply_constraint_and_check_range_intx(const char* name, intx* new_value, bool verbose = true) {
- Flag::Error range_status = Flag::SUCCESS;
CommandLineFlagRange* range = CommandLineFlagRangeList::find(name);
if (range != NULL) {
- range_status = range->check_intx(*new_value, verbose);
}
Flag::Error constraint_status = Flag::SUCCESS;
+ if (status == Flag::SUCCESS) {
CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
if (constraint != NULL) {
! constraint_status = constraint->apply_intx(new_value, verbose);
! status = constraint->apply_intx(new_value, verbose);
}
return get_status_error(range_status, constraint_status);
+ }
+ return status;
}
Flag::Error CommandLineFlags::intxAtPut(const char* name, size_t len, intx* value, Flag::Flags origin) {
Flag* result = Flag::find_flag(name, len);
if (result == NULL) return Flag::INVALID_FLAG;
*** 954,974 ****
--- 961,982 ----
*value = result->get_uintx();
return Flag::SUCCESS;
}
static Flag::Error apply_constraint_and_check_range_uintx(const char* name, uintx* new_value, bool verbose = true) {
- Flag::Error range_status = Flag::SUCCESS;
CommandLineFlagRange* range = CommandLineFlagRangeList::find(name);
if (range != NULL) {
- range_status = range->check_uintx(*new_value, verbose);
}
Flag::Error constraint_status = Flag::SUCCESS;
+ if (status == Flag::SUCCESS) {
CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
if (constraint != NULL) {
! constraint_status = constraint->apply_uintx(new_value, verbose);
! status = constraint->apply_uintx(new_value, verbose);
+ }
}
! return get_status_error(range_status, constraint_status);
}
Flag::Error CommandLineFlags::uintxAtPut(const char* name, size_t len, uintx* value, Flag::Flags origin) {
Flag* result = Flag::find_flag(name, len);
if (result == NULL) return Flag::INVALID_FLAG;
*** 1001,1021 ****
--- 1009,1030 ----
*value = result->get_uint64_t();
return Flag::SUCCESS;
}
static Flag::Error apply_constraint_and_check_range_uint64_t(const char* name, uint64_t* new_value, bool verbose = true) {
- Flag::Error range_status = Flag::SUCCESS;
CommandLineFlagRange* range = CommandLineFlagRangeList::find(name);
if (range != NULL) {
- range_status = range->check_uint64_t(*new_value, verbose);
}
Flag::Error constraint_status = Flag::SUCCESS;
+ if (status == Flag::SUCCESS) {
CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
if (constraint != NULL) {
! constraint_status = constraint->apply_uint64_t(new_value, verbose);
! status = constraint->apply_uint64_t(new_value, verbose);
+ }
}
! return get_status_error(range_status, constraint_status);
}
Flag::Error CommandLineFlags::uint64_tAtPut(const char* name, size_t len, uint64_t* value, Flag::Flags origin) {
Flag* result = Flag::find_flag(name, len);
if (result == NULL) return Flag::INVALID_FLAG;
*** 1048,1068 ****
--- 1057,1078 ----
*value = result->get_size_t();
return Flag::SUCCESS;
}
static Flag::Error apply_constraint_and_check_range_size_t(const char* name, size_t* new_value, bool verbose = true) {
- Flag::Error range_status = Flag::SUCCESS;
CommandLineFlagRange* range = CommandLineFlagRangeList::find(name);
if (range != NULL) {
- range_status = range->check_size_t(*new_value, verbose);
}
Flag::Error constraint_status = Flag::SUCCESS;
+ if (status == Flag::SUCCESS) {
CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
if (constraint != NULL) {
! constraint_status = constraint->apply_size_t(new_value, verbose);
! status = constraint->apply_size_t(new_value, verbose);
}
return get_status_error(range_status, constraint_status);
+ }
+ return status;
}
Flag::Error CommandLineFlags::size_tAtPut(const char* name, size_t len, size_t* value, Flag::Flags origin) {
Flag* result = Flag::find_flag(name, len);
if (result == NULL) return Flag::INVALID_FLAG;
*** 1095,1115 ****
--- 1105,1126 ----
*value = result->get_double();
return Flag::SUCCESS;
}
static Flag::Error apply_constraint_and_check_range_double(const char* name, double* new_value, bool verbose = true) {
- Flag::Error range_status = Flag::SUCCESS;
CommandLineFlagRange* range = CommandLineFlagRangeList::find(name);
if (range != NULL) {
- range_status = range->check_double(*new_value, verbose);
}
Flag::Error constraint_status = Flag::SUCCESS;
+ if (status == Flag::SUCCESS) {
CommandLineFlagConstraint* constraint = CommandLineFlagConstraintList::find(name);
if (constraint != NULL) {
! constraint_status = constraint->apply_double(new_value, verbose);
! status = constraint->apply_double(new_value, verbose);
+ }
}
! return get_status_error(range_status, constraint_status);
}
Flag::Error CommandLineFlags::doubleAtPut(const char* name, size_t len, double* value, Flag::Flags origin) {
Flag* result = Flag::find_flag(name, len);
if (result == NULL) return Flag::INVALID_FLAG;
src/share/vm/runtime/globals.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File