< prev index next >

src/hotspot/share/opto/callnode.cpp

Print this page

1554   C->add_macro_node(this);
1555 }
1556 
1557 void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer)
1558 {
1559   assert(initializer != NULL &&
1560          initializer->is_initializer() &&
1561          !initializer->is_static(),
1562              "unexpected initializer method");
1563   BCEscapeAnalyzer* analyzer = initializer->get_bcea();
1564   if (analyzer == NULL) {
1565     return;
1566   }
1567 
1568   // Allocation node is first parameter in its initializer
1569   if (analyzer->is_arg_stack(0) || analyzer->is_arg_local(0)) {
1570     _is_allocation_MemBar_redundant = true;
1571   }
1572 }
1573 Node *AllocateNode::make_ideal_mark(PhaseGVN *phase, Node* obj, Node* control, Node* mem) {
1574   Node* mark_node = NULL;
1575   // For now only enable fast locking for non-array types
1576   mark_node = phase->MakeConX(markWord::prototype().value());
1577   return mark_node;
1578 }
1579 
1580 //=============================================================================
1581 Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1582   if (remove_dead_region(phase, can_reshape))  return this;
1583   // Don't bother trying to transform a dead node
1584   if (in(0) && in(0)->is_top())  return NULL;
1585 
1586   const Type* type = phase->type(Ideal_length());
1587   if (type->isa_int() && type->is_int()->_hi < 0) {
1588     if (can_reshape) {
1589       PhaseIterGVN *igvn = phase->is_IterGVN();
1590       // Unreachable fall through path (negative array length),
1591       // the allocation can only throw so disconnect it.
1592       Node* proj = proj_out_or_null(TypeFunc::Control);
1593       Node* catchproj = NULL;
1594       if (proj != NULL) {
1595         for (DUIterator_Fast imax, i = proj->fast_outs(imax); i < imax; i++) {
1596           Node *cn = proj->fast_out(i);

1554   C->add_macro_node(this);
1555 }
1556 
1557 void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer)
1558 {
1559   assert(initializer != NULL &&
1560          initializer->is_initializer() &&
1561          !initializer->is_static(),
1562              "unexpected initializer method");
1563   BCEscapeAnalyzer* analyzer = initializer->get_bcea();
1564   if (analyzer == NULL) {
1565     return;
1566   }
1567 
1568   // Allocation node is first parameter in its initializer
1569   if (analyzer->is_arg_stack(0) || analyzer->is_arg_local(0)) {
1570     _is_allocation_MemBar_redundant = true;
1571   }
1572 }
1573 Node *AllocateNode::make_ideal_mark(PhaseGVN *phase, Node* obj, Node* control, Node* mem) {
1574   Node* klass_node = in(AllocateNode::KlassNode);
1575   Node* proto_adr = phase->transform(new AddPNode(klass_node, klass_node, phase->MakeConX(in_bytes(Klass::prototype_header_offset()))));
1576   Node* mark_node = LoadNode::make(*phase, control, mem, proto_adr, TypeRawPtr::BOTTOM, TypeX_X, TypeX_X->basic_type(), MemNode::unordered);
1577   return mark_node;
1578 }
1579 
1580 //=============================================================================
1581 Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1582   if (remove_dead_region(phase, can_reshape))  return this;
1583   // Don't bother trying to transform a dead node
1584   if (in(0) && in(0)->is_top())  return NULL;
1585 
1586   const Type* type = phase->type(Ideal_length());
1587   if (type->isa_int() && type->is_int()->_hi < 0) {
1588     if (can_reshape) {
1589       PhaseIterGVN *igvn = phase->is_IterGVN();
1590       // Unreachable fall through path (negative array length),
1591       // the allocation can only throw so disconnect it.
1592       Node* proj = proj_out_or_null(TypeFunc::Control);
1593       Node* catchproj = NULL;
1594       if (proj != NULL) {
1595         for (DUIterator_Fast imax, i = proj->fast_outs(imax); i < imax; i++) {
1596           Node *cn = proj->fast_out(i);
< prev index next >