518 return make_default(gvn, vk); 519 } 520 vt->set_oop(not_null_oop); 521 vt->load(kit, not_null_oop, not_null_oop, vk, /* holder_offset */ 0); 522 523 if (null_ctl != kit->top()) { 524 // Return default value type if oop is null 525 ValueTypeNode* def = make_default(gvn, vk); 526 Node* region = new RegionNode(3); 527 region->init_req(1, kit->control()); 528 region->init_req(2, null_ctl); 529 530 vt = vt->clone_with_phis(&gvn, region)->as_ValueType(); 531 vt->merge_with(&gvn, def, 2, true); 532 kit->set_control(gvn.transform(region)); 533 } 534 } else { 535 // Oop can never be null 536 Node* init_ctl = kit->control(); 537 vt->load(kit, oop, oop, vk, /* holder_offset */ 0); 538 assert(init_ctl != kit->control() || oop->is_Con() || oop->is_CheckCastPP() || oop->Opcode() == Op_ValueTypePtr || 539 vt->is_loaded(&gvn) == oop, "value type should be loaded"); 540 } 541 542 assert(vt->is_allocated(&gvn), "value type should be allocated"); 543 return gvn.transform(vt)->as_ValueType(); 544 } 545 546 // GraphKit wrapper for the 'make_from_flattened' method 547 ValueTypeNode* ValueTypeNode::make_from_flattened(GraphKit* kit, ciValueKlass* vk, Node* obj, Node* ptr, ciInstanceKlass* holder, int holder_offset, DecoratorSet decorators) { 548 // Create and initialize a ValueTypeNode by loading all field values from 549 // a flattened value type field at 'holder_offset' or from a value type array. 550 ValueTypeNode* vt = make_uninitialized(kit->gvn(), vk); 551 // The value type is flattened into the object without an oop header. Subtract the 552 // offset of the first field to account for the missing header when loading the values. 553 holder_offset -= vk->first_field_offset(); 554 vt->load(kit, obj, ptr, holder, holder_offset, decorators); 555 assert(vt->is_loaded(&kit->gvn()) != obj, "holder oop should not be used as flattened value type oop"); 556 return kit->gvn().transform(vt)->as_ValueType(); 557 } 558 559 ValueTypeNode* ValueTypeNode::make_from_multi(GraphKit* kit, MultiNode* multi, ExtendedSignature& sig, ciValueKlass* vk, uint& base_input, bool in) { | 518 return make_default(gvn, vk); 519 } 520 vt->set_oop(not_null_oop); 521 vt->load(kit, not_null_oop, not_null_oop, vk, /* holder_offset */ 0); 522 523 if (null_ctl != kit->top()) { 524 // Return default value type if oop is null 525 ValueTypeNode* def = make_default(gvn, vk); 526 Node* region = new RegionNode(3); 527 region->init_req(1, kit->control()); 528 region->init_req(2, null_ctl); 529 530 vt = vt->clone_with_phis(&gvn, region)->as_ValueType(); 531 vt->merge_with(&gvn, def, 2, true); 532 kit->set_control(gvn.transform(region)); 533 } 534 } else { 535 // Oop can never be null 536 Node* init_ctl = kit->control(); 537 vt->load(kit, oop, oop, vk, /* holder_offset */ 0); 538 assert(init_ctl != kit->control() || !gvn.type(oop)->is_valuetypeptr() || oop->is_Con() || oop->Opcode() == Op_ValueTypePtr || 539 AllocateNode::Ideal_allocation(oop, &gvn) != NULL || vt->is_loaded(&gvn) == oop, "value type should be loaded"); 540 } 541 542 assert(vt->is_allocated(&gvn), "value type should be allocated"); 543 return gvn.transform(vt)->as_ValueType(); 544 } 545 546 // GraphKit wrapper for the 'make_from_flattened' method 547 ValueTypeNode* ValueTypeNode::make_from_flattened(GraphKit* kit, ciValueKlass* vk, Node* obj, Node* ptr, ciInstanceKlass* holder, int holder_offset, DecoratorSet decorators) { 548 // Create and initialize a ValueTypeNode by loading all field values from 549 // a flattened value type field at 'holder_offset' or from a value type array. 550 ValueTypeNode* vt = make_uninitialized(kit->gvn(), vk); 551 // The value type is flattened into the object without an oop header. Subtract the 552 // offset of the first field to account for the missing header when loading the values. 553 holder_offset -= vk->first_field_offset(); 554 vt->load(kit, obj, ptr, holder, holder_offset, decorators); 555 assert(vt->is_loaded(&kit->gvn()) != obj, "holder oop should not be used as flattened value type oop"); 556 return kit->gvn().transform(vt)->as_ValueType(); 557 } 558 559 ValueTypeNode* ValueTypeNode::make_from_multi(GraphKit* kit, MultiNode* multi, ExtendedSignature& sig, ciValueKlass* vk, uint& base_input, bool in) { |