diff --git a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index 7f5c4f814070d35d8a16cd783050abbc85b5c6f9..d79b6c90d27dd260efb0d44cc461e68f6bd7b6d0 100644 --- a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -2721,7 +2721,8 @@ nmethod *SharedRuntime::generate_dtrace_nmethod( #endif /* ASSERT */ VMRegPair zero; - zero.set2(G0->as_VMReg()); + const Register g0 = G0; // without this we get a compiler warning (why??) + zero.set2(g0->as_VMReg()); int c_arg, j_arg; diff --git a/src/share/vm/classfile/classFileParser.cpp b/src/share/vm/classfile/classFileParser.cpp index 580aa41ef0ccc4a29f7e0d5eaa287138eb9e50ee..6b0e2c90bcf6e0ad85b1997a95fb1ad8681886cb 100644 --- a/src/share/vm/classfile/classFileParser.cpp +++ b/src/share/vm/classfile/classFileParser.cpp @@ -44,6 +44,7 @@ // Used for backward compatibility reasons: // - to check for javac bug fixes that happened after 1.5 +// - also used as the max version when running in jdk6 #define JAVA_6_VERSION 50 @@ -3516,9 +3517,11 @@ bool ClassFileParser::has_illegal_visibility(jint flags) { } bool ClassFileParser::is_supported_version(u2 major, u2 minor) { + u2 max_version = JDK_Version::is_gte_jdk17x_version() ? + JAVA_MAX_SUPPORTED_VERSION : JAVA_6_VERSION; return (major >= JAVA_MIN_SUPPORTED_VERSION) && - (major <= JAVA_MAX_SUPPORTED_VERSION) && - ((major != JAVA_MAX_SUPPORTED_VERSION) || + (major <= max_version) && + ((major != max_version) || (minor <= JAVA_MAX_SUPPORTED_MINOR_VERSION)); } diff --git a/src/share/vm/runtime/java.hpp b/src/share/vm/runtime/java.hpp index e3ce6d419971e7daabd2c9b8eb309761655067b5..0946117a6aadc61b7f3062aa3cc752af86726d0a 100644 --- a/src/share/vm/runtime/java.hpp +++ b/src/share/vm/runtime/java.hpp @@ -68,8 +68,24 @@ class JDK_Version : AllStatic { static bool is_jdk13x_version() { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 3; } static bool is_jdk14x_version() { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 4; } static bool is_jdk15x_version() { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 5; } - static bool is_jdk16x_version() { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 6; } - static bool is_jdk17x_version() { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 7; } + + static bool is_jdk16x_version() { + if (is_jdk_version_initialized()) { + return _jdk_version == 6; + } else { + assert(is_pre_jdk16_version(), "must have been initialized"); + return false; + } + } + + static bool is_jdk17x_version() { + if (is_jdk_version_initialized()) { + return _jdk_version == 7; + } else { + assert(is_pre_jdk16_version(), "must have been initialized"); + return false; + } + } static bool supports_thread_park_blocker() { return _version_info.thread_park_blocker; } @@ -85,14 +101,22 @@ class JDK_Version : AllStatic { } static bool is_gte_jdk16x_version() { // Keep the semantics of this that the version number is >= 1.6 - assert(is_jdk_version_initialized(), "Not initialized"); - return _jdk_version >= 6; + if (is_jdk_version_initialized()) { + return _jdk_version >= 6; + } else { + assert(is_pre_jdk16_version(), "Not initialized"); + return false; + } } static bool is_gte_jdk17x_version() { // Keep the semantics of this that the version number is >= 1.7 - assert(is_jdk_version_initialized(), "Not initialized"); - return _jdk_version >= 7; + if (is_jdk_version_initialized()) { + return _jdk_version >= 7; + } else { + assert(is_pre_jdk16_version(), "Not initialized"); + return false; + } } static bool is_jdk_version_initialized() {