Bug 883570 - Improve printing for control and compare instructions. r=dvander

This commit is contained in:
Dan Gohman 2013-06-24 16:20:12 -07:00
parent c3652af097
commit 668251680d
2 changed files with 20 additions and 3 deletions

View File

@ -229,11 +229,9 @@ void
MDefinition::printOpcode(FILE *fp)
{
PrintOpcodeName(fp, op());
fprintf(fp, " ");
for (size_t j = 0; j < numOperands(); j++) {
fprintf(fp, " ");
getOperand(j)->printName(fp);
if (j != numOperands() - 1)
fprintf(fp, " ");
}
}
@ -444,6 +442,21 @@ MConstant::printOpcode(FILE *fp)
}
}
void
MControlInstruction::printOpcode(FILE *fp)
{
MDefinition::printOpcode(fp);
for (size_t j = 0; j < numSuccessors(); j++)
fprintf(fp, " block%d", getSuccessor(j)->id());
}
void
MCompare::printOpcode(FILE *fp)
{
MDefinition::printOpcode(fp);
fprintf(fp, " %s", js_CodeName[jsop()]);
}
void
MConstantElements::printOpcode(FILE *fp)
{

View File

@ -814,6 +814,8 @@ class MControlInstruction : public MInstruction
bool isControlInstruction() const {
return true;
}
void printOpcode(FILE *fp);
};
class MTableSwitch
@ -1907,6 +1909,8 @@ class MCompare
return AliasSet::None();
}
void printOpcode(FILE *fp);
protected:
bool congruentTo(MDefinition *const &ins) const {
if (!MBinaryInstruction::congruentTo(ins))