Bug 883570 - Basic dumping utilities for MBasicBlock and MIRGraph r=dvander

This commit is contained in:
Dan Gohman 2013-06-24 16:19:59 -07:00
parent 0562f7aa5d
commit c3652af097
2 changed files with 29 additions and 0 deletions

View File

@ -1063,3 +1063,28 @@ MBasicBlock::immediateDominatorBranch(BranchDirection *pdirection)
return NULL;
}
void
MIRGraph::dump(FILE *fp)
{
#ifdef DEBUG
for (MBasicBlockIterator iter(begin()); iter != end(); iter++) {
iter->dump(fp);
}
#endif
}
void
MBasicBlock::dump(FILE *fp)
{
#ifdef DEBUG
for (MPhiIterator iter(phisBegin()); iter != phisEnd(); iter++) {
iter->printOpcode(fp);
fprintf(fp, "\n");
}
for (MInstructionIterator iter(begin()); iter != end(); iter++) {
iter->printOpcode(fp);
fprintf(fp, "\n");
}
#endif
}

View File

@ -468,6 +468,8 @@ class MBasicBlock : public TempObject, public InlineListNode<MBasicBlock>
void dumpStack(FILE *fp);
void dump(FILE *fp);
// Track bailouts by storing the current pc in MIR instruction added at this
// cycle. This is also used for tracking calls when profiling.
void updateTrackedPc(jsbytecode *pc) {
@ -666,6 +668,8 @@ class MIRGraph
// lazilly insert an MParSlice instruction in the entry block and
// return the definition.
MDefinition *parSlice();
void dump(FILE *fp);
};
class MDefinitionIterator