--- a/hotspot/src/share/vm/opto/macro.cpp Thu Jul 03 11:01:32 2008 -0700
+++ b/hotspot/src/share/vm/opto/macro.cpp Fri Jul 11 01:14:44 2008 -0700
@@ -320,9 +320,9 @@
// Search the last value stored into the object's field.
Node *PhaseMacroExpand::value_from_mem(Node *sfpt_mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc) {
- assert(adr_t->is_instance_field(), "instance required");
- uint instance_id = adr_t->instance_id();
- assert(instance_id == alloc->_idx, "wrong allocation");
+ assert(adr_t->is_known_instance_field(), "instance required");
+ int instance_id = adr_t->instance_id();
+ assert((uint)instance_id == alloc->_idx, "wrong allocation");
int alias_idx = C->get_alias_index(adr_t);
int offset = adr_t->offset();
@@ -354,7 +354,7 @@
const TypeOopPtr* atype = mem->as_Store()->adr_type()->isa_oopptr();
assert(atype != NULL, "address type must be oopptr");
assert(C->get_alias_index(atype) == alias_idx &&
- atype->is_instance_field() && atype->offset() == offset &&
+ atype->is_known_instance_field() && atype->offset() == offset &&
atype->instance_id() == instance_id, "store is correct memory slice");
done = true;
} else if (mem->is_Phi()) {
@@ -598,7 +598,7 @@
field_type = TypeOopPtr::make_from_klass(elem_type->as_klass());
}
if (UseCompressedOops) {
- field_type = field_type->is_oopptr()->make_narrowoop();
+ field_type = field_type->make_narrowoop();
basic_elem_type = T_NARROWOOP;
}
} else {
@@ -666,9 +666,11 @@
if (UseCompressedOops && field_type->isa_narrowoop()) {
// Enable "DecodeN(EncodeP(Allocate)) --> Allocate" transformation
// to be able scalar replace the allocation.
- _igvn.set_delay_transform(false);
- field_val = DecodeNNode::decode(&_igvn, field_val);
- _igvn.set_delay_transform(true);
+ if (field_val->is_EncodeP()) {
+ field_val = field_val->in(1);
+ } else {
+ field_val = transform_later(new (C, 2) DecodeNNode(field_val, field_val->bottom_type()->make_ptr()));
+ }
}
sfpt->add_req(field_val);
}
@@ -1674,7 +1676,14 @@
success = eliminate_locking_node(n->as_AbstractLock());
break;
default:
- assert(false, "unknown node type in macro list");
+ if (n->Opcode() == Op_Opaque1 || n->Opcode() == Op_Opaque2) {
+ _igvn.add_users_to_worklist(n);
+ _igvn.hash_delete(n);
+ _igvn.subsume_node(n, n->in(1));
+ success = true;
+ } else {
+ assert(false, "unknown node type in macro list");
+ }
}
assert(success == (C->macro_count() < old_macro_count), "elimination reduces macro count");
progress = progress || success;