bool CommandLineFlags::boolAt(char* name, size_t len, bool* value) { Flag* result = Flag::find_flag(name, len); if (result == NULL) return false; if (!result->is_bool()) return false; *value = result->get_bool(); return true; }
// Implementation of "setflag" command static jint set_flag(AttachOperation* op, outputStream* out) { const char* name = NULL; if ((name = op->arg(0)) == NULL) { out->print_cr("flag name is missing"); return JNI_ERR; } Flag* f = Flag::find_flag((char*)name, strlen(name)); if (f && f->is_external() && f->is_writeable()) { if (f->is_bool()) { return set_bool_flag(name, op, out); } else if (f->is_intx()) { return set_intx_flag(name, op, out); } else if (f->is_uintx()) { return set_uintx_flag(name, op, out); } else if (f->is_uint64_t()) { return set_uint64_t_flag(name, op, out); } else if (f->is_ccstr()) { return set_ccstr_flag(name, op, out); } else { ShouldNotReachHere(); return JNI_ERR; } } else { return AttachListener::pd_set_flag(op, out); } }
Flag::Error CommandLineFlags::boolAt(const char* name, size_t len, bool* 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; if (!result->is_bool()) return Flag::WRONG_FORMAT; *value = result->get_bool(); return Flag::SUCCESS; }
void CommandLineFlagsEx::boolAtPut(CommandLineFlagWithType flag, bool value, Flag::Flags origin) { Flag* faddr = address_of_flag(flag); guarantee(faddr != NULL && faddr->is_bool(), "wrong flag type"); trace_flag_changed<EventBooleanFlagChanged, bool>(faddr->_name, faddr->get_bool(), value, origin); faddr->set_bool(value); faddr->set_origin(origin); }
bool CommandLineFlags::boolAtPut(char* name, size_t len, bool* value, FlagValueOrigin origin) { Flag* result = Flag::find_flag(name, len); if (result == NULL) return false; if (!result->is_bool()) return false; bool old_value = result->get_bool(); result->set_bool(*value); *value = old_value; result->origin = origin; return true; }
bool CommandLineFlags::boolAtPut(char* name, size_t len, bool* value, Flag::Flags origin) { Flag* result = Flag::find_flag(name, len); if (result == NULL) return false; if (!result->is_bool()) return false; bool old_value = result->get_bool(); trace_flag_changed<EventBooleanFlagChanged, bool>(name, old_value, *value, origin); result->set_bool(*value); *value = old_value; result->set_origin(origin); return true; }
void CommandLineFlagsEx::boolAtPut(CommandLineFlagWithType flag, bool value, FlagValueOrigin origin) { Flag* faddr = address_of_flag(flag); guarantee(faddr != NULL && faddr->is_bool(), "wrong flag type"); faddr->set_bool(value); faddr->origin = origin; }
Flag::Error CommandLineFlagsEx::boolAtPut(CommandLineFlagWithType flag, bool value, Flag::Flags origin) { Flag* faddr = address_of_flag(flag); guarantee(faddr != NULL && faddr->is_bool(), "wrong flag type"); return CommandLineFlags::boolAtPut(faddr, &value, origin); }