src/share/vm/adlc/output_h.cpp

Print this page
rev 5808 : 8030863: PPC64: (part 220): ConstantTableBase for calls between args and jvms


1648         fprintf(fp,"  virtual void           emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;\n");
1649       }
1650     }
1651 
1652     // virtual function for getting the size of an instruction
1653     if ( instr->_size ) {
1654       fprintf(fp,"  virtual uint           size(PhaseRegAlloc *ra_) const;\n");
1655     }
1656 
1657     // Return the top-level ideal opcode.
1658     // Use MachNode::ideal_Opcode() for nodes based on MachNode class
1659     // if the ideal_Opcode == Op_Node.
1660     if ( strcmp("Node", instr->ideal_Opcode(_globalNames)) != 0 ||
1661          strcmp("MachNode", instr->mach_base_class(_globalNames)) != 0 ) {
1662       fprintf(fp,"  virtual int            ideal_Opcode() const { return Op_%s; }\n",
1663             instr->ideal_Opcode(_globalNames) );
1664     }
1665 
1666     if (instr->needs_constant_base() &&
1667         !instr->is_mach_constant()) {  // These inherit the funcion from MachConstantNode.
1668       fprintf(fp,"  virtual uint           mach_constant_base_node_input() const { return req()-1; }\n");








1669     }
1670 
1671     // Allow machine-independent optimization, invert the sense of the IF test
1672     if( instr->is_ideal_if() ) {
1673       fprintf(fp,"  virtual void           negate() { \n");
1674       // Identify which operand contains the negate(able) ideal condition code
1675       int   idx = 0;
1676       instr->_components.reset();
1677       for( Component *comp; (comp = instr->_components.iter()) != NULL; ) {
1678         // Check that component is an operand
1679         Form *form = (Form*)_globalNames[comp->_type];
1680         OperandForm *opForm = form ? form->is_operand() : NULL;
1681         if( opForm == NULL ) continue;
1682 
1683         // Lookup the position of the operand in the instruction.
1684         if( opForm->is_ideal_bool() ) {
1685           idx = instr->operand_position(comp->_name, comp->_usedef);
1686           assert( idx != NameList::Not_in_list, "Did not find component in list that contained it.");
1687           break;
1688         }




1648         fprintf(fp,"  virtual void           emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;\n");
1649       }
1650     }
1651 
1652     // virtual function for getting the size of an instruction
1653     if ( instr->_size ) {
1654       fprintf(fp,"  virtual uint           size(PhaseRegAlloc *ra_) const;\n");
1655     }
1656 
1657     // Return the top-level ideal opcode.
1658     // Use MachNode::ideal_Opcode() for nodes based on MachNode class
1659     // if the ideal_Opcode == Op_Node.
1660     if ( strcmp("Node", instr->ideal_Opcode(_globalNames)) != 0 ||
1661          strcmp("MachNode", instr->mach_base_class(_globalNames)) != 0 ) {
1662       fprintf(fp,"  virtual int            ideal_Opcode() const { return Op_%s; }\n",
1663             instr->ideal_Opcode(_globalNames) );
1664     }
1665 
1666     if (instr->needs_constant_base() &&
1667         !instr->is_mach_constant()) {  // These inherit the funcion from MachConstantNode.
1668       fprintf(fp,"  virtual uint           mach_constant_base_node_input() const { ");
1669       if (instr->is_ideal_call() != Form::invalid_type &&
1670           instr->is_ideal_call() != Form::JAVA_LEAF) {
1671         // MachConstantBase goes behind arguments, but before jvms.
1672         fprintf(fp,"assert(tf() && tf()->domain(), \"\"); return tf()->domain()->cnt();");
1673       } else {
1674         fprintf(fp,"return req()-1;");
1675       }
1676       fprintf(fp," }\n");
1677     }
1678 
1679     // Allow machine-independent optimization, invert the sense of the IF test
1680     if( instr->is_ideal_if() ) {
1681       fprintf(fp,"  virtual void           negate() { \n");
1682       // Identify which operand contains the negate(able) ideal condition code
1683       int   idx = 0;
1684       instr->_components.reset();
1685       for( Component *comp; (comp = instr->_components.iter()) != NULL; ) {
1686         // Check that component is an operand
1687         Form *form = (Form*)_globalNames[comp->_type];
1688         OperandForm *opForm = form ? form->is_operand() : NULL;
1689         if( opForm == NULL ) continue;
1690 
1691         // Lookup the position of the operand in the instruction.
1692         if( opForm->is_ideal_bool() ) {
1693           idx = instr->operand_position(comp->_name, comp->_usedef);
1694           assert( idx != NameList::Not_in_list, "Did not find component in list that contained it.");
1695           break;
1696         }