src/share/vm/adlc/output_h.cpp

Print this page
rev 5728 : 8029015: PPC64 (part 216): opto: trap based null and range checks


1598       // Set/Save the label, stored in labelOper::_branch_label
1599       fprintf(fp,"  virtual void           label_set( Label* label, uint block_num );\n");
1600       fprintf(fp,"  virtual void           save_label( Label** label, uint* block_num );\n");
1601     }
1602 
1603     // If this instruction contains a methodOper
1604     // Declare Node::methods that set operand method's contents
1605     int method_position = instr->method_position();
1606     if( method_position != -1 ) {
1607       // Set the address method, stored in methodOper::_method
1608       fprintf(fp,"  virtual void           method_set( intptr_t method );\n");
1609     }
1610 
1611     // virtual functions for attributes
1612     //
1613     // Each instruction attribute results in a virtual call of same name.
1614     // The ins_cost is not handled here.
1615     Attribute *attr = instr->_attribs;
1616     bool avoid_back_to_back = false;
1617     while (attr != NULL) {
1618       if (strcmp (attr->_ident,"ins_cost") &&
1619           strncmp(attr->_ident,"ins_field_", 10) != 0 &&
1620           strcmp (attr->_ident,"ins_short_branch")) {
1621         fprintf(fp,"  virtual int            %s() const { return %s; }\n",
1622                 attr->_ident, attr->_val);

1623       }
1624       // Check value for ins_avoid_back_to_back, and if it is true (1), set the flag
1625       if (!strcmp(attr->_ident,"ins_avoid_back_to_back") && attr->int_val(*this) != 0)
1626         avoid_back_to_back = true;



1627       attr = (Attribute *)attr->_next;
1628     }
1629 
1630     // virtual functions for encode and format
1631 
1632     // Virtual function for evaluating the constant.
1633     if (instr->is_mach_constant()) {
1634       fprintf(fp,"  virtual void           eval_constant(Compile* C);\n");
1635     }
1636 
1637     // Output the opcode function and the encode function here using the
1638     // encoding class information in the _insencode slot.
1639     if ( instr->_insencode ) {
1640       if (instr->postalloc_expands()) {
1641         fprintf(fp,"  virtual bool           requires_postalloc_expand() const { return true; }\n");
1642         fprintf(fp,"  virtual void           postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_);\n");
1643       } else {
1644         fprintf(fp,"  virtual void           emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;\n");
1645       }
1646     }




1598       // Set/Save the label, stored in labelOper::_branch_label
1599       fprintf(fp,"  virtual void           label_set( Label* label, uint block_num );\n");
1600       fprintf(fp,"  virtual void           save_label( Label** label, uint* block_num );\n");
1601     }
1602 
1603     // If this instruction contains a methodOper
1604     // Declare Node::methods that set operand method's contents
1605     int method_position = instr->method_position();
1606     if( method_position != -1 ) {
1607       // Set the address method, stored in methodOper::_method
1608       fprintf(fp,"  virtual void           method_set( intptr_t method );\n");
1609     }
1610 
1611     // virtual functions for attributes
1612     //
1613     // Each instruction attribute results in a virtual call of same name.
1614     // The ins_cost is not handled here.
1615     Attribute *attr = instr->_attribs;
1616     bool avoid_back_to_back = false;
1617     while (attr != NULL) {
1618       if (strcmp (attr->_ident, "ins_cost") != 0 &&
1619           strncmp(attr->_ident, "ins_field_", 10) != 0 &&
1620           // Must match function in node.hpp: return type bool, no prefix "ins_".
1621           strcmp (attr->_ident, "ins_is_TrapBasedCheckNode") != 0 &&
1622           strcmp (attr->_ident, "ins_short_branch") != 0) {
1623         fprintf(fp, "  virtual int            %s() const { return %s; }\n", attr->_ident, attr->_val);
1624       }
1625       // Check value for ins_avoid_back_to_back, and if it is true (1), set the flag
1626       if (!strcmp(attr->_ident, "ins_avoid_back_to_back") != 0 && attr->int_val(*this) != 0)
1627         avoid_back_to_back = true;
1628       if (strcmp (attr->_ident, "ins_is_TrapBasedCheckNode") == 0)
1629         fprintf(fp, "  virtual bool           is_TrapBasedCheckNode() const { return %s; }\n", attr->_val);
1630 
1631       attr = (Attribute *)attr->_next;
1632     }
1633 
1634     // virtual functions for encode and format
1635 
1636     // Virtual function for evaluating the constant.
1637     if (instr->is_mach_constant()) {
1638       fprintf(fp,"  virtual void           eval_constant(Compile* C);\n");
1639     }
1640 
1641     // Output the opcode function and the encode function here using the
1642     // encoding class information in the _insencode slot.
1643     if ( instr->_insencode ) {
1644       if (instr->postalloc_expands()) {
1645         fprintf(fp,"  virtual bool           requires_postalloc_expand() const { return true; }\n");
1646         fprintf(fp,"  virtual void           postalloc_expand(GrowableArray <Node *> *nodes, PhaseRegAlloc *ra_);\n");
1647       } else {
1648         fprintf(fp,"  virtual void           emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;\n");
1649       }
1650     }