8221408: Windows 32bit build build errors/warnings in hotspot
authorstuefe
Fri, 29 Mar 2019 08:36:33 +0100
changeset 54335 d9f6d16299b1
parent 54334 f1548abd4ae0
child 54336 a335a4ddc631
8221408: Windows 32bit build build errors/warnings in hotspot Reviewed-by: kbarrett, dholmes
src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp
src/hotspot/share/classfile/classFileParser.cpp
src/hotspot/share/oops/markOop.hpp
--- a/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp	Thu Mar 28 20:45:40 2019 -0700
+++ b/src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp	Fri Mar 29 08:36:33 2019 +0100
@@ -465,6 +465,9 @@
 }
 
 #ifndef AMD64
+// Ignore "C4172: returning address of local variable or temporary" on 32bit
+PRAGMA_DIAG_PUSH
+PRAGMA_DISABLE_MSVC_WARNING(4172)
 // Returns an estimate of the current stack pointer. Result must be guaranteed
 // to point into the calling threads stack, and be no lower than the current
 // stack pointer.
@@ -473,6 +476,7 @@
   address sp = (address)&dummy;
   return sp;
 }
+PRAGMA_DIAG_POP
 #else
 // Returns the current stack pointer. Accurate value needed for
 // os::verify_stack_alignment().
--- a/src/hotspot/share/classfile/classFileParser.cpp	Thu Mar 28 20:45:40 2019 -0700
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Fri Mar 29 08:36:33 2019 +0100
@@ -312,7 +312,7 @@
           const char* const str = java_lang_String::as_utf8_string(patch());
           // (could use java_lang_String::as_symbol instead, but might as well batch them)
           utf8_buffer = (const u1*) str;
-          utf8_length = (int) strlen(str);
+          utf8_length = (u2) strlen(str);
         }
 
         unsigned int hash;
--- a/src/hotspot/share/oops/markOop.hpp	Thu Mar 28 20:45:40 2019 -0700
+++ b/src/hotspot/share/oops/markOop.hpp	Fri Mar 29 08:36:33 2019 +0100
@@ -138,23 +138,15 @@
          epoch_mask_in_place      = epoch_mask << epoch_shift,
          cms_mask                 = right_n_bits(cms_bits),
          cms_mask_in_place        = cms_mask << cms_shift
-#ifndef _WIN64
-         ,hash_mask               = right_n_bits(hash_bits),
-         hash_mask_in_place       = (address_word)hash_mask << hash_shift
-#endif
   };
 
+  const static uintptr_t hash_mask = right_n_bits(hash_bits);
+  const static uintptr_t hash_mask_in_place = hash_mask << hash_shift;
+
   // Alignment of JavaThread pointers encoded in object header required by biased locking
   enum { biased_lock_alignment    = 2 << (epoch_shift + epoch_bits)
   };
 
-#ifdef _WIN64
-    // These values are too big for Win64
-    const static uintptr_t hash_mask = right_n_bits(hash_bits);
-    const static uintptr_t hash_mask_in_place  =
-                            (address_word)hash_mask << hash_shift;
-#endif
-
   enum { locked_value             = 0,
          unlocked_value           = 1,
          monitor_value            = 2,