fix, pop operator now special block

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@197 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent cbe21f61c6
commit 41b539d46f
  1. 15
      jode/jode/bytecode/Opcodes.java

@ -543,7 +543,7 @@ public abstract class Opcodes {
} }
if (opcode == opc_athrow if (opcode == opc_athrow
&& opcode >= opc_ireturn && opcode <= opc_return) || opcode >= opc_ireturn && opcode <= opc_return)
return new int[] { 1 }; return new int[] { 1 };
if (opcode >= opc_ifeq && opcode <= opc_if_acmpne) if (opcode >= opc_ifeq && opcode <= opc_if_acmpne)
return new int[] { 3, addr + 3, addr + stream.readShort() }; return new int[] { 3, addr + 3, addr + stream.readShort() };
@ -572,7 +572,8 @@ public abstract class Opcodes {
int opcode = stream.readUnsignedByte(); int opcode = stream.readUnsignedByte();
switch (opcode) { switch (opcode) {
case opc_nop: case opc_nop:
return createNormal(ca, addr, 1, new NopOperator()); return createBlock
(ca, addr, 1, new EmptyBlock(new Jump(addr+1)));
case opc_aconst_null: case opc_aconst_null:
return createNormal return createNormal
(ca, addr, 1, new ConstOperator(OBJECT_TYPE, "null")); (ca, addr, 1, new ConstOperator(OBJECT_TYPE, "null"));
@ -678,8 +679,8 @@ public abstract class Opcodes {
(ca, addr, 1, new ArrayStoreOperator (ca, addr, 1, new ArrayStoreOperator
(types[1][opcode - opc_iastore])); (types[1][opcode - opc_iastore]));
case opc_pop: case opc_pop2: case opc_pop: case opc_pop2:
return createNormal return createSpecial
(ca, addr, 1, new PopOperator(opcode - opc_pop + 1)); (ca, addr, 1, SpecialBlock.POP, opcode - opc_pop + 1, 0);
case opc_dup: case opc_dup_x1: case opc_dup_x2: case opc_dup: case opc_dup_x1: case opc_dup_x2:
case opc_dup2: case opc_dup2_x1: case opc_dup2_x2: case opc_dup2: case opc_dup2_x1: case opc_dup2_x2:
return createSpecial return createSpecial
@ -829,8 +830,7 @@ public abstract class Opcodes {
/* Address -1 is interpreted as end of method */ /* Address -1 is interpreted as end of method */
Type retType = Type.tSubType(ca.getMethod().getReturnType()); Type retType = Type.tSubType(ca.getMethod().getReturnType());
return createBlock return createBlock
(ca, addr, 1, new ReturnBlock(new NopOperator(retType), (ca, addr, 1, new ReturnBlock(new NopOperator(retType)));
new Jump(-1)));
} }
case opc_return: case opc_return:
return createBlock return createBlock
@ -904,8 +904,7 @@ public abstract class Opcodes {
case opc_athrow: case opc_athrow:
return createBlock return createBlock
(ca, addr, 1, (ca, addr, 1,
new ThrowBlock(new NopOperator(Type.tUObject), new ThrowBlock(new NopOperator(Type.tUObject)));
new Jump(-1)));
case opc_checkcast: { case opc_checkcast: {
Type type = Type.tClassOrArray Type type = Type.tClassOrArray
(cpool.getClassName(stream.readUnsignedShort())); (cpool.getClassName(stream.readUnsignedShort()));

Loading…
Cancel
Save