6716441: error in meet with +DoEscapeAnalysis

Set instance_id to InstanceBot for InstPtr->meet(AryPtr) when types are not related.

Reviewed-by: jrose, never
This commit is contained in:
Vladimir Kozlov 2008-06-26 13:34:00 -07:00
parent 873da1efe8
commit 4213e62fb7
11 changed files with 1088 additions and 139 deletions

View file

@ -91,7 +91,7 @@ extern void print_alias_types();
Node *MemNode::optimize_simple_memory_chain(Node *mchain, const TypePtr *t_adr, PhaseGVN *phase) {
const TypeOopPtr *tinst = t_adr->isa_oopptr();
if (tinst == NULL || !tinst->is_instance_field())
if (tinst == NULL || !tinst->is_known_instance_field())
return mchain; // don't try to optimize non-instance types
uint instance_id = tinst->instance_id();
Node *prev = NULL;
@ -125,7 +125,7 @@ Node *MemNode::optimize_simple_memory_chain(Node *mchain, const TypePtr *t_adr,
Node *MemNode::optimize_memory_chain(Node *mchain, const TypePtr *t_adr, PhaseGVN *phase) {
const TypeOopPtr *t_oop = t_adr->isa_oopptr();
bool is_instance = (t_oop != NULL) && t_oop->is_instance_field();
bool is_instance = (t_oop != NULL) && t_oop->is_known_instance_field();
PhaseIterGVN *igvn = phase->is_IterGVN();
Node *result = mchain;
result = optimize_simple_memory_chain(result, t_adr, phase);
@ -134,8 +134,8 @@ Node *MemNode::optimize_memory_chain(Node *mchain, const TypePtr *t_adr, PhaseGV
assert(mphi->bottom_type() == Type::MEMORY, "memory phi required");
const TypePtr *t = mphi->adr_type();
if (t == TypePtr::BOTTOM || t == TypeRawPtr::BOTTOM ||
t->isa_oopptr() && !t->is_oopptr()->is_instance() &&
t->is_oopptr()->cast_to_instance(t_oop->instance_id()) == t_oop) {
t->isa_oopptr() && !t->is_oopptr()->is_known_instance() &&
t->is_oopptr()->cast_to_instance_id(t_oop->instance_id()) == t_oop) {
// clone the Phi with our address type
result = mphi->split_out_instance(t_adr, igvn);
} else {
@ -470,7 +470,7 @@ Node* MemNode::find_previous_store(PhaseTransform* phase) {
return mem; // let caller handle steps (c), (d)
}
} else if (addr_t != NULL && addr_t->is_instance_field()) {
} else if (addr_t != NULL && addr_t->is_known_instance_field()) {
// Can't use optimize_simple_memory_chain() since it needs PhaseGVN.
if (mem->is_Proj() && mem->in(0)->is_Call()) {
CallNode *call = mem->in(0)->as_Call();
@ -916,7 +916,7 @@ bool LoadNode::is_instance_field_load_with_local_phi(Node* ctrl) {
in(MemNode::Address)->is_AddP() ) {
const TypeOopPtr* t_oop = in(MemNode::Address)->bottom_type()->isa_oopptr();
// Only instances.
if( t_oop != NULL && t_oop->is_instance_field() &&
if( t_oop != NULL && t_oop->is_known_instance_field() &&
t_oop->offset() != Type::OffsetBot &&
t_oop->offset() != Type::OffsetTop) {
return true;
@ -1139,7 +1139,7 @@ Node *LoadNode::split_through_phi(PhaseGVN *phase) {
const TypeOopPtr *t_oop = addr_t->isa_oopptr();
assert(mem->is_Phi() && (t_oop != NULL) &&
t_oop->is_instance_field(), "invalide conditions");
t_oop->is_known_instance_field(), "invalide conditions");
Node *region = mem->in(0);
if (region == NULL) {
@ -1307,7 +1307,7 @@ Node *LoadNode::Ideal(PhaseGVN *phase, bool can_reshape) {
}
const TypeOopPtr *t_oop = addr_t->isa_oopptr();
if (can_reshape && opt_mem->is_Phi() &&
(t_oop != NULL) && t_oop->is_instance_field()) {
(t_oop != NULL) && t_oop->is_known_instance_field()) {
// Split instance field load through Phi.
Node* result = split_through_phi(phase);
if (result != NULL) return result;
@ -1542,7 +1542,7 @@ const Type *LoadNode::Value( PhaseTransform *phase ) const {
}
const TypeOopPtr *tinst = tp->isa_oopptr();
if (tinst != NULL && tinst->is_instance_field()) {
if (tinst != NULL && tinst->is_known_instance_field()) {
// If we have an instance type and our memory input is the
// programs's initial memory state, there is no matching store,
// so just return a zero of the appropriate type
@ -2137,7 +2137,7 @@ bool StoreNode::value_never_loaded( PhaseTransform *phase) const {
const TypeOopPtr *adr_oop = phase->type(adr)->isa_oopptr();
if (adr_oop == NULL)
return false;
if (!adr_oop->is_instance_field())
if (!adr_oop->is_known_instance_field())
return false; // if not a distinct instance, there may be aliases of the address
for (DUIterator_Fast imax, i = adr->fast_outs(imax); i < imax; i++) {
Node *use = adr->fast_out(i);