# HG changeset patch # User kvn # Date 1235093933 28800 # Node ID 49a36a80b0c72bed3bd4c925f9a16462b78abd1d # Parent 5d75ab5f66982c0a592cadc485228155d6bb7656 6802499: EA: assert(false,"unknown node on this path") Summary: Add missing checks for SCMemProj node in Escape analysis code. Reviewed-by: never diff -r 5d75ab5f6698 -r 49a36a80b0c7 src/share/vm/opto/escape.cpp --- a/src/share/vm/opto/escape.cpp Wed Feb 18 13:53:42 2009 -0800 +++ b/src/share/vm/opto/escape.cpp Thu Feb 19 17:38:53 2009 -0800 @@ -756,6 +756,16 @@ } else { break; } + } else if (result->Opcode() == Op_SCMemProj) { + assert(result->in(0)->is_LoadStore(), "sanity"); + const Type *at = phase->type(result->in(0)->in(MemNode::Address)); + if (at != Type::TOP) { + assert (at->isa_ptr() != NULL, "pointer type required."); + int idx = C->get_alias_index(at->is_ptr()); + assert(idx != alias_idx, "Object is not scalar replaceable if a LoadStore node access its field"); + break; + } + result = result->in(0)->in(MemNode::Memory); } } if (result->is_Phi()) { diff -r 5d75ab5f6698 -r 49a36a80b0c7 src/share/vm/opto/macro.cpp --- a/src/share/vm/opto/macro.cpp Wed Feb 18 13:53:42 2009 -0800 +++ b/src/share/vm/opto/macro.cpp Thu Feb 19 17:38:53 2009 -0800 @@ -250,6 +250,15 @@ assert(adr_idx == Compile::AliasIdxRaw, "address must match or be raw"); } mem = mem->in(MemNode::Memory); + } else if (mem->Opcode() == Op_SCMemProj) { + assert(mem->in(0)->is_LoadStore(), "sanity"); + const TypePtr* atype = mem->in(0)->in(MemNode::Address)->bottom_type()->is_ptr(); + int adr_idx = Compile::current()->get_alias_index(atype); + if (adr_idx == alias_idx) { + assert(false, "Object is not scalar replaceable if a LoadStore node access its field"); + return NULL; + } + mem = mem->in(0)->in(MemNode::Memory); } else { return mem; } @@ -329,8 +338,15 @@ return NULL; } values.at_put(j, val); + } else if (val->Opcode() == Op_SCMemProj) { + assert(val->in(0)->is_LoadStore(), "sanity"); + assert(false, "Object is not scalar replaceable if a LoadStore node access its field"); + return NULL; } else { +#ifdef ASSERT + val->dump(); assert(false, "unknown node on this path"); +#endif return NULL; // unknown node on this path } }