diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index 37258efd41bf167308d6c93b9c93df2ab864e03e..235a8e93d662ecdd97dcf343fd61276baf19de15 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -4056,6 +4056,16 @@ jint Arguments::apply_ergo() { set_shared_spaces_flags(); +#if defined(SPARC) + // BIS instructions require 'membar' instruction regardless of the number + // of CPUs because in virtualized/container environments which might use only 1 + // CPU, BIS instructions may produce incorrect results. + + if (FLAG_IS_DEFAULT(AssumeMP)) { + FLAG_SET_DEFAULT(AssumeMP, true); + } +#endif + // Check the GC selections again. if (!check_gc_consistency()) { return JNI_EINVAL;