RFR (XS/T) 8237847: Zero builds fail after JDK-8237637 (Remove dubious type conversions from oop)

Aleksey Shipilev shade at redhat.com
Sat Jan 25 09:46:59 UTC 2020


Bug:
  https://bugs.openjdk.java.net/browse/JDK-8237847

Seems like JDK-8237637 missed the spot there.

Fix:

diff -r d3cdf4b2b45b src/hotspot/share/interpreter/bytecodeInterpreter.cpp
--- a/src/hotspot/share/interpreter/bytecodeInterpreter.cpp     Fri Jan 24 21:57:19 2020 +0000
+++ b/src/hotspot/share/interpreter/bytecodeInterpreter.cpp     Sat Jan 25 10:18:22 2020 +0100
@@ -2171,11 +2171,11 @@
             }
 #endif
             if (result != NULL) {
               // Initialize object (if nonzero size and need) and then the header
               if (need_zero ) {
-                HeapWord* to_zero = (HeapWord*) result + sizeof(oopDesc) / oopSize;
+                HeapWord* to_zero = cast_from_oop<HeapWord*>(result) + sizeof(oopDesc) / oopSize;
                 obj_size -= sizeof(oopDesc) / oopSize;
                 if (obj_size > 0 ) {
                   memset(to_zero, 0, obj_size * HeapWordSize);
                 }
               }


Testing: Linux x86_64 zero {fastdebug,release} build

-- 
Thanks,
-Aleksey



More information about the hotspot-dev mailing list