< prev index next >

src/hotspot/share/opto/macro.cpp

Print this page

1684     rawmem = new ProjNode(call, TypeFunc::Memory);
1685     transform_later(rawmem);
1686   }
1687 }
1688 
1689 // Helper for PhaseMacroExpand::expand_allocate_common.
1690 // Initializes the newly-allocated storage.
1691 Node*
1692 PhaseMacroExpand::initialize_object(AllocateNode* alloc,
1693                                     Node* control, Node* rawmem, Node* object,
1694                                     Node* klass_node, Node* length,
1695                                     Node* size_in_bytes) {
1696   InitializeNode* init = alloc->initialization();
1697   // Store the klass & mark bits
1698   Node* mark_node = alloc->make_ideal_mark(&_igvn, object, control, rawmem);
1699   if (!mark_node->is_Con()) {
1700     transform_later(mark_node);
1701   }
1702   rawmem = make_store(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, TypeX_X->basic_type());
1703 
1704   rawmem = make_store(control, rawmem, object, oopDesc::klass_offset_in_bytes(), klass_node, T_METADATA);



1705   int header_size = alloc->minimum_header_size();  // conservatively small
1706 
1707   // Array length
1708   if (length != nullptr) {         // Arrays need length field
1709     rawmem = make_store(control, rawmem, object, arrayOopDesc::length_offset_in_bytes(), length, T_INT);
1710     // conservatively small header size:
1711     header_size = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1712     if (_igvn.type(klass_node)->isa_aryklassptr()) {   // we know the exact header size in most cases:
1713       BasicType elem = _igvn.type(klass_node)->is_klassptr()->as_instance_type()->isa_aryptr()->elem()->array_element_basic_type();
1714       if (is_reference_type(elem, true)) {
1715         elem = T_OBJECT;
1716       }
1717       header_size = Klass::layout_helper_header_size(Klass::array_layout_helper(elem));
1718     }
1719   }
1720 
1721   // Clear the object body, if necessary.
1722   if (init == nullptr) {
1723     // The init has somehow disappeared; be cautious and clear everything.
1724     //

1684     rawmem = new ProjNode(call, TypeFunc::Memory);
1685     transform_later(rawmem);
1686   }
1687 }
1688 
1689 // Helper for PhaseMacroExpand::expand_allocate_common.
1690 // Initializes the newly-allocated storage.
1691 Node*
1692 PhaseMacroExpand::initialize_object(AllocateNode* alloc,
1693                                     Node* control, Node* rawmem, Node* object,
1694                                     Node* klass_node, Node* length,
1695                                     Node* size_in_bytes) {
1696   InitializeNode* init = alloc->initialization();
1697   // Store the klass & mark bits
1698   Node* mark_node = alloc->make_ideal_mark(&_igvn, object, control, rawmem);
1699   if (!mark_node->is_Con()) {
1700     transform_later(mark_node);
1701   }
1702   rawmem = make_store(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, TypeX_X->basic_type());
1703 
1704   if (!UseCompactObjectHeaders) {
1705     rawmem = make_store(control, rawmem, object, oopDesc::klass_offset_in_bytes(), klass_node, T_METADATA);
1706   }
1707 
1708   int header_size = alloc->minimum_header_size();  // conservatively small
1709 
1710   // Array length
1711   if (length != nullptr) {         // Arrays need length field
1712     rawmem = make_store(control, rawmem, object, arrayOopDesc::length_offset_in_bytes(), length, T_INT);
1713     // conservatively small header size:
1714     header_size = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1715     if (_igvn.type(klass_node)->isa_aryklassptr()) {   // we know the exact header size in most cases:
1716       BasicType elem = _igvn.type(klass_node)->is_klassptr()->as_instance_type()->isa_aryptr()->elem()->array_element_basic_type();
1717       if (is_reference_type(elem, true)) {
1718         elem = T_OBJECT;
1719       }
1720       header_size = Klass::layout_helper_header_size(Klass::array_layout_helper(elem));
1721     }
1722   }
1723 
1724   // Clear the object body, if necessary.
1725   if (init == nullptr) {
1726     // The init has somehow disappeared; be cautious and clear everything.
1727     //
< prev index next >