changeset 52232:525467b9b615 lworld

8211993: [lworld] TestNativeClone fails with assert(!obj->is_ValueType()) failed: should not cast value type Reviewed-by: roland
author thartmann
date Mon, 15 Oct 2018 09:44:32 +0200
parents 10438ad636e9
children eec1ec6cd903
files src/hotspot/share/opto/callGenerator.cpp src/hotspot/share/opto/graphKit.cpp src/hotspot/share/opto/graphKit.hpp src/hotspot/share/opto/parse1.cpp
diffstat 4 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/opto/callGenerator.cpp	Fri Oct 12 09:02:08 2018 -0400
+++ b/src/hotspot/share/opto/callGenerator.cpp	Mon Oct 15 09:44:32 2018 +0200
@@ -162,11 +162,9 @@
   }
   _call_node = call;  // Save the call node in case we need it later
   if (!is_static) {
-    if (!kit.argument(0)->is_ValueType()) {
-      // Make an explicit receiver null_check as part of this call.
-      // Since we share a map with the caller, his JVMS gets adjusted.
-      kit.null_check_receiver_before_call(method());
-    }
+    // Make an explicit receiver null_check as part of this call.
+    // Since we share a map with the caller, his JVMS gets adjusted.
+    kit.null_check_receiver_before_call(method());
     if (kit.stopped()) {
       // And dump it back to the caller, decorated with any exceptions:
       return kit.transfer_exceptions_into_jvms();
--- a/src/hotspot/share/opto/graphKit.cpp	Fri Oct 12 09:02:08 2018 -0400
+++ b/src/hotspot/share/opto/graphKit.cpp	Mon Oct 15 09:44:32 2018 +0200
@@ -1398,7 +1398,9 @@
 //------------------------------cast_not_null----------------------------------
 // Cast obj to not-null on this path
 Node* GraphKit::cast_not_null(Node* obj, bool do_replace_in_map) {
-  assert(!obj->is_ValueType(), "should not cast value type");
+  if (obj->is_ValueType()) {
+    return obj;
+  }
   const Type *t = _gvn.type(obj);
   const Type *t_not_null = t->join_speculative(TypePtr::NOTNULL);
   // Object is already not-null?
--- a/src/hotspot/share/opto/graphKit.hpp	Fri Oct 12 09:02:08 2018 -0400
+++ b/src/hotspot/share/opto/graphKit.hpp	Mon Oct 15 09:44:32 2018 +0200
@@ -679,6 +679,9 @@
   // callee (with all arguments still on the stack).
   Node* null_check_receiver_before_call(ciMethod* callee) {
     assert(!callee->is_static(), "must be a virtual method");
+    if (argument(0)->is_ValueType()) {
+      return argument(0);
+    }
     // Callsite signature can be different from actual method being called (i.e _linkTo* sites).
     // Use callsite signature always.
     ciMethod* declared_method = method()->get_method_at_bci(bci());
--- a/src/hotspot/share/opto/parse1.cpp	Fri Oct 12 09:02:08 2018 -0400
+++ b/src/hotspot/share/opto/parse1.cpp	Mon Oct 15 09:44:32 2018 +0200
@@ -1215,9 +1215,7 @@
   // If this is an inlined method, we may have to do a receiver null check.
   if (_caller->has_method() && is_normal_parse() && !method()->is_static()) {
     GraphKit kit(_caller);
-    if (!kit.argument(0)->is_ValueType()) {
-      kit.null_check_receiver_before_call(method());
-    }
+    kit.null_check_receiver_before_call(method());
     _caller = kit.transfer_exceptions_into_jvms();
     if (kit.stopped()) {
       _exits.add_exception_states_from(_caller);