Mercurial > hg > graal-jvmci-8
changeset 17194:e92cf6db7a07
Handle deleted instructions in CFGPrinter.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Wed, 24 Sep 2014 11:34:40 +0200 |
parents | 9a980af18ec5 |
children | 41a75081678c |
files | graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java |
diffstat | 1 files changed, 24 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Wed Sep 24 09:50:56 2014 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Wed Sep 24 11:34:40 2014 +0200 @@ -450,30 +450,35 @@ for (int i = 0; i < lirInstructions.size(); i++) { LIRInstruction inst = lirInstructions.get(i); - out.printf("nr %4d ", inst.id()).print(COLUMN_END); + if (inst == null) { + out.print("nr -1 ").print(COLUMN_END).print(" instruction ").print("<deleted>").print(COLUMN_END); + out.println(COLUMN_END); + } else { + out.printf("nr %4d ", inst.id()).print(COLUMN_END); - final StringBuilder stateString = new StringBuilder(); - inst.forEachState(new StateProcedure() { + final StringBuilder stateString = new StringBuilder(); + inst.forEachState(new StateProcedure() { - @Override - protected void doState(LIRFrameState state) { - if (state.hasDebugInfo()) { - DebugInfo di = state.debugInfo(); - stateString.append(debugInfoToString(di.getBytecodePosition(), di.getReferenceMap(), di.getCalleeSaveInfo(), target.arch)); - } else { - stateString.append(debugInfoToString(state.topFrame, null, null, target.arch)); + @Override + protected void doState(LIRFrameState state) { + if (state.hasDebugInfo()) { + DebugInfo di = state.debugInfo(); + stateString.append(debugInfoToString(di.getBytecodePosition(), di.getReferenceMap(), di.getCalleeSaveInfo(), target.arch)); + } else { + stateString.append(debugInfoToString(state.topFrame, null, null, target.arch)); + } } + }); + if (stateString.length() > 0) { + int level = out.indentationLevel(); + out.adjustIndentation(-level); + out.print(" st ").print(HOVER_START).print("st").print(HOVER_SEP).print(stateString.toString()).print(HOVER_END).print(COLUMN_END); + out.adjustIndentation(level); } - }); - if (stateString.length() > 0) { - int level = out.indentationLevel(); - out.adjustIndentation(-level); - out.print(" st ").print(HOVER_START).print("st").print(HOVER_SEP).print(stateString.toString()).print(HOVER_END).print(COLUMN_END); - out.adjustIndentation(level); + + out.print(" instruction ").print(inst.toString()).print(COLUMN_END); + out.println(COLUMN_END); } - - out.print(" instruction ").print(inst.toString()).print(COLUMN_END); - out.println(COLUMN_END); } end("IR"); }