< prev index next >

src/share/vm/opto/parse3.cpp

Print this page

        

*** 175,184 **** --- 175,186 ---- } } ciType* field_klass = field->type(); bool is_vol = field->is_volatile(); + // TODO change this when we support non-flattened value type fields that are non-static + bool flattened = (bt == T_VALUETYPE) && !field->is_static(); // Compute address and memory type. int offset = field->offset_in_bytes(); const TypePtr* adr_type = C->alias_type(field)->adr_type(); Node *adr = basic_plus_adr(obj, obj, offset);
*** 202,211 **** --- 204,228 ---- type = TypeOopPtr::make_from_constant(con)->isa_oopptr(); } assert(type != NULL, "field singleton type must be consistent"); } else { type = TypeOopPtr::make_from_klass(field_klass->as_klass()); + if (bt == T_VALUETYPE && !flattened) { + // A non-flattened value type field may be NULL + bool maybe_null = true; + if (field->is_static()) { + // Check if static field is already initialized + ciInstance* mirror = field->holder()->java_mirror(); + ciObject* val = mirror->field_value(field).as_object(); + if (!val->is_null_object()) { + maybe_null = false; + } + } + if (maybe_null) { + type = type->is_valuetypeptr()->cast_to_ptr_type(TypePtr::BotPTR); + } + } } } else { type = Type::get_const_basic_type(bt); } if (support_IRIW_for_not_multiple_copy_atomic_cpu && field->is_volatile()) {
*** 215,226 **** // Build the load. // MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered; bool needs_atomic_access = is_vol || AlwaysAtomicAccesses; Node* ld = NULL; ! if (bt == T_VALUETYPE && !field->is_static()) { ! // Load flattened value type from non-static field ld = ValueTypeNode::make(_gvn, field_klass->as_value_klass(), map()->memory(), obj, obj, field->holder(), offset); } else { ld = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, needs_atomic_access); } --- 232,243 ---- // Build the load. // MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered; bool needs_atomic_access = is_vol || AlwaysAtomicAccesses; Node* ld = NULL; ! if (flattened) { ! // Load flattened value type ld = ValueTypeNode::make(_gvn, field_klass->as_value_klass(), map()->memory(), obj, obj, field->holder(), offset); } else { ld = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, needs_atomic_access); }
< prev index next >