673 // Dump the required inputs, enclosed in '(' and ')'
674 uint i; // Exit value of loop
675 for (i = 0; i < req(); i++) { // For all required inputs
676 if (i == TypeFunc::Parms) st->print("(");
677 if (in(i)) st->print("%c%d ", Compile::current()->node_arena()->contains(in(i)) ? ' ' : 'o', in(i)->_idx);
678 else st->print("_ ");
679 }
680 st->print(")");
681 }
682
683 void CallNode::dump_spec(outputStream *st) const {
684 st->print(" ");
685 if (tf() != NULL) tf()->dump_on(st);
686 if (_cnt != COUNT_UNKNOWN) st->print(" C=%f",_cnt);
687 if (jvms() != NULL) jvms()->dump_spec(st);
688 }
689 #endif
690
691 const Type *CallNode::bottom_type() const { return tf()->range_cc(); }
692 const Type* CallNode::Value(PhaseGVN* phase) const {
693 if (phase->type(in(0)) == Type::TOP) return Type::TOP;
694 return tf()->range_cc();
695 }
696
697 //------------------------------calling_convention-----------------------------
698 void CallNode::calling_convention(BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt) const {
699 if (_entry_point == StubRoutines::store_value_type_fields_to_buf()) {
700 // The call to that stub is a special case: its inputs are
701 // multiple values returned from a call and so it should follow
702 // the return convention.
703 SharedRuntime::java_return_convention(sig_bt, parm_regs, argcnt);
704 return;
705 }
706 // Use the standard compiler calling convention
707 Matcher::calling_convention( sig_bt, parm_regs, argcnt, true );
708 }
709
710
711 //------------------------------match------------------------------------------
712 // Construct projections for control, I/O, memory-fields, ..., and
713 // return result(s) along with their RegMask info
1416 init_req( ALength , topnode);
1417 init_req( ValueNode , value_node);
1418 C->add_macro_node(this);
1419 }
1420
1421 void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer)
1422 {
1423 assert(initializer != NULL &&
1424 initializer->is_initializer() &&
1425 !initializer->is_static(),
1426 "unexpected initializer method");
1427 BCEscapeAnalyzer* analyzer = initializer->get_bcea();
1428 if (analyzer == NULL) {
1429 return;
1430 }
1431
1432 // Allocation node is first parameter in its initializer
1433 if (analyzer->is_arg_stack(0) || analyzer->is_arg_local(0)) {
1434 _is_allocation_MemBar_redundant = true;
1435 }
1436 }
1437
1438 //=============================================================================
1439 Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1440 Node* res = SafePointNode::Ideal(phase, can_reshape);
1441 if (res != NULL) {
1442 return res;
1443 }
1444 // Don't bother trying to transform a dead node
1445 if (in(0) && in(0)->is_top()) return NULL;
1446
1447 const Type* type = phase->type(Ideal_length());
1448 if (type->isa_int() && type->is_int()->_hi < 0) {
1449 if (can_reshape) {
1450 PhaseIterGVN *igvn = phase->is_IterGVN();
1451 // Unreachable fall through path (negative array length),
1452 // the allocation can only throw so disconnect it.
1453 Node* proj = proj_out(TypeFunc::Control);
1454 Node* catchproj = NULL;
1455 if (proj != NULL) {
|
673 // Dump the required inputs, enclosed in '(' and ')'
674 uint i; // Exit value of loop
675 for (i = 0; i < req(); i++) { // For all required inputs
676 if (i == TypeFunc::Parms) st->print("(");
677 if (in(i)) st->print("%c%d ", Compile::current()->node_arena()->contains(in(i)) ? ' ' : 'o', in(i)->_idx);
678 else st->print("_ ");
679 }
680 st->print(")");
681 }
682
683 void CallNode::dump_spec(outputStream *st) const {
684 st->print(" ");
685 if (tf() != NULL) tf()->dump_on(st);
686 if (_cnt != COUNT_UNKNOWN) st->print(" C=%f",_cnt);
687 if (jvms() != NULL) jvms()->dump_spec(st);
688 }
689 #endif
690
691 const Type *CallNode::bottom_type() const { return tf()->range_cc(); }
692 const Type* CallNode::Value(PhaseGVN* phase) const {
693 if (!in(0) || phase->type(in(0)) == Type::TOP) {
694 return Type::TOP;
695 }
696 return tf()->range_cc();
697 }
698
699 //------------------------------calling_convention-----------------------------
700 void CallNode::calling_convention(BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt) const {
701 if (_entry_point == StubRoutines::store_value_type_fields_to_buf()) {
702 // The call to that stub is a special case: its inputs are
703 // multiple values returned from a call and so it should follow
704 // the return convention.
705 SharedRuntime::java_return_convention(sig_bt, parm_regs, argcnt);
706 return;
707 }
708 // Use the standard compiler calling convention
709 Matcher::calling_convention( sig_bt, parm_regs, argcnt, true );
710 }
711
712
713 //------------------------------match------------------------------------------
714 // Construct projections for control, I/O, memory-fields, ..., and
715 // return result(s) along with their RegMask info
1418 init_req( ALength , topnode);
1419 init_req( ValueNode , value_node);
1420 C->add_macro_node(this);
1421 }
1422
1423 void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer)
1424 {
1425 assert(initializer != NULL &&
1426 initializer->is_initializer() &&
1427 !initializer->is_static(),
1428 "unexpected initializer method");
1429 BCEscapeAnalyzer* analyzer = initializer->get_bcea();
1430 if (analyzer == NULL) {
1431 return;
1432 }
1433
1434 // Allocation node is first parameter in its initializer
1435 if (analyzer->is_arg_stack(0) || analyzer->is_arg_local(0)) {
1436 _is_allocation_MemBar_redundant = true;
1437 }
1438 }
1439
1440 Node* AllocateNode::Ideal(PhaseGVN* phase, bool can_reshape) {
1441 // Check for unused value type allocation
1442 if (can_reshape && in(AllocateNode::ValueNode) != NULL &&
1443 outcnt() != 0 && result_cast() == NULL) {
1444 // Remove allocation by replacing the projection nodes with its inputs
1445 PhaseIterGVN* igvn = phase->is_IterGVN();
1446 CallProjections projs;
1447 extract_projections(&projs, true);
1448 igvn->replace_node(projs.fallthrough_catchproj, in(TypeFunc::Control));
1449 igvn->replace_node(projs.fallthrough_memproj, in(TypeFunc::Memory));
1450 igvn->replace_node(projs.catchall_memproj, phase->C->top());
1451 igvn->replace_node(projs.fallthrough_ioproj, in(TypeFunc::I_O));
1452 igvn->replace_node(projs.catchall_ioproj, phase->C->top());
1453 igvn->replace_node(projs.catchall_catchproj, phase->C->top());
1454 igvn->replace_node(projs.resproj, phase->C->top());
1455 igvn->remove_dead_node(this);
1456 return NULL;
1457 }
1458
1459 return CallNode::Ideal(phase, can_reshape);
1460 }
1461
1462 //=============================================================================
1463 Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1464 Node* res = SafePointNode::Ideal(phase, can_reshape);
1465 if (res != NULL) {
1466 return res;
1467 }
1468 // Don't bother trying to transform a dead node
1469 if (in(0) && in(0)->is_top()) return NULL;
1470
1471 const Type* type = phase->type(Ideal_length());
1472 if (type->isa_int() && type->is_int()->_hi < 0) {
1473 if (can_reshape) {
1474 PhaseIterGVN *igvn = phase->is_IterGVN();
1475 // Unreachable fall through path (negative array length),
1476 // the allocation can only throw so disconnect it.
1477 Node* proj = proj_out(TypeFunc::Control);
1478 Node* catchproj = NULL;
1479 if (proj != NULL) {
|