提交 e907a998 编写于 作者: K kvn

6802499: EA: assert(false,"unknown node on this path")

Summary: Add missing checks for SCMemProj node in Escape analysis code.
Reviewed-by: never
上级 c4f76e46
...@@ -756,6 +756,16 @@ Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArra ...@@ -756,6 +756,16 @@ Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArra
} else { } else {
break; 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()) { if (result->is_Phi()) {
......
...@@ -250,6 +250,15 @@ static Node *scan_mem_chain(Node *mem, int alias_idx, int offset, Node *start_me ...@@ -250,6 +250,15 @@ static Node *scan_mem_chain(Node *mem, int alias_idx, int offset, Node *start_me
assert(adr_idx == Compile::AliasIdxRaw, "address must match or be raw"); assert(adr_idx == Compile::AliasIdxRaw, "address must match or be raw");
} }
mem = mem->in(MemNode::Memory); 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 { } else {
return mem; return mem;
} }
...@@ -329,8 +338,15 @@ Node *PhaseMacroExpand::value_from_mem_phi(Node *mem, BasicType ft, const Type * ...@@ -329,8 +338,15 @@ Node *PhaseMacroExpand::value_from_mem_phi(Node *mem, BasicType ft, const Type *
return NULL; return NULL;
} }
values.at_put(j, val); 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 { } else {
#ifdef ASSERT
val->dump();
assert(false, "unknown node on this path"); assert(false, "unknown node on this path");
#endif
return NULL; // unknown node on this path return NULL; // unknown node on this path
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册