8292590: Product JVM crashes with FLAG_SET_XXX on non-product Flag

Reviewed-by: dholmes, coleenp
This commit is contained in:
Ioi Lam 2022-08-30 22:00:43 +00:00
parent 6335150cea
commit 1cf245d77c
2 changed files with 13 additions and 1 deletions

View File

@ -3880,11 +3880,13 @@ static void apply_debugger_ergo() {
}
#endif
#ifndef PRODUCT
if (UseDebuggerErgo) {
// Turn on sub-flags
FLAG_SET_ERGO_IF_DEFAULT(UseDebuggerErgo1, true);
FLAG_SET_ERGO_IF_DEFAULT(UseDebuggerErgo2, true);
}
#endif
if (UseDebuggerErgo2) {
// Debugging with limited number of CPUs

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -59,6 +59,15 @@ enum JVMFlagsEnum : int {
#define DEFINE_FLAG_MEMBER_SETTER(type, name, ...) FLAG_MEMBER_SETTER_(type, name)
#ifdef PRODUCT
ALL_FLAGS(IGNORE_FLAG, // develop : declared as const
IGNORE_FLAG, // develop-pd : declared as const
DEFINE_FLAG_MEMBER_SETTER,
DEFINE_FLAG_MEMBER_SETTER,
IGNORE_FLAG, // not-product : is not declared
IGNORE_RANGE,
IGNORE_CONSTRAINT)
#else
ALL_FLAGS(DEFINE_FLAG_MEMBER_SETTER,
DEFINE_FLAG_MEMBER_SETTER,
DEFINE_FLAG_MEMBER_SETTER,
@ -66,6 +75,7 @@ ALL_FLAGS(DEFINE_FLAG_MEMBER_SETTER,
DEFINE_FLAG_MEMBER_SETTER,
IGNORE_RANGE,
IGNORE_CONSTRAINT)
#endif
#define FLAG_IS_DEFAULT(name) (JVMFlag::is_default(FLAG_MEMBER_ENUM(name)))
#define FLAG_IS_ERGO(name) (JVMFlag::is_ergo(FLAG_MEMBER_ENUM(name)))