8213825: assert(false) failed: Non-balanced monitor enter/exit! Likely JNI locking
Summary: skip sfpt optimization for Load is removed for Java Object's Markword Load.
Reviewed-by: kvn, dlong
--- a/src/hotspot/share/opto/memnode.cpp Wed Jan 23 20:25:30 2019 -0800
+++ b/src/hotspot/share/opto/memnode.cpp Wed Jan 23 23:24:10 2019 -0800
@@ -1532,10 +1532,14 @@
Node* address = in(MemNode::Address);
bool progress = false;
+ bool addr_mark = ((phase->type(address)->isa_oopptr() || phase->type(address)->isa_narrowoop()) &&
+ phase->type(address)->is_ptr()->offset() == oopDesc::mark_offset_in_bytes());
+
// Skip up past a SafePoint control. Cannot do this for Stores because
// pointer stores & cardmarks must stay on the same side of a SafePoint.
if( ctrl != NULL && ctrl->Opcode() == Op_SafePoint &&
- phase->C->get_alias_index(phase->type(address)->is_ptr()) != Compile::AliasIdxRaw ) {
+ phase->C->get_alias_index(phase->type(address)->is_ptr()) != Compile::AliasIdxRaw &&
+ !addr_mark ) {
ctrl = ctrl->in(0);
set_req(MemNode::Control,ctrl);
progress = true;