< prev index next >

src/hotspot/share/opto/macro.cpp

Print this page

1644     rawmem = new ProjNode(call, TypeFunc::Memory);
1645     transform_later(rawmem);
1646   }
1647 }
1648 
1649 // Helper for PhaseMacroExpand::expand_allocate_common.
1650 // Initializes the newly-allocated storage.
1651 Node*
1652 PhaseMacroExpand::initialize_object(AllocateNode* alloc,
1653                                     Node* control, Node* rawmem, Node* object,
1654                                     Node* klass_node, Node* length,
1655                                     Node* size_in_bytes) {
1656   InitializeNode* init = alloc->initialization();
1657   // Store the klass & mark bits
1658   Node* mark_node = alloc->make_ideal_mark(&_igvn, object, control, rawmem);
1659   if (!mark_node->is_Con()) {
1660     transform_later(mark_node);
1661   }
1662   rawmem = make_store(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, TypeX_X->basic_type());
1663 
1664   rawmem = make_store(control, rawmem, object, oopDesc::klass_offset_in_bytes(), klass_node, T_METADATA);


1665   int header_size = alloc->minimum_header_size();  // conservatively small
1666 
1667   // Array length
1668   if (length != nullptr) {         // Arrays need length field
1669     rawmem = make_store(control, rawmem, object, arrayOopDesc::length_offset_in_bytes(), length, T_INT);
1670     // conservatively small header size:
1671     header_size = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1672     if (_igvn.type(klass_node)->isa_aryklassptr()) {   // we know the exact header size in most cases:
1673       BasicType elem = _igvn.type(klass_node)->is_klassptr()->as_instance_type()->isa_aryptr()->elem()->array_element_basic_type();
1674       if (is_reference_type(elem, true)) {
1675         elem = T_OBJECT;
1676       }
1677       header_size = Klass::layout_helper_header_size(Klass::array_layout_helper(elem));
1678     }
1679   }
1680 
1681   // Clear the object body, if necessary.
1682   if (init == nullptr) {
1683     // The init has somehow disappeared; be cautious and clear everything.
1684     //

1644     rawmem = new ProjNode(call, TypeFunc::Memory);
1645     transform_later(rawmem);
1646   }
1647 }
1648 
1649 // Helper for PhaseMacroExpand::expand_allocate_common.
1650 // Initializes the newly-allocated storage.
1651 Node*
1652 PhaseMacroExpand::initialize_object(AllocateNode* alloc,
1653                                     Node* control, Node* rawmem, Node* object,
1654                                     Node* klass_node, Node* length,
1655                                     Node* size_in_bytes) {
1656   InitializeNode* init = alloc->initialization();
1657   // Store the klass & mark bits
1658   Node* mark_node = alloc->make_ideal_mark(&_igvn, object, control, rawmem);
1659   if (!mark_node->is_Con()) {
1660     transform_later(mark_node);
1661   }
1662   rawmem = make_store(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, TypeX_X->basic_type());
1663 
1664   if (!UseCompactObjectHeaders) {
1665     rawmem = make_store(control, rawmem, object, oopDesc::klass_offset_in_bytes(), klass_node, T_METADATA);
1666   }
1667   int header_size = alloc->minimum_header_size();  // conservatively small
1668 
1669   // Array length
1670   if (length != nullptr) {         // Arrays need length field
1671     rawmem = make_store(control, rawmem, object, arrayOopDesc::length_offset_in_bytes(), length, T_INT);
1672     // conservatively small header size:
1673     header_size = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1674     if (_igvn.type(klass_node)->isa_aryklassptr()) {   // we know the exact header size in most cases:
1675       BasicType elem = _igvn.type(klass_node)->is_klassptr()->as_instance_type()->isa_aryptr()->elem()->array_element_basic_type();
1676       if (is_reference_type(elem, true)) {
1677         elem = T_OBJECT;
1678       }
1679       header_size = Klass::layout_helper_header_size(Klass::array_layout_helper(elem));
1680     }
1681   }
1682 
1683   // Clear the object body, if necessary.
1684   if (init == nullptr) {
1685     // The init has somehow disappeared; be cautious and clear everything.
1686     //
< prev index next >