This commit is contained in:
Julian Dolby 2017-03-10 13:49:09 -05:00
commit a1f8894ba1
2 changed files with 28 additions and 1 deletions

View File

@ -154,7 +154,17 @@ public abstract class IR implements IRView {
int end = bb.getLastInstructionIndex();
result.append("BB").append(bb.getNumber());
if (bb instanceof ExceptionHandlerBasicBlock) {
result.append("<Handler>");
result.append("<Handler> (");
Iterator<TypeReference> catchIter = ((ExceptionHandlerBasicBlock) bb).getCaughtExceptionTypes();
while (catchIter.hasNext()) {
TypeReference next = catchIter.next();
result.append(next);
if (catchIter.hasNext()) {
result.append(",");
}
}
result.append(")");
}
result.append("\n");
for (Iterator it = bb.iteratePhis(); it.hasNext();) {

View File

@ -59,4 +59,21 @@ public class IntStack {
return top == -1;
}
/**
* @return the number of elements in the stack.
*/
public int size() {
return top + 1;
}
/**
* @return the ith int from the bottom of the stack
*/
public int get(int i) {
if (i < 0 || i > top) {
throw new IndexOutOfBoundsException();
}
return state[i];
}
}