remove the block if stack analysis succeeded

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@400 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent d5c76c287d
commit 1163db5bd8
  1. 8
      jode/jode/flow/SpecialBlock.java

@ -29,7 +29,6 @@ public class SpecialBlock extends StructuredBlock {
public static int SWAP = 1; public static int SWAP = 1;
public static int POP = 2; public static int POP = 2;
private static String[] output = { "DUP", "SWAP", "POP" }; private static String[] output = { "DUP", "SWAP", "POP" };
private boolean resolved = false;
/** /**
* The type, one of DUP or SWAP * The type, one of DUP or SWAP
@ -66,20 +65,17 @@ public class SpecialBlock extends StructuredBlock {
} }
public void removePush() { public void removePush() {
resolved = true; /* XXX */
super.removePush(); removeBlock();
} }
public void dumpInstruction(TabbedPrintWriter writer) public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException throws java.io.IOException
{ {
if (!resolved)
writer.println(output[type] writer.println(output[type]
+ ((count == 1) ? "" : "2") + ((count == 1) ? "" : "2")
+ ((depth == 0) ? "" : "_X"+depth)); + ((depth == 0) ? "" : "_X"+depth));
else
writer.println("/* warning: unusual code */");
} }
public boolean doTransformations() { public boolean doTransformations() {

Loading…
Cancel
Save