src/hotspot/share/opto/escape.cpp
changeset 53875 7a6fb8a48434
parent 53706 b5b373bda814
child 55394 b444bbe5c45c
child 58678 9cf78a70fa4f
--- a/src/hotspot/share/opto/escape.cpp	Thu Feb 21 09:21:21 2019 -0500
+++ b/src/hotspot/share/opto/escape.cpp	Mon Feb 18 17:41:31 2019 +0100
@@ -1726,6 +1726,18 @@
     // access its field since the field value is unknown after it.
     //
     Node* n = field->ideal_node();
+
+    // Test for an unsafe access that was parsed as maybe off heap
+    // (with a CheckCastPP to raw memory).
+    assert(n->is_AddP(), "expect an address computation");
+    if (n->in(AddPNode::Base)->is_top() &&
+        n->in(AddPNode::Address)->Opcode() == Op_CheckCastPP) {
+      assert(n->in(AddPNode::Address)->bottom_type()->isa_rawptr(), "raw address so raw cast expected");
+      assert(_igvn->type(n->in(AddPNode::Address)->in(1))->isa_oopptr(), "cast pattern at unsafe access expected");
+      jobj->set_scalar_replaceable(false);
+      return;
+    }
+
     for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
       Node* u = n->fast_out(i);
       if (u->is_LoadStore() || (u->is_Mem() && u->as_Mem()->is_mismatched_access())) {