RFR(S): 8207844: [lworld] Crash during method resolution because value type holder is not linked

John Rose john.r.rose at oracle.com
Thu Jul 19 20:39:53 UTC 2018


Fix is good, but seems a little more cut-n-pasty than I like.
Suggest a cleanup which pull all of the conditional logic,
plus the deopt, into emit_guard_for_new.

See below.

On Jul 19, 2018, at 4:29 AM, Tobias Hartmann <tobias.hartmann at oracle.com> wrote:
> 
> Hi,
> 
> please review the following patch:
> https://bugs.openjdk.java.net/browse/JDK-8207844
> http://cr.openjdk.java.net/~thartmann/8207844/webrev.00/

diff --git a/src/hotspot/share/opto/parseHelper.cpp b/src/hotspot/share/opto/parseHelper.cpp
--- a/src/hotspot/share/opto/parseHelper.cpp
+++ b/src/hotspot/share/opto/parseHelper.cpp
@@ -311,18 +311,8 @@
   assert(will_link, "_new: typeflow responsibility");
 
   // Should initialize, or throw an InstantiationError?
-  if ((!klass->is_initialized() && !klass->is_being_initialized()) ||
-      klass->is_abstract() || klass->is_interface() ||
-      klass->name() == ciSymbol::java_lang_Class() ||
-      iter().is_unresolved_klass()) {
-    uncommon_trap(Deoptimization::Reason_uninitialized,
-                  Deoptimization::Action_reinterpret,
-                  klass);
-    return;
-  }
-  if (klass->is_being_initialized()) {
-    emit_guard_for_new(klass);
-  }
+  emit_guard_for_new(klass);
+  if (stopped())  return;
 
   Node* kls = makecon(TypeKlassPtr::make(klass));
   Node* obj = new_instance(kls);
@@ -349,6 +339,11 @@
   bool will_link;
   ciValueKlass* vk = iter().get_klass(will_link)->as_value_klass();
   assert(will_link, "defaultvalue: typeflow responsibility");
+
+  // Should initialize, or throw an InstantiationError?
+  emit_guard_for_new(klass);
+  if (stopped())  return;
+
   // Create and push a new default ValueTypeNode
   push(ValueTypeNode::make_default(_gvn, vk));
 }



More information about the valhalla-dev mailing list