src/share/vm/adlc/output_h.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7079317 Sdiff src/share/vm/adlc

src/share/vm/adlc/output_h.cpp

Print this page




1502     fprintf(fp,"public:\n");
1503     fprintf(fp,"  MachOper *opnd_array(uint operand_index) const { assert(operand_index < _num_opnds, \"invalid _opnd_array index\"); return _opnd_array[operand_index]; }\n");
1504     fprintf(fp,"  void      set_opnd_array(uint operand_index, MachOper *operand) { assert(operand_index < _num_opnds, \"invalid _opnd_array index\"); _opnd_array[operand_index] = operand; }\n");
1505     fprintf(fp,"private:\n");
1506     if ( instr->is_ideal_jump() ) {
1507       fprintf(fp,"  virtual void           add_case_label(int index_num, Label* blockLabel) {\n");
1508       fprintf(fp,"                                          _index2label.at_put_grow(index_num, blockLabel);}\n");
1509     }
1510     if( can_cisc_spill() && (instr->cisc_spill_alternate() != NULL) ) {
1511       fprintf(fp,"  const RegMask  *_cisc_RegMask;\n");
1512     }
1513 
1514     out_RegMask(fp);                      // output register mask
1515     fprintf(fp,"  virtual uint           rule() const { return %s_rule; }\n",
1516             instr->_ident);
1517 
1518     // If this instruction contains a labelOper
1519     // Declare Node::methods that set operand Label's contents
1520     int label_position = instr->label_position();
1521     if( label_position != -1 ) {
1522       // Set the label, stored in labelOper::_branch_label
1523       fprintf(fp,"  virtual void           label_set( Label* label, uint block_num );\n");

1524     }
1525 
1526     // If this instruction contains a methodOper
1527     // Declare Node::methods that set operand method's contents
1528     int method_position = instr->method_position();
1529     if( method_position != -1 ) {
1530       // Set the address method, stored in methodOper::_method
1531       fprintf(fp,"  virtual void           method_set( intptr_t method );\n");
1532     }
1533 
1534     // virtual functions for attributes
1535     //
1536     // Each instruction attribute results in a virtual call of same name.
1537     // The ins_cost is not handled here.
1538     Attribute *attr = instr->_attribs;
1539     bool avoid_back_to_back = false;
1540     while (attr != NULL) {
1541       if (strcmp(attr->_ident,"ins_cost") &&
1542           strcmp(attr->_ident,"ins_short_branch")) {
1543         fprintf(fp,"  int             %s() const { return %s; }\n",


1659     bool node_flags_set = false;
1660     // flag: if this instruction matches an ideal 'Copy*' node
1661     if ( instr->is_ideal_copy() != 0 ) {
1662       fprintf(fp,"init_flags(Flag_is_Copy");
1663       node_flags_set = true;
1664     }
1665 
1666     // Is an instruction is a constant?  If so, get its type
1667     Form::DataType  data_type;
1668     const char     *opType = NULL;
1669     const char     *result = NULL;
1670     data_type    = instr->is_chain_of_constant(_globalNames, opType, result);
1671     // Check if this instruction is a constant
1672     if ( data_type != Form::none ) {
1673       if ( node_flags_set ) {
1674         fprintf(fp," | Flag_is_Con");
1675       } else {
1676         fprintf(fp,"init_flags(Flag_is_Con");
1677         node_flags_set = true;
1678       }
1679     }
1680 
1681     // flag: if instruction matches 'If' | 'Goto' | 'CountedLoopEnd | 'Jump'
1682     if ( instr->is_ideal_branch() ) {
1683       if ( node_flags_set ) {
1684         fprintf(fp," | Flag_is_Branch");
1685       } else {
1686         fprintf(fp,"init_flags(Flag_is_Branch");
1687         node_flags_set = true;
1688       }
1689     }
1690 
1691     // flag: if this instruction is cisc alternate
1692     if ( can_cisc_spill() && instr->is_cisc_alternate() ) {
1693       if ( node_flags_set ) {
1694         fprintf(fp," | Flag_is_cisc_alternate");
1695       } else {
1696         fprintf(fp,"init_flags(Flag_is_cisc_alternate");
1697         node_flags_set = true;
1698       }
1699     }
1700 
1701     // flag: if this instruction has short branch form
1702     if ( instr->has_short_branch_form() ) {
1703       if ( node_flags_set ) {
1704         fprintf(fp," | Flag_may_be_short_branch");
1705       } else {
1706         fprintf(fp,"init_flags(Flag_may_be_short_branch");
1707         node_flags_set = true;
1708       }




1502     fprintf(fp,"public:\n");
1503     fprintf(fp,"  MachOper *opnd_array(uint operand_index) const { assert(operand_index < _num_opnds, \"invalid _opnd_array index\"); return _opnd_array[operand_index]; }\n");
1504     fprintf(fp,"  void      set_opnd_array(uint operand_index, MachOper *operand) { assert(operand_index < _num_opnds, \"invalid _opnd_array index\"); _opnd_array[operand_index] = operand; }\n");
1505     fprintf(fp,"private:\n");
1506     if ( instr->is_ideal_jump() ) {
1507       fprintf(fp,"  virtual void           add_case_label(int index_num, Label* blockLabel) {\n");
1508       fprintf(fp,"                                          _index2label.at_put_grow(index_num, blockLabel);}\n");
1509     }
1510     if( can_cisc_spill() && (instr->cisc_spill_alternate() != NULL) ) {
1511       fprintf(fp,"  const RegMask  *_cisc_RegMask;\n");
1512     }
1513 
1514     out_RegMask(fp);                      // output register mask
1515     fprintf(fp,"  virtual uint           rule() const { return %s_rule; }\n",
1516             instr->_ident);
1517 
1518     // If this instruction contains a labelOper
1519     // Declare Node::methods that set operand Label's contents
1520     int label_position = instr->label_position();
1521     if( label_position != -1 ) {
1522       // Set/Save the label, stored in labelOper::_branch_label
1523       fprintf(fp,"  virtual void           label_set( Label* label, uint block_num );\n");
1524       fprintf(fp,"  virtual void           save_label( Label** label, uint* block_num );\n");
1525     }
1526 
1527     // If this instruction contains a methodOper
1528     // Declare Node::methods that set operand method's contents
1529     int method_position = instr->method_position();
1530     if( method_position != -1 ) {
1531       // Set the address method, stored in methodOper::_method
1532       fprintf(fp,"  virtual void           method_set( intptr_t method );\n");
1533     }
1534 
1535     // virtual functions for attributes
1536     //
1537     // Each instruction attribute results in a virtual call of same name.
1538     // The ins_cost is not handled here.
1539     Attribute *attr = instr->_attribs;
1540     bool avoid_back_to_back = false;
1541     while (attr != NULL) {
1542       if (strcmp(attr->_ident,"ins_cost") &&
1543           strcmp(attr->_ident,"ins_short_branch")) {
1544         fprintf(fp,"  int             %s() const { return %s; }\n",


1660     bool node_flags_set = false;
1661     // flag: if this instruction matches an ideal 'Copy*' node
1662     if ( instr->is_ideal_copy() != 0 ) {
1663       fprintf(fp,"init_flags(Flag_is_Copy");
1664       node_flags_set = true;
1665     }
1666 
1667     // Is an instruction is a constant?  If so, get its type
1668     Form::DataType  data_type;
1669     const char     *opType = NULL;
1670     const char     *result = NULL;
1671     data_type    = instr->is_chain_of_constant(_globalNames, opType, result);
1672     // Check if this instruction is a constant
1673     if ( data_type != Form::none ) {
1674       if ( node_flags_set ) {
1675         fprintf(fp," | Flag_is_Con");
1676       } else {
1677         fprintf(fp,"init_flags(Flag_is_Con");
1678         node_flags_set = true;
1679       }










1680     }
1681 
1682     // flag: if this instruction is cisc alternate
1683     if ( can_cisc_spill() && instr->is_cisc_alternate() ) {
1684       if ( node_flags_set ) {
1685         fprintf(fp," | Flag_is_cisc_alternate");
1686       } else {
1687         fprintf(fp,"init_flags(Flag_is_cisc_alternate");
1688         node_flags_set = true;
1689       }
1690     }
1691 
1692     // flag: if this instruction has short branch form
1693     if ( instr->has_short_branch_form() ) {
1694       if ( node_flags_set ) {
1695         fprintf(fp," | Flag_may_be_short_branch");
1696       } else {
1697         fprintf(fp,"init_flags(Flag_may_be_short_branch");
1698         node_flags_set = true;
1699       }


src/share/vm/adlc/output_h.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File