< prev index next >

src/hotspot/share/opto/macro.cpp

Print this page

1663     rawmem = new ProjNode(call, TypeFunc::Memory);
1664     transform_later(rawmem);
1665   }
1666 }
1667 
1668 // Helper for PhaseMacroExpand::expand_allocate_common.
1669 // Initializes the newly-allocated storage.
1670 Node*
1671 PhaseMacroExpand::initialize_object(AllocateNode* alloc,
1672                                     Node* control, Node* rawmem, Node* object,
1673                                     Node* klass_node, Node* length,
1674                                     Node* size_in_bytes) {
1675   InitializeNode* init = alloc->initialization();
1676   // Store the klass & mark bits
1677   Node* mark_node = alloc->make_ideal_mark(&_igvn, object, control, rawmem);
1678   if (!mark_node->is_Con()) {
1679     transform_later(mark_node);
1680   }
1681   rawmem = make_store(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, TypeX_X->basic_type());
1682 

1683   rawmem = make_store(control, rawmem, object, oopDesc::klass_offset_in_bytes(), klass_node, T_METADATA);

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

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