--- a/src/hotspot/share/opto/escape.cpp Fri Feb 08 09:33:59 2019 -0500
+++ b/src/hotspot/share/opto/escape.cpp Thu Feb 07 09:55:57 2019 +0100
@@ -3010,6 +3010,11 @@
n->raise_bottom_type(tinst);
igvn->hash_insert(n);
record_for_optimizer(n);
+ // Allocate an alias index for the header fields. Accesses to
+ // the header emitted during macro expansion wouldn't have
+ // correct memory state otherwise.
+ _compile->get_alias_index(tinst->add_offset(oopDesc::mark_offset_in_bytes()));
+ _compile->get_alias_index(tinst->add_offset(oopDesc::klass_offset_in_bytes()));
if (alloc->is_Allocate() && (t->isa_instptr() || t->isa_aryptr())) {
// First, put on the worklist all Field edges from Connection Graph