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