Mercurial > hg > truffle
comparison src/share/vm/adlc/output_h.cpp @ 2014:4de5f4101cfd
Merge
author | iveresov |
---|---|
date | Wed, 08 Dec 2010 17:50:49 -0800 |
parents | 2f644f85485d |
children | 3d42f82cd811 |
comparison
equal
deleted
inserted
replaced
1990:401fbd7ff77c | 2014:4de5f4101cfd |
---|---|
1548 is_pc_relative = true; | 1548 is_pc_relative = true; |
1549 attr = (Attribute *)attr->_next; | 1549 attr = (Attribute *)attr->_next; |
1550 } | 1550 } |
1551 | 1551 |
1552 // virtual functions for encode and format | 1552 // virtual functions for encode and format |
1553 // | 1553 |
1554 // Virtual function for evaluating the constant. | |
1555 if (instr->is_mach_constant()) { | |
1556 fprintf(fp," virtual void eval_constant(Compile* C);\n"); | |
1557 } | |
1558 | |
1554 // Output the opcode function and the encode function here using the | 1559 // Output the opcode function and the encode function here using the |
1555 // encoding class information in the _insencode slot. | 1560 // encoding class information in the _insencode slot. |
1556 if ( instr->_insencode ) { | 1561 if ( instr->_insencode ) { |
1557 fprintf(fp," virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;\n"); | 1562 fprintf(fp," virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;\n"); |
1558 } | 1563 } |
1559 | 1564 |
1560 // virtual function for getting the size of an instruction | 1565 // virtual function for getting the size of an instruction |
1561 if ( instr->_size ) { | 1566 if ( instr->_size ) { |
1562 fprintf(fp," virtual uint size(PhaseRegAlloc *ra_) const;\n"); | 1567 fprintf(fp," virtual uint size(PhaseRegAlloc *ra_) const;\n"); |
1563 } | 1568 } |
1564 | 1569 |
1565 // Return the top-level ideal opcode. | 1570 // Return the top-level ideal opcode. |
1566 // Use MachNode::ideal_Opcode() for nodes based on MachNode class | 1571 // Use MachNode::ideal_Opcode() for nodes based on MachNode class |
1567 // if the ideal_Opcode == Op_Node. | 1572 // if the ideal_Opcode == Op_Node. |
1750 fprintf(fp, " }\n"); | 1755 fprintf(fp, " }\n"); |
1751 | 1756 |
1752 // Virtual methods which are only generated to override base class | 1757 // Virtual methods which are only generated to override base class |
1753 if( instr->expands() || instr->needs_projections() || | 1758 if( instr->expands() || instr->needs_projections() || |
1754 instr->has_temps() || | 1759 instr->has_temps() || |
1760 instr->is_mach_constant() || | |
1755 instr->_matrule != NULL && | 1761 instr->_matrule != NULL && |
1756 instr->num_opnds() != instr->num_unique_opnds() ) { | 1762 instr->num_opnds() != instr->num_unique_opnds() ) { |
1757 fprintf(fp," virtual MachNode *Expand(State *state, Node_List &proj_list, Node* mem);\n"); | 1763 fprintf(fp," virtual MachNode *Expand(State *state, Node_List &proj_list, Node* mem);\n"); |
1758 } | 1764 } |
1759 | 1765 |
1777 fprintf(fp," // Rematerialize %s\n", instr->_ident); | 1783 fprintf(fp," // Rematerialize %s\n", instr->_ident); |
1778 } | 1784 } |
1779 | 1785 |
1780 // Declare short branch methods, if applicable | 1786 // Declare short branch methods, if applicable |
1781 instr->declare_short_branch_methods(fp); | 1787 instr->declare_short_branch_methods(fp); |
1782 | |
1783 // Instructions containing a constant that will be entered into the | |
1784 // float/double table redefine the base virtual function | |
1785 #ifdef SPARC | |
1786 // Sparc doubles entries in the constant table require more space for | |
1787 // alignment. (expires 9/98) | |
1788 int table_entries = (3 * instr->num_consts( _globalNames, Form::idealD )) | |
1789 + instr->num_consts( _globalNames, Form::idealF ); | |
1790 #else | |
1791 int table_entries = instr->num_consts( _globalNames, Form::idealD ) | |
1792 + instr->num_consts( _globalNames, Form::idealF ); | |
1793 #endif | |
1794 if( table_entries != 0 ) { | |
1795 fprintf(fp," virtual int const_size() const {"); | |
1796 fprintf(fp, " return %d;", table_entries); | |
1797 fprintf(fp, " }\n"); | |
1798 } | |
1799 | |
1800 | 1788 |
1801 // See if there is an "ins_pipe" declaration for this instruction | 1789 // See if there is an "ins_pipe" declaration for this instruction |
1802 if (instr->_ins_pipe) { | 1790 if (instr->_ins_pipe) { |
1803 fprintf(fp," static const Pipeline *pipeline_class();\n"); | 1791 fprintf(fp," static const Pipeline *pipeline_class();\n"); |
1804 fprintf(fp," virtual const Pipeline *pipeline() const;\n"); | 1792 fprintf(fp," virtual const Pipeline *pipeline() const;\n"); |