1613 // Each instruction attribute results in a virtual call of same name. |
1613 // Each instruction attribute results in a virtual call of same name. |
1614 // The ins_cost is not handled here. |
1614 // The ins_cost is not handled here. |
1615 Attribute *attr = instr->_attribs; |
1615 Attribute *attr = instr->_attribs; |
1616 bool avoid_back_to_back = false; |
1616 bool avoid_back_to_back = false; |
1617 while (attr != NULL) { |
1617 while (attr != NULL) { |
1618 if (strcmp (attr->_ident,"ins_cost") && |
1618 if (strcmp (attr->_ident, "ins_cost") != 0 && |
1619 strncmp(attr->_ident,"ins_field_", 10) != 0 && |
1619 strncmp(attr->_ident, "ins_field_", 10) != 0 && |
1620 strcmp (attr->_ident,"ins_short_branch")) { |
1620 // Must match function in node.hpp: return type bool, no prefix "ins_". |
1621 fprintf(fp," virtual int %s() const { return %s; }\n", |
1621 strcmp (attr->_ident, "ins_is_TrapBasedCheckNode") != 0 && |
1622 attr->_ident, attr->_val); |
1622 strcmp (attr->_ident, "ins_short_branch") != 0) { |
|
1623 fprintf(fp, " virtual int %s() const { return %s; }\n", attr->_ident, attr->_val); |
1623 } |
1624 } |
1624 // Check value for ins_avoid_back_to_back, and if it is true (1), set the flag |
1625 // 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 if (!strcmp(attr->_ident, "ins_avoid_back_to_back") != 0 && attr->int_val(*this) != 0) |
1626 avoid_back_to_back = true; |
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 |
1627 attr = (Attribute *)attr->_next; |
1631 attr = (Attribute *)attr->_next; |
1628 } |
1632 } |
1629 |
1633 |
1630 // virtual functions for encode and format |
1634 // virtual functions for encode and format |
1631 |
1635 |