--- a/src/hotspot/share/opto/compile.cpp Thu Nov 01 11:42:59 2018 -0400
+++ b/src/hotspot/share/opto/compile.cpp Wed Nov 07 20:21:35 2018 +0100
@@ -1468,6 +1468,8 @@
tj = TypeInstPtr::MARK;
ta = TypeAryPtr::RANGE; // generic ignored junk
ptr = TypePtr::BotPTR;
+ } else if (BarrierSet::barrier_set()->barrier_set_c2()->flatten_gc_alias_type(tj)) {
+ ta = tj->isa_aryptr();
} else { // Random constant offset into array body
offset = Type::OffsetBot; // Flatten constant access into array body
tj = ta = TypeAryPtr::make(ptr,ta->ary(),ta->klass(),false,offset);
@@ -1532,6 +1534,8 @@
if (!is_known_inst) { // Do it only for non-instance types
tj = to = TypeInstPtr::make(TypePtr::BotPTR, env()->Object_klass(), false, NULL, offset);
}
+ } else if (BarrierSet::barrier_set()->barrier_set_c2()->flatten_gc_alias_type(tj)) {
+ to = tj->is_instptr();
} else if (offset < 0 || offset >= k->size_helper() * wordSize) {
// Static fields are in the space above the normal instance
// fields in the java.lang.Class instance.
@@ -1630,7 +1634,8 @@
(offset == Type::OffsetBot && tj == TypePtr::BOTTOM) ||
(offset == oopDesc::mark_offset_in_bytes() && tj->base() == Type::AryPtr) ||
(offset == oopDesc::klass_offset_in_bytes() && tj->base() == Type::AryPtr) ||
- (offset == arrayOopDesc::length_offset_in_bytes() && tj->base() == Type::AryPtr) ,
+ (offset == arrayOopDesc::length_offset_in_bytes() && tj->base() == Type::AryPtr) ||
+ (BarrierSet::barrier_set()->barrier_set_c2()->verify_gc_alias_type(tj, offset)),
"For oops, klasses, raw offset must be constant; for arrays the offset is never known" );
assert( tj->ptr() != TypePtr::TopPTR &&
tj->ptr() != TypePtr::AnyNull &&