8220198: Lots of com/sun/crypto/provider/Cipher tests fail on x86_32 due to missing SHA512 stubs
authorshade
Wed, 27 Mar 2019 11:35:28 +0100
changeset 54303 3022f7d70897
parent 54302 0a2d73e02076
child 54304 78f88c4423a4
8220198: Lots of com/sun/crypto/provider/Cipher tests fail on x86_32 due to missing SHA512 stubs Reviewed-by: kvn, thartmann
src/hotspot/cpu/x86/vm_version_x86.cpp
src/hotspot/share/opto/graphKit.cpp
src/hotspot/share/opto/library_call.cpp
--- a/src/hotspot/cpu/x86/vm_version_x86.cpp	Wed Mar 27 10:38:49 2019 +0100
+++ b/src/hotspot/cpu/x86/vm_version_x86.cpp	Wed Mar 27 11:35:28 2019 +0100
@@ -901,11 +901,15 @@
     FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
   }
 
+#ifdef _LP64
+  // These are only supported on 64-bit
   if (UseSHA && supports_avx2() && supports_bmi2()) {
     if (FLAG_IS_DEFAULT(UseSHA512Intrinsics)) {
       FLAG_SET_DEFAULT(UseSHA512Intrinsics, true);
     }
-  } else if (UseSHA512Intrinsics) {
+  } else
+#endif
+  if (UseSHA512Intrinsics) {
     warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU.");
     FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
   }
--- a/src/hotspot/share/opto/graphKit.cpp	Wed Mar 27 10:38:49 2019 +0100
+++ b/src/hotspot/share/opto/graphKit.cpp	Wed Mar 27 11:35:28 2019 +0100
@@ -2450,6 +2450,8 @@
                                   Node* parm2, Node* parm3,
                                   Node* parm4, Node* parm5,
                                   Node* parm6, Node* parm7) {
+  assert(call_addr != NULL, "must not call NULL targets");
+
   // Slow-path call
   bool is_leaf = !(flags & RC_NO_LEAF);
   bool has_io  = (!is_leaf && !(flags & RC_NO_IO));
--- a/src/hotspot/share/opto/library_call.cpp	Wed Mar 27 10:38:49 2019 +0100
+++ b/src/hotspot/share/opto/library_call.cpp	Wed Mar 27 11:35:28 2019 +0100
@@ -6353,6 +6353,9 @@
   }
   if (state == NULL) return false;
 
+  assert(stubAddr != NULL, "Stub is generated");
+  if (stubAddr == NULL) return false;
+
   // Call the stub.
   Node* call = make_runtime_call(RC_LEAF|RC_NO_FP, OptoRuntime::sha_implCompress_Type(),
                                  stubAddr, stubName, TypePtr::BOTTOM,
@@ -6425,6 +6428,9 @@
     fatal("unknown SHA intrinsic predicate: %d", predicate);
   }
   if (klass_SHA_name != NULL) {
+    assert(stub_addr != NULL, "Stub is generated");
+    if (stub_addr == NULL) return false;
+
     // get DigestBase klass to lookup for SHA klass
     const TypeInstPtr* tinst = _gvn.type(digestBase_obj)->isa_instptr();
     assert(tinst != NULL, "digestBase_obj is not instance???");