< prev index next >
src/share/vm/opto/graphKit.cpp
Print this page
*** 1075,1084 ****
--- 1075,1085 ----
// Construct NULL check
Node *chk = NULL;
switch(type) {
case T_LONG : chk = new CmpLNode(value, _gvn.zerocon(T_LONG)); break;
case T_INT : chk = new CmpINode(value, _gvn.intcon(0)); break;
+ case T_VALUETYPE : // fall through
case T_ARRAY : // fall through
type = T_OBJECT; // simplify further tests
case T_OBJECT : {
const Type *t = _gvn.type( value );
*** 1355,1365 ****
ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency, unaligned, mismatched);
}
ld = _gvn.transform(ld);
if (bt == T_VALUETYPE) {
! // Load value type from oop
ld = ValueTypeNode::make(gvn(), map()->memory(), ld);
} else if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) {
// Improve graph before escape analysis and boxing elimination.
record_for_igvn(ld);
}
--- 1356,1376 ----
ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency, unaligned, mismatched);
}
ld = _gvn.transform(ld);
if (bt == T_VALUETYPE) {
! // Load non-flattened value type from memory. Add a null check and let the
! // interpreter take care of initializing the field to the default value type.
! Node* null_ctl = top();
! ld = null_check_common(ld, bt, false, &null_ctl, false);
! if (null_ctl != top()) {
! assert(!adr_type->isa_aryptr(), "value type array must be initialized");
! PreserveJVMState pjvms(this);
! set_control(null_ctl);
! uncommon_trap(Deoptimization::reason_null_check(false), Deoptimization::Action_maybe_recompile,
! t->is_valuetypeptr()->value_type()->value_klass(), "uninitialized non-flattened value type");
! }
ld = ValueTypeNode::make(gvn(), map()->memory(), ld);
} else if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) {
// Improve graph before escape analysis and boxing elimination.
record_for_igvn(ld);
}
< prev index next >