From ba7da4eefb97c633995a97b257116576d41595e7 Mon Sep 17 00:00:00 2001 From: coleenp Date: Wed, 16 Feb 2011 11:34:44 -0500 Subject: [PATCH] 6840152: JVM crashes when heavyweight monitors are used Summary: Turn off biased locking if !UseFastLocking or UseHeavyMonitors options are requested. Reviewed-by: phh, never, dcubed, dholmes --- src/share/vm/runtime/arguments.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index 814e0df92..b4a48a63a 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -3103,6 +3103,19 @@ jint Arguments::parse(const JavaVMInitArgs* args) { // Set flags if Aggressive optimization flags (-XX:+AggressiveOpts) enabled. set_aggressive_opts_flags(); + // Turn off biased locking for locking debug mode flags, + // which are subtlely different from each other but neither works with + // biased locking. + if (!UseFastLocking || UseHeavyMonitors) { + if (!FLAG_IS_DEFAULT(UseBiasedLocking) && UseBiasedLocking) { + // flag set to true on command line; warn the user that they + // can't enable biased locking here + warning("Biased Locking is not supported with locking debug flags" + "; ignoring UseBiasedLocking flag." ); + } + UseBiasedLocking = false; + } + #ifdef CC_INTERP // Clear flags not supported by the C++ interpreter FLAG_SET_DEFAULT(ProfileInterpreter, false); -- GitLab