提交 88dff4bd 编写于 作者: S sgehwolf

8244548: JDK 8u: sun.misc.Version.jdkUpdateVersion() returns wrong result

Reviewed-by: aph, andrew
上级 ea9c7952
......@@ -1628,9 +1628,9 @@ typedef struct {
} jvm_version_info;
#define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)
#define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16)
#define JVM_VERSION_MINOR(version) ((version & 0x00FFFF00) >> 8)
// Micro version is 0 in HotSpot Express VM (set in jvm.cpp).
#define JVM_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8)
#define JVM_VERSION_MICRO(version) 0
/* Build number is available in all HotSpot Express VM builds.
* It is defined in make/hotspot_version file.
*/
......@@ -1643,9 +1643,9 @@ typedef struct {
// Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx
unsigned int jdk_version; /* Consists of major, minor, micro (n.n.n) */
/* and build number (xx) */
unsigned int update_version : 8; /* Update release version (uu) */
unsigned int update_version : 16; /* Update release version (uu) */
unsigned int special_update_version : 8; /* Special update release version (c)*/
unsigned int reserved1 : 16;
unsigned int reserved1 : 8;
unsigned int reserved2;
/* The following bits represents new JDK supports that VM has dependency on.
......
......@@ -85,7 +85,7 @@ class JDK_Version VALUE_OBJ_CLASS_SPEC {
uint8_t _major;
uint8_t _minor;
uint8_t _micro;
uint8_t _update;
uint16_t _update;
uint8_t _special;
uint8_t _build;
......@@ -121,7 +121,7 @@ class JDK_Version VALUE_OBJ_CLASS_SPEC {
_pending_list_uses_discovered_field(false) {}
JDK_Version(uint8_t major, uint8_t minor = 0, uint8_t micro = 0,
uint8_t update = 0, uint8_t special = 0, uint8_t build = 0,
uint16_t update = 0, uint8_t special = 0, uint8_t build = 0,
bool thread_park_blocker = false, bool post_vm_init_hook_enabled = false,
bool pending_list_uses_discovered_field = false) :
_major(major), _minor(minor), _micro(micro), _update(update),
......@@ -145,7 +145,7 @@ class JDK_Version VALUE_OBJ_CLASS_SPEC {
uint8_t major_version() const { return _major; }
uint8_t minor_version() const { return _minor; }
uint8_t micro_version() const { return _micro; }
uint8_t update_version() const { return _update; }
uint16_t update_version() const { return _update; }
uint8_t special_update_version() const { return _special; }
uint8_t build_number() const { return _build; }
......
......@@ -283,7 +283,7 @@ const char *Abstract_VM_Version::vm_build_user() {
unsigned int Abstract_VM_Version::jvm_version() {
return ((Abstract_VM_Version::vm_major_version() & 0xFF) << 24) |
((Abstract_VM_Version::vm_minor_version() & 0xFF) << 16) |
((Abstract_VM_Version::vm_minor_version() & 0xFFFF) << 8) |
(Abstract_VM_Version::vm_build_number() & 0xFF);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册