< prev index next >

src/hotspot/share/opto/macro.cpp

Print this page

1653     rawmem = new ProjNode(call, TypeFunc::Memory);
1654     transform_later(rawmem);
1655   }
1656 }
1657 
1658 // Helper for PhaseMacroExpand::expand_allocate_common.
1659 // Initializes the newly-allocated storage.
1660 Node*
1661 PhaseMacroExpand::initialize_object(AllocateNode* alloc,
1662                                     Node* control, Node* rawmem, Node* object,
1663                                     Node* klass_node, Node* length,
1664                                     Node* size_in_bytes) {
1665   InitializeNode* init = alloc->initialization();
1666   // Store the klass & mark bits
1667   Node* mark_node = alloc->make_ideal_mark(&_igvn, object, control, rawmem);
1668   if (!mark_node->is_Con()) {
1669     transform_later(mark_node);
1670   }
1671   rawmem = make_store(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, TypeX_X->basic_type());
1672 
1673   rawmem = make_store(control, rawmem, object, oopDesc::klass_offset_in_bytes(), klass_node, T_METADATA);



1674   int header_size = alloc->minimum_header_size();  // conservatively small
1675 
1676   // Array length
1677   if (length != NULL) {         // Arrays need length field
1678     rawmem = make_store(control, rawmem, object, arrayOopDesc::length_offset_in_bytes(), length, T_INT);
1679     // conservatively small header size:
1680     header_size = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1681     ciKlass* k = _igvn.type(klass_node)->is_klassptr()->klass();
1682     if (k->is_array_klass())    // we know the exact header size in most cases:
1683       header_size = Klass::layout_helper_header_size(k->layout_helper());
1684   }
1685 
1686   // Clear the object body, if necessary.
1687   if (init == NULL) {
1688     // The init has somehow disappeared; be cautious and clear everything.
1689     //
1690     // This can happen if a node is allocated but an uncommon trap occurs
1691     // immediately.  In this case, the Initialize gets associated with the
1692     // trap, and may be placed in a different (outer) loop, if the Allocate
1693     // is in a loop.  If (this is rare) the inner loop gets unrolled, then

1653     rawmem = new ProjNode(call, TypeFunc::Memory);
1654     transform_later(rawmem);
1655   }
1656 }
1657 
1658 // Helper for PhaseMacroExpand::expand_allocate_common.
1659 // Initializes the newly-allocated storage.
1660 Node*
1661 PhaseMacroExpand::initialize_object(AllocateNode* alloc,
1662                                     Node* control, Node* rawmem, Node* object,
1663                                     Node* klass_node, Node* length,
1664                                     Node* size_in_bytes) {
1665   InitializeNode* init = alloc->initialization();
1666   // Store the klass & mark bits
1667   Node* mark_node = alloc->make_ideal_mark(&_igvn, object, control, rawmem);
1668   if (!mark_node->is_Con()) {
1669     transform_later(mark_node);
1670   }
1671   rawmem = make_store(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, TypeX_X->basic_type());
1672 
1673   if (!UseCompactObjectHeaders) {
1674     rawmem = make_store(control, rawmem, object, oopDesc::klass_offset_in_bytes(), klass_node, T_METADATA);
1675   }
1676 
1677   int header_size = alloc->minimum_header_size();  // conservatively small
1678 
1679   // Array length
1680   if (length != NULL) {         // Arrays need length field
1681     rawmem = make_store(control, rawmem, object, arrayOopDesc::length_offset_in_bytes(), length, T_INT);
1682     // conservatively small header size:
1683     header_size = arrayOopDesc::base_offset_in_bytes(T_BYTE);
1684     ciKlass* k = _igvn.type(klass_node)->is_klassptr()->klass();
1685     if (k->is_array_klass())    // we know the exact header size in most cases:
1686       header_size = Klass::layout_helper_header_size(k->layout_helper());
1687   }
1688 
1689   // Clear the object body, if necessary.
1690   if (init == NULL) {
1691     // The init has somehow disappeared; be cautious and clear everything.
1692     //
1693     // This can happen if a node is allocated but an uncommon trap occurs
1694     // immediately.  In this case, the Initialize gets associated with the
1695     // trap, and may be placed in a different (outer) loop, if the Allocate
1696     // is in a loop.  If (this is rare) the inner loop gets unrolled, then
< prev index next >