< prev index next >

src/hotspot/share/opto/callnode.cpp

Print this page

1659   C->add_macro_node(this);
1660 }
1661 
1662 void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer)
1663 {
1664   assert(initializer != NULL &&
1665          initializer->is_initializer() &&
1666          !initializer->is_static(),
1667              "unexpected initializer method");
1668   BCEscapeAnalyzer* analyzer = initializer->get_bcea();
1669   if (analyzer == NULL) {
1670     return;
1671   }
1672 
1673   // Allocation node is first parameter in its initializer
1674   if (analyzer->is_arg_stack(0) || analyzer->is_arg_local(0)) {
1675     _is_allocation_MemBar_redundant = true;
1676   }
1677 }
1678 Node *AllocateNode::make_ideal_mark(PhaseGVN *phase, Node* obj, Node* control, Node* mem) {
1679   Node* mark_node = NULL;
1680   // For now only enable fast locking for non-array types
1681   mark_node = phase->MakeConX(markWord::prototype().value());
1682   return mark_node;
1683 }
1684 
1685 //=============================================================================
1686 Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1687   if (remove_dead_region(phase, can_reshape))  return this;
1688   // Don't bother trying to transform a dead node
1689   if (in(0) && in(0)->is_top())  return NULL;
1690 
1691   const Type* type = phase->type(Ideal_length());
1692   if (type->isa_int() && type->is_int()->_hi < 0) {
1693     if (can_reshape) {
1694       PhaseIterGVN *igvn = phase->is_IterGVN();
1695       // Unreachable fall through path (negative array length),
1696       // the allocation can only throw so disconnect it.
1697       Node* proj = proj_out_or_null(TypeFunc::Control);
1698       Node* catchproj = NULL;
1699       if (proj != NULL) {
1700         for (DUIterator_Fast imax, i = proj->fast_outs(imax); i < imax; i++) {
1701           Node *cn = proj->fast_out(i);

1659   C->add_macro_node(this);
1660 }
1661 
1662 void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer)
1663 {
1664   assert(initializer != NULL &&
1665          initializer->is_initializer() &&
1666          !initializer->is_static(),
1667              "unexpected initializer method");
1668   BCEscapeAnalyzer* analyzer = initializer->get_bcea();
1669   if (analyzer == NULL) {
1670     return;
1671   }
1672 
1673   // Allocation node is first parameter in its initializer
1674   if (analyzer->is_arg_stack(0) || analyzer->is_arg_local(0)) {
1675     _is_allocation_MemBar_redundant = true;
1676   }
1677 }
1678 Node *AllocateNode::make_ideal_mark(PhaseGVN *phase, Node* obj, Node* control, Node* mem) {
1679   Node* klass_node = in(AllocateNode::KlassNode);
1680   Node* proto_adr = phase->transform(new AddPNode(klass_node, klass_node, phase->MakeConX(in_bytes(Klass::prototype_header_offset()))));
1681   Node* mark_node = LoadNode::make(*phase, control, mem, proto_adr, TypeRawPtr::BOTTOM, TypeX_X, TypeX_X->basic_type(), MemNode::unordered);
1682   return mark_node;
1683 }
1684 
1685 //=============================================================================
1686 Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1687   if (remove_dead_region(phase, can_reshape))  return this;
1688   // Don't bother trying to transform a dead node
1689   if (in(0) && in(0)->is_top())  return NULL;
1690 
1691   const Type* type = phase->type(Ideal_length());
1692   if (type->isa_int() && type->is_int()->_hi < 0) {
1693     if (can_reshape) {
1694       PhaseIterGVN *igvn = phase->is_IterGVN();
1695       // Unreachable fall through path (negative array length),
1696       // the allocation can only throw so disconnect it.
1697       Node* proj = proj_out_or_null(TypeFunc::Control);
1698       Node* catchproj = NULL;
1699       if (proj != NULL) {
1700         for (DUIterator_Fast imax, i = proj->fast_outs(imax); i < imax; i++) {
1701           Node *cn = proj->fast_out(i);
< prev index next >