Mercurial > hg > graal-compiler
comparison src/share/vm/adlc/output_h.cpp @ 3842:c7b60b601eb4
7069452: Cleanup NodeFlags
Summary: Remove flags which duplicate information in Node::NodeClasses.
Reviewed-by: never
author | kvn |
---|---|
date | Wed, 27 Jul 2011 17:28:36 -0700 |
parents | 3d42f82cd811 |
children | 95134e034042 |
comparison
equal
deleted
inserted
replaced
3841:0f34fdee809e | 3842:c7b60b601eb4 |
---|---|
1534 // virtual functions for attributes | 1534 // virtual functions for attributes |
1535 // | 1535 // |
1536 // Each instruction attribute results in a virtual call of same name. | 1536 // Each instruction attribute results in a virtual call of same name. |
1537 // The ins_cost is not handled here. | 1537 // The ins_cost is not handled here. |
1538 Attribute *attr = instr->_attribs; | 1538 Attribute *attr = instr->_attribs; |
1539 bool is_pc_relative = false; | |
1540 while (attr != NULL) { | 1539 while (attr != NULL) { |
1541 if (strcmp(attr->_ident,"ins_cost") && | 1540 if (strcmp(attr->_ident,"ins_cost") && |
1542 strcmp(attr->_ident,"ins_pc_relative")) { | 1541 strcmp(attr->_ident,"ins_short_branch")) { |
1543 fprintf(fp," int %s() const { return %s; }\n", | 1542 fprintf(fp," int %s() const { return %s; }\n", |
1544 attr->_ident, attr->_val); | 1543 attr->_ident, attr->_val); |
1545 } | 1544 } |
1546 // Check value for ins_pc_relative, and if it is true (1), set the flag | |
1547 if (!strcmp(attr->_ident,"ins_pc_relative") && attr->int_val(*this) != 0) | |
1548 is_pc_relative = true; | |
1549 attr = (Attribute *)attr->_next; | 1545 attr = (Attribute *)attr->_next; |
1550 } | 1546 } |
1551 | 1547 |
1552 // virtual functions for encode and format | 1548 // virtual functions for encode and format |
1553 | 1549 |
1655 } | 1651 } |
1656 | 1652 |
1657 fprintf(fp," _num_opnds = %d; _opnds = _opnd_array; ", instr->num_opnds()); | 1653 fprintf(fp," _num_opnds = %d; _opnds = _opnd_array; ", instr->num_opnds()); |
1658 | 1654 |
1659 bool node_flags_set = false; | 1655 bool node_flags_set = false; |
1660 // flag: if this instruction matches an ideal 'Goto' node | |
1661 if ( instr->is_ideal_goto() ) { | |
1662 fprintf(fp,"init_flags(Flag_is_Goto"); | |
1663 node_flags_set = true; | |
1664 } | |
1665 | |
1666 // flag: if this instruction matches an ideal 'Copy*' node | 1656 // flag: if this instruction matches an ideal 'Copy*' node |
1667 if ( instr->is_ideal_copy() != 0 ) { | 1657 if ( instr->is_ideal_copy() != 0 ) { |
1668 if ( node_flags_set ) { | 1658 fprintf(fp,"init_flags(Flag_is_Copy"); |
1669 fprintf(fp," | Flag_is_Copy"); | 1659 node_flags_set = true; |
1670 } else { | |
1671 fprintf(fp,"init_flags(Flag_is_Copy"); | |
1672 node_flags_set = true; | |
1673 } | |
1674 } | 1660 } |
1675 | 1661 |
1676 // Is an instruction is a constant? If so, get its type | 1662 // Is an instruction is a constant? If so, get its type |
1677 Form::DataType data_type; | 1663 Form::DataType data_type; |
1678 const char *opType = NULL; | 1664 const char *opType = NULL; |
1706 fprintf(fp,"init_flags(Flag_is_cisc_alternate"); | 1692 fprintf(fp,"init_flags(Flag_is_cisc_alternate"); |
1707 node_flags_set = true; | 1693 node_flags_set = true; |
1708 } | 1694 } |
1709 } | 1695 } |
1710 | 1696 |
1711 // flag: if this instruction is pc relative | |
1712 if ( is_pc_relative ) { | |
1713 if ( node_flags_set ) { | |
1714 fprintf(fp," | Flag_is_pc_relative"); | |
1715 } else { | |
1716 fprintf(fp,"init_flags(Flag_is_pc_relative"); | |
1717 node_flags_set = true; | |
1718 } | |
1719 } | |
1720 | |
1721 // flag: if this instruction has short branch form | 1697 // flag: if this instruction has short branch form |
1722 if ( instr->has_short_branch_form() ) { | 1698 if ( instr->has_short_branch_form() ) { |
1723 if ( node_flags_set ) { | 1699 if ( node_flags_set ) { |
1724 fprintf(fp," | Flag_may_be_short_branch"); | 1700 fprintf(fp," | Flag_may_be_short_branch"); |
1725 } else { | 1701 } else { |
1739 } | 1715 } |
1740 } | 1716 } |
1741 | 1717 |
1742 if ( node_flags_set ) { | 1718 if ( node_flags_set ) { |
1743 fprintf(fp,"); "); | 1719 fprintf(fp,"); "); |
1744 } | |
1745 | |
1746 if (instr->is_ideal_unlock() || instr->is_ideal_call_leaf()) { | |
1747 fprintf(fp,"clear_flag(Flag_is_safepoint_node); "); | |
1748 } | 1720 } |
1749 | 1721 |
1750 fprintf(fp,"}\n"); | 1722 fprintf(fp,"}\n"); |
1751 | 1723 |
1752 // size_of, used by base class's clone to obtain the correct size. | 1724 // size_of, used by base class's clone to obtain the correct size. |