< prev index next >
src/hotspot/share/opto/memnode.cpp
Print this page
*** 2256,2266 ****
// Return precise klass
return TypeKlassPtr::make(ik);
}
// Return root of possible klass
! return TypeKlassPtr::make(TypePtr::NotNull, ik, Type::Offset(0));
}
}
// Check for loading klass from an array
const TypeAryPtr *tary = tp->isa_aryptr();
--- 2256,2266 ----
// Return precise klass
return TypeKlassPtr::make(ik);
}
// Return root of possible klass
! return TypeKlassPtr::make(TypePtr::NotNull, ik, Type::Offset(0), tinst->flatten_array());
}
}
// Check for loading klass from an array
const TypeAryPtr *tary = tp->isa_aryptr();
*** 2291,2301 ****
}
// Return precise array klass
return TypeKlassPtr::make(ak);
}
}
! return TypeKlassPtr::make(TypePtr::NotNull, ak, Type::Offset(0));
} else if (ak->is_type_array_klass()) {
//assert(!UseExactTypes, "this code should be useless with exact types");
return TypeKlassPtr::make(ak); // These are always precise
}
}
--- 2291,2301 ----
}
// Return precise array klass
return TypeKlassPtr::make(ak);
}
}
! return TypeKlassPtr::make(TypePtr::NotNull, ak, Type::Offset(0), false);
} else if (ak->is_type_array_klass()) {
//assert(!UseExactTypes, "this code should be useless with exact types");
return TypeKlassPtr::make(ak); // These are always precise
}
}
*** 2315,2329 ****
// // e.g., element type could be object and array may contain strings
// return TypeKlassPtr::make(TypePtr::Constant, elem, 0);
// The array's TypeKlassPtr was declared 'precise' or 'not precise'
// according to the element type's subclassing.
! return TypeKlassPtr::make(tkls->ptr(), elem, Type::Offset(0));
} else if (klass->is_value_array_klass() &&
tkls->offset() == in_bytes(ObjArrayKlass::element_klass_offset())) {
ciKlass* elem = klass->as_value_array_klass()->element_klass();
! return TypeKlassPtr::make(tkls->ptr(), elem, Type::Offset(0));
}
if( klass->is_instance_klass() && tkls->klass_is_exact() &&
tkls->offset() == in_bytes(Klass::super_offset())) {
ciKlass* sup = klass->as_instance_klass()->super();
// The field is Klass::_super. Return its (constant) value.
--- 2315,2329 ----
// // e.g., element type could be object and array may contain strings
// return TypeKlassPtr::make(TypePtr::Constant, elem, 0);
// The array's TypeKlassPtr was declared 'precise' or 'not precise'
// according to the element type's subclassing.
! return TypeKlassPtr::make(tkls->ptr(), elem, Type::Offset(0), elem->flatten_array());
} else if (klass->is_value_array_klass() &&
tkls->offset() == in_bytes(ObjArrayKlass::element_klass_offset())) {
ciKlass* elem = klass->as_value_array_klass()->element_klass();
! return TypeKlassPtr::make(tkls->ptr(), elem, Type::Offset(0), true);
}
if( klass->is_instance_klass() && tkls->klass_is_exact() &&
tkls->offset() == in_bytes(Klass::super_offset())) {
ciKlass* sup = klass->as_instance_klass()->super();
// The field is Klass::_super. Return its (constant) value.
*** 2341,2351 ****
// Also feed through the klass in Allocate(...klass...)._klass.
Node* LoadKlassNode::Identity(PhaseGVN* phase) {
return klass_identity_common(phase);
}
! const Type* GetNullFreePropertyNode::Value(PhaseGVN* phase) const {
if (in(1) != NULL) {
const Type* in1_t = phase->type(in(1));
if (in1_t == Type::TOP) {
return Type::TOP;
}
--- 2341,2351 ----
// Also feed through the klass in Allocate(...klass...)._klass.
Node* LoadKlassNode::Identity(PhaseGVN* phase) {
return klass_identity_common(phase);
}
! const Type* GetStoragePropertyNode::Value(PhaseGVN* phase) const {
if (in(1) != NULL) {
const Type* in1_t = phase->type(in(1));
if (in1_t == Type::TOP) {
return Type::TOP;
}
*** 2353,2384 ****
ciArrayKlass* ak = tk->klass()->as_array_klass();
ciKlass* elem = ak->element_klass();
if (tk->klass_is_exact() || (!elem->is_java_lang_Object() && !elem->is_interface() && !elem->is_valuetype())) {
int props_shift = in1_t->isa_narrowklass() ? oopDesc::narrow_storage_props_shift : oopDesc::wide_storage_props_shift;
ArrayStorageProperties props = ak->storage_properties();
! intptr_t storage_properties = props.encode<intptr_t>(props_shift);
if (in1_t->isa_narrowklass()) {
return TypeInt::make((int)storage_properties);
}
return TypeX::make(storage_properties);
}
}
return bottom_type();
}
! Node* GetNullFreePropertyNode::Ideal(PhaseGVN *phase, bool can_reshape) {
if (!can_reshape) {
return NULL;
}
if (in(1) != NULL && in(1)->is_Phi()) {
Node* phi = in(1);
Node* r = phi->in(0);
Node* new_phi = new PhiNode(r, bottom_type());
for (uint i = 1; i < r->req(); i++) {
Node* in = phi->in(i);
if (in == NULL) continue;
! new_phi->init_req(i, phase->transform(new GetNullFreePropertyNode(in)));
}
return new_phi;
}
return NULL;
}
--- 2353,2390 ----
ciArrayKlass* ak = tk->klass()->as_array_klass();
ciKlass* elem = ak->element_klass();
if (tk->klass_is_exact() || (!elem->is_java_lang_Object() && !elem->is_interface() && !elem->is_valuetype())) {
int props_shift = in1_t->isa_narrowklass() ? oopDesc::narrow_storage_props_shift : oopDesc::wide_storage_props_shift;
ArrayStorageProperties props = ak->storage_properties();
! intptr_t storage_properties = 0;
! if ((Opcode() == Op_GetFlattenedProperty && props.is_flattened()) ||
! (Opcode() == Op_GetNullFreeProperty && props.is_null_free())){
! storage_properties = 1;
! }
if (in1_t->isa_narrowklass()) {
return TypeInt::make((int)storage_properties);
}
return TypeX::make(storage_properties);
}
}
return bottom_type();
}
! Node* GetStoragePropertyNode::Ideal(PhaseGVN *phase, bool can_reshape) {
if (!can_reshape) {
return NULL;
}
if (in(1) != NULL && in(1)->is_Phi()) {
Node* phi = in(1);
Node* r = phi->in(0);
Node* new_phi = new PhiNode(r, bottom_type());
for (uint i = 1; i < r->req(); i++) {
Node* in = phi->in(i);
if (in == NULL) continue;
! Node* n = clone();
! n->set_req(1, in);
! new_phi->init_req(i, phase->transform(n));
}
return new_phi;
}
return NULL;
}
< prev index next >