Skip to content

Commit 1b59595

Browse files
author
Vladimir Kozlov
committed
8255914: [AOT] Using AOT flag should give warning when AOT is not included in build
Reviewed-by: dholmes, iveresov
1 parent a50fdd5 commit 1b59595

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/hotspot/share/runtime/arguments.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3284,6 +3284,25 @@ jint Arguments::finalize_vm_init_args(bool patch_mod_javabase) {
32843284
}
32853285
#endif
32863286

3287+
#if !INCLUDE_AOT
3288+
UNSUPPORTED_OPTION(UseAOT);
3289+
UNSUPPORTED_OPTION(PrintAOT);
3290+
UNSUPPORTED_OPTION(UseAOTStrictLoading);
3291+
UNSUPPORTED_OPTION_NULL(AOTLibrary);
3292+
3293+
UNSUPPORTED_OPTION_INIT(Tier3AOTInvocationThreshold, 0);
3294+
UNSUPPORTED_OPTION_INIT(Tier3AOTMinInvocationThreshold, 0);
3295+
UNSUPPORTED_OPTION_INIT(Tier3AOTCompileThreshold, 0);
3296+
UNSUPPORTED_OPTION_INIT(Tier3AOTBackEdgeThreshold, 0);
3297+
UNSUPPORTED_OPTION_INIT(Tier0AOTInvocationThreshold, 0);
3298+
UNSUPPORTED_OPTION_INIT(Tier0AOTMinInvocationThreshold, 0);
3299+
UNSUPPORTED_OPTION_INIT(Tier0AOTCompileThreshold, 0);
3300+
UNSUPPORTED_OPTION_INIT(Tier0AOTBackEdgeThreshold, 0);
3301+
#ifndef PRODUCT
3302+
UNSUPPORTED_OPTION(PrintAOTStatistics);
3303+
#endif
3304+
#endif
3305+
32873306
#ifndef CAN_SHOW_REGISTERS_ON_ASSERT
32883307
UNSUPPORTED_OPTION(ShowRegistersOnAssert);
32893308
#endif // CAN_SHOW_REGISTERS_ON_ASSERT

src/hotspot/share/runtime/arguments.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,5 +684,14 @@ do { \
684684
} \
685685
} while(0)
686686

687+
// Initialize options not supported in this release, with a warning
688+
// if they were explicitly requested on the command-line
689+
#define UNSUPPORTED_OPTION_INIT(opt, value) \
690+
do { \
691+
if (FLAG_IS_CMDLINE(opt)) { \
692+
warning("-XX flag " #opt " not supported in this VM"); \
693+
} \
694+
FLAG_SET_DEFAULT(opt, value); \
695+
} while(0)
687696

688697
#endif // SHARE_RUNTIME_ARGUMENTS_HPP

0 commit comments

Comments
 (0)