< prev index next >

src/share/vm/opto/callnode.cpp

Print this page

        

*** 75,96 **** Node *StartNode::match( const ProjNode *proj, const Matcher *match ) { switch (proj->_con) { case TypeFunc::Control: case TypeFunc::I_O: case TypeFunc::Memory: ! return new MachProjNode(this,proj->_con,RegMask::Empty,MachProjNode::unmatched_proj); case TypeFunc::FramePtr: ! return new MachProjNode(this,proj->_con,Matcher::c_frame_ptr_mask, Op_RegP); case TypeFunc::ReturnAdr: ! return new MachProjNode(this,proj->_con,match->_return_addr_mask,Op_RegP); case TypeFunc::Parms: default: { uint parm_num = proj->_con - TypeFunc::Parms; const Type *t = _domain->field_at(proj->_con); if (t->base() == Type::Half) // 2nd half of Longs and Doubles return new ConNode(Type::TOP); ! uint ideal_reg = t->ideal_reg(); RegMask &rm = match->_calling_convention_mask[parm_num]; return new MachProjNode(this,proj->_con,rm,ideal_reg); } } return NULL; --- 75,96 ---- Node *StartNode::match( const ProjNode *proj, const Matcher *match ) { switch (proj->_con) { case TypeFunc::Control: case TypeFunc::I_O: case TypeFunc::Memory: ! return new MachProjNode(this,proj->_con,RegMask::Empty,static_cast<Opcodes>(MachProjNode::projType::unmatched_proj)); case TypeFunc::FramePtr: ! return new MachProjNode(this,proj->_con,Matcher::c_frame_ptr_mask, Opcodes::Op_RegP); case TypeFunc::ReturnAdr: ! return new MachProjNode(this,proj->_con,match->_return_addr_mask,Opcodes::Op_RegP); case TypeFunc::Parms: default: { uint parm_num = proj->_con - TypeFunc::Parms; const Type *t = _domain->field_at(proj->_con); if (t->base() == Type::Half) // 2nd half of Longs and Doubles return new ConNode(Type::TOP); ! Opcodes ideal_reg = t->ideal_reg(); RegMask &rm = match->_calling_convention_mask[parm_num]; return new MachProjNode(this,proj->_con,rm,ideal_reg); } } return NULL;
*** 139,165 **** this->collect_nodes(in_rel, 1, false, false); this->collect_nodes(out_rel, -1, false, false); } #endif ! uint ParmNode::ideal_reg() const { switch( _con ) { case TypeFunc::Control : // fall through case TypeFunc::I_O : // fall through ! case TypeFunc::Memory : return 0; case TypeFunc::FramePtr : // fall through ! case TypeFunc::ReturnAdr: return Op_RegP; default : assert( _con > TypeFunc::Parms, "" ); // fall through case TypeFunc::Parms : { // Type of argument being passed const Type *t = in(0)->as_Start()->_domain->field_at(_con); return t->ideal_reg(); } } ShouldNotReachHere(); ! return 0; } //============================================================================= ReturnNode::ReturnNode(uint edges, Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *retadr ) : Node(edges) { init_req(TypeFunc::Control,cntrl); --- 139,165 ---- this->collect_nodes(in_rel, 1, false, false); this->collect_nodes(out_rel, -1, false, false); } #endif ! Opcodes ParmNode::ideal_reg() const { switch( _con ) { case TypeFunc::Control : // fall through case TypeFunc::I_O : // fall through ! case TypeFunc::Memory : return Opcodes::Op_Node; case TypeFunc::FramePtr : // fall through ! case TypeFunc::ReturnAdr: return Opcodes::Op_RegP; default : assert( _con > TypeFunc::Parms, "" ); // fall through case TypeFunc::Parms : { // Type of argument being passed const Type *t = in(0)->as_Start()->_domain->field_at(_con); return t->ideal_reg(); } } ShouldNotReachHere(); ! return Opcodes::Op_Node; } //============================================================================= ReturnNode::ReturnNode(uint edges, Node *cntrl, Node *i_o, Node *memory, Node *frameptr, Node *retadr ) : Node(edges) { init_req(TypeFunc::Control,cntrl);
*** 704,722 **** Node *CallNode::match( const ProjNode *proj, const Matcher *match ) { switch (proj->_con) { case TypeFunc::Control: case TypeFunc::I_O: case TypeFunc::Memory: ! return new MachProjNode(this,proj->_con,RegMask::Empty,MachProjNode::unmatched_proj); case TypeFunc::Parms+1: // For LONG & DOUBLE returns assert(tf()->range()->field_at(TypeFunc::Parms+1) == Type::HALF, ""); // 2nd half of doubles and longs ! return new MachProjNode(this,proj->_con, RegMask::Empty, (uint)OptoReg::Bad); case TypeFunc::Parms: { // Normal returns ! uint ideal_reg = tf()->range()->field_at(TypeFunc::Parms)->ideal_reg(); OptoRegPair regs = is_CallRuntime() ? match->c_return_value(ideal_reg,true) // Calls into C runtime : match-> return_value(ideal_reg,true); // Calls into compiled Java code RegMask rm = RegMask(regs.first()); if( OptoReg::is_valid(regs.second()) ) --- 704,722 ---- Node *CallNode::match( const ProjNode *proj, const Matcher *match ) { switch (proj->_con) { case TypeFunc::Control: case TypeFunc::I_O: case TypeFunc::Memory: ! return new MachProjNode(this,proj->_con,RegMask::Empty,static_cast<Opcodes>(MachProjNode::projType::unmatched_proj)); case TypeFunc::Parms+1: // For LONG & DOUBLE returns assert(tf()->range()->field_at(TypeFunc::Parms+1) == Type::HALF, ""); // 2nd half of doubles and longs ! return new MachProjNode(this,proj->_con, RegMask::Empty, static_cast<Opcodes>(OptoReg::Bad)); case TypeFunc::Parms: { // Normal returns ! Opcodes ideal_reg = tf()->range()->field_at(TypeFunc::Parms)->ideal_reg(); OptoRegPair regs = is_CallRuntime() ? match->c_return_value(ideal_reg,true) // Calls into C runtime : match-> return_value(ideal_reg,true); // Calls into compiled Java code RegMask rm = RegMask(regs.first()); if( OptoReg::is_valid(regs.second()) )
*** 835,845 **** return this; // more than 1 CheckCastPP } cast = use; } else if (!use->is_Initialize() && !use->is_AddP() && ! use->Opcode() != Op_MemBarStoreStore) { // Expected uses are restricted to a CheckCastPP, an Initialize // node, a MemBarStoreStore (clone) and AddP nodes. If we // encounter any other use (a Phi node can be seen in rare // cases) return this to prevent incorrect optimizations. return this; --- 835,845 ---- return this; // more than 1 CheckCastPP } cast = use; } else if (!use->is_Initialize() && !use->is_AddP() && ! use->Opcode() != Opcodes::Op_MemBarStoreStore) { // Expected uses are restricted to a CheckCastPP, an Initialize // node, a MemBarStoreStore (clone) and AddP nodes. If we // encounter any other use (a Phi node can be seen in rare // cases) return this to prevent incorrect optimizations. return this;
*** 890,900 **** projs->catchall_ioproj = pn; else projs->fallthrough_ioproj = pn; for (DUIterator j = pn->outs(); pn->has_out(j); j++) { Node* e = pn->out(j); ! if (e->Opcode() == Op_CreateEx && e->in(0)->is_CatchProj() && e->outcnt() > 0) { assert(projs->exobj == NULL, "only one"); projs->exobj = e; } } break; --- 890,900 ---- projs->catchall_ioproj = pn; else projs->fallthrough_ioproj = pn; for (DUIterator j = pn->outs(); pn->has_out(j); j++) { Node* e = pn->out(j); ! if (e->Opcode() == Opcodes::Op_CreateEx && e->in(0)->is_CatchProj() && e->outcnt() > 0) { assert(projs->exobj == NULL, "only one"); projs->exobj = e; } } break;
*** 932,948 **** if (can_reshape && cg != NULL && cg->is_mh_late_inline() && !cg->already_attempted()) { // Check whether this MH handle call becomes a candidate for inlining ciMethod* callee = cg->method(); vmIntrinsics::ID iid = callee->intrinsic_id(); if (iid == vmIntrinsics::_invokeBasic) { ! if (in(TypeFunc::Parms)->Opcode() == Op_ConP) { phase->C->prepend_late_inline(cg); set_generator(NULL); } } else { assert(callee->has_member_arg(), "wrong type of call?"); ! if (in(TypeFunc::Parms + callee->arg_size() - 1)->Opcode() == Op_ConP) { phase->C->prepend_late_inline(cg); set_generator(NULL); } } } --- 932,948 ---- if (can_reshape && cg != NULL && cg->is_mh_late_inline() && !cg->already_attempted()) { // Check whether this MH handle call becomes a candidate for inlining ciMethod* callee = cg->method(); vmIntrinsics::ID iid = callee->intrinsic_id(); if (iid == vmIntrinsics::_invokeBasic) { ! if (in(TypeFunc::Parms)->Opcode() == Opcodes::Op_ConP) { phase->C->prepend_late_inline(cg); set_generator(NULL); } } else { assert(callee->has_member_arg(), "wrong type of call?"); ! if (in(TypeFunc::Parms + callee->arg_size() - 1)->Opcode() == Opcodes::Op_ConP) { phase->C->prepend_late_inline(cg); set_generator(NULL); } } }
*** 1087,1098 **** int loc = jvms->locoff() + idx; if (in(loc)->is_top() && idx > 0 && !c->is_top() ) { // If current local idx is top then local idx - 1 could // be a long/double that needs to be killed since top could // represent the 2nd half ofthe long/double. ! uint ideal = in(loc -1)->ideal_reg(); ! if (ideal == Op_RegD || ideal == Op_RegL) { // set other (low index) half to top set_req(loc - 1, in(loc)); } } set_req(loc, c); --- 1087,1098 ---- int loc = jvms->locoff() + idx; if (in(loc)->is_top() && idx > 0 && !c->is_top() ) { // If current local idx is top then local idx - 1 could // be a long/double that needs to be killed since top could // represent the 2nd half ofthe long/double. ! Opcodes ideal = in(loc -1)->ideal_reg(); ! if (ideal == Opcodes::Op_RegD || ideal == Opcodes::Op_RegL) { // set other (low index) half to top set_req(loc - 1, in(loc)); } } set_req(loc, c);
*** 1103,1113 **** return (&n == this); // Always fail except on self } //-------------------------set_next_exception---------------------------------- void SafePointNode::set_next_exception(SafePointNode* n) { ! assert(n == NULL || n->Opcode() == Op_SafePoint, "correct value for next_exception"); if (len() == req()) { if (n != NULL) add_prec(n); } else { set_prec(req(), n); } --- 1103,1113 ---- return (&n == this); // Always fail except on self } //-------------------------set_next_exception---------------------------------- void SafePointNode::set_next_exception(SafePointNode* n) { ! assert(n == NULL || n->Opcode() == Opcodes::Op_SafePoint, "correct value for next_exception"); if (len() == req()) { if (n != NULL) add_prec(n); } else { set_prec(req(), n); }
*** 1118,1128 **** SafePointNode* SafePointNode::next_exception() const { if (len() == req()) { return NULL; } else { Node* n = in(req()); ! assert(n == NULL || n->Opcode() == Op_SafePoint, "no other uses of prec edges"); return (SafePointNode*) n; } } --- 1118,1128 ---- SafePointNode* SafePointNode::next_exception() const { if (len() == req()) { return NULL; } else { Node* n = in(req()); ! assert(n == NULL || n->Opcode() == Opcodes::Op_SafePoint, "no other uses of prec edges"); return (SafePointNode*) n; } }
*** 1184,1194 **** #endif const RegMask &SafePointNode::in_RegMask(uint idx) const { if( idx < TypeFunc::Parms ) return RegMask::Empty; // Values outside the domain represent debug info ! return *(Compile::current()->matcher()->idealreg2debugmask[in(idx)->ideal_reg()]); } const RegMask &SafePointNode::out_RegMask() const { return RegMask::Empty; } --- 1184,1194 ---- #endif const RegMask &SafePointNode::in_RegMask(uint idx) const { if( idx < TypeFunc::Parms ) return RegMask::Empty; // Values outside the domain represent debug info ! return *(Compile::current()->matcher()->idealreg2debugmask[static_cast<uint>(in(idx)->ideal_reg())]); } const RegMask &SafePointNode::out_RegMask() const { return RegMask::Empty; }
*** 1284,1299 **** uint SafePointScalarObjectNode::hash() const { return NO_HASH; } uint SafePointScalarObjectNode::cmp( const Node &n ) const { return (&n == this); // Always fail except on self } ! uint SafePointScalarObjectNode::ideal_reg() const { ! return 0; // No matching to machine instruction } const RegMask &SafePointScalarObjectNode::in_RegMask(uint idx) const { ! return *(Compile::current()->matcher()->idealreg2debugmask[in(idx)->ideal_reg()]); } const RegMask &SafePointScalarObjectNode::out_RegMask() const { return RegMask::Empty; } --- 1284,1299 ---- uint SafePointScalarObjectNode::hash() const { return NO_HASH; } uint SafePointScalarObjectNode::cmp( const Node &n ) const { return (&n == this); // Always fail except on self } ! Opcodes SafePointScalarObjectNode::ideal_reg() const { ! return Opcodes::Op_Node; // No matching to machine instruction } const RegMask &SafePointScalarObjectNode::in_RegMask(uint idx) const { ! return *(Compile::current()->matcher()->idealreg2debugmask[static_cast<uint>(in(idx)->ideal_reg())]); } const RegMask &SafePointScalarObjectNode::out_RegMask() const { return RegMask::Empty; }
*** 1389,1399 **** } } } if (catchproj != NULL && catchproj->outcnt() > 0 && (catchproj->outcnt() > 1 || ! catchproj->unique_out()->Opcode() != Op_Halt)) { assert(catchproj->is_CatchProj(), "must be a CatchProjNode"); Node* nproj = catchproj->clone(); igvn->register_new_node_with_optimizer(nproj); Node *frame = new ParmNode( phase->C->start(), TypeFunc::FramePtr ); --- 1389,1399 ---- } } } if (catchproj != NULL && catchproj->outcnt() > 0 && (catchproj->outcnt() > 1 || ! catchproj->unique_out()->Opcode() != Opcodes::Op_Halt)) { assert(catchproj->is_CatchProj(), "must be a CatchProjNode"); Node* nproj = catchproj->clone(); igvn->register_new_node_with_optimizer(nproj); Node *frame = new ParmNode( phase->C->start(), TypeFunc::FramePtr );
*** 1836,1846 **** if (PrintEliminateLocks) { int locks = 0; int unlocks = 0; for (int i = 0; i < lock_ops.length(); i++) { AbstractLockNode* lock = lock_ops.at(i); ! if (lock->Opcode() == Op_Lock) locks++; else unlocks++; if (Verbose) { lock->dump(1); --- 1836,1846 ---- if (PrintEliminateLocks) { int locks = 0; int unlocks = 0; for (int i = 0; i < lock_ops.length(); i++) { AbstractLockNode* lock = lock_ops.at(i); ! if (lock->Opcode() == Opcodes::Op_Lock) locks++; else unlocks++; if (Verbose) { lock->dump(1);
< prev index next >