|
|
@ -18,8 +18,8 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
package jode.decompiler; |
|
|
|
package jode.decompiler; |
|
|
|
import jode.Type; |
|
|
|
import jode.type.Type; |
|
|
|
import jode.MethodType; |
|
|
|
import jode.type.MethodType; |
|
|
|
import jode.expr.*; |
|
|
|
import jode.expr.*; |
|
|
|
import jode.flow.*; |
|
|
|
import jode.flow.*; |
|
|
|
import jode.bytecode.*; |
|
|
|
import jode.bytecode.*; |
|
|
@ -118,7 +118,7 @@ public abstract class Opcodes implements jode.bytecode.Opcodes { |
|
|
|
* @exception ClassFormatError if an invalid opcode is detected. |
|
|
|
* @exception ClassFormatError if an invalid opcode is detected. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static StructuredBlock readOpcode(Instruction instr, |
|
|
|
public static StructuredBlock readOpcode(Instruction instr, |
|
|
|
CodeAnalyzer ca) |
|
|
|
CodeAnalyzer ca) |
|
|
|
throws ClassFormatError |
|
|
|
throws ClassFormatError |
|
|
|
{ |
|
|
|
{ |
|
|
|
int opcode = instr.opcode; |
|
|
|
int opcode = instr.opcode; |
|
|
@ -197,7 +197,7 @@ public abstract class Opcodes implements jode.bytecode.Opcodes { |
|
|
|
int operation = Operator.ADD_OP; |
|
|
|
int operation = Operator.ADD_OP; |
|
|
|
if (value < 0) { |
|
|
|
if (value < 0) { |
|
|
|
value = -value; |
|
|
|
value = -value; |
|
|
|
operation = Operator.NEG_OP; |
|
|
|
operation = Operator.SUB_OP; |
|
|
|
} |
|
|
|
} |
|
|
|
LocalInfo li = ca.getLocalInfo(instr.addr, instr.localSlot); |
|
|
|
LocalInfo li = ca.getLocalInfo(instr.addr, instr.localSlot); |
|
|
|
li.setType(Type.tUInt); |
|
|
|
li.setType(Type.tUInt); |
|
|
@ -228,7 +228,7 @@ public abstract class Opcodes implements jode.bytecode.Opcodes { |
|
|
|
return createNormal |
|
|
|
return createNormal |
|
|
|
(ca, instr, new CompareToIntOperator |
|
|
|
(ca, instr, new CompareToIntOperator |
|
|
|
(types[3][(opcode-(opc_lcmp-3))/2], |
|
|
|
(types[3][(opcode-(opc_lcmp-3))/2], |
|
|
|
(opcode-(opc_lcmp-3))%2)); |
|
|
|
(opcode == opc_fcmpg || opcode == opc_dcmpg))); |
|
|
|
case opc_ifeq: case opc_ifne: |
|
|
|
case opc_ifeq: case opc_ifne: |
|
|
|
return createIfGoto |
|
|
|
return createIfGoto |
|
|
|
(ca, instr, |
|
|
|
(ca, instr, |
|
|
@ -320,7 +320,7 @@ public abstract class Opcodes implements jode.bytecode.Opcodes { |
|
|
|
} |
|
|
|
} |
|
|
|
case opc_new: { |
|
|
|
case opc_new: { |
|
|
|
Type type = Type.tType((String) instr.objData); |
|
|
|
Type type = Type.tType((String) instr.objData); |
|
|
|
type.useType(); |
|
|
|
ca.useType(type); |
|
|
|
return createNormal(ca, instr, new NewOperator(type)); |
|
|
|
return createNormal(ca, instr, new NewOperator(type)); |
|
|
|
} |
|
|
|
} |
|
|
|
case opc_arraylength: |
|
|
|
case opc_arraylength: |
|
|
@ -332,13 +332,13 @@ public abstract class Opcodes implements jode.bytecode.Opcodes { |
|
|
|
new ThrowBlock(new NopOperator(Type.tUObject))); |
|
|
|
new ThrowBlock(new NopOperator(Type.tUObject))); |
|
|
|
case opc_checkcast: { |
|
|
|
case opc_checkcast: { |
|
|
|
Type type = Type.tType((String) instr.objData); |
|
|
|
Type type = Type.tType((String) instr.objData); |
|
|
|
type.useType(); |
|
|
|
ca.useType(type); |
|
|
|
return createNormal |
|
|
|
return createNormal |
|
|
|
(ca, instr, new CheckCastOperator(type)); |
|
|
|
(ca, instr, new CheckCastOperator(type)); |
|
|
|
} |
|
|
|
} |
|
|
|
case opc_instanceof: { |
|
|
|
case opc_instanceof: { |
|
|
|
Type type = Type.tType((String) instr.objData); |
|
|
|
Type type = Type.tType((String) instr.objData); |
|
|
|
type.useType(); |
|
|
|
ca.useType(type); |
|
|
|
return createNormal |
|
|
|
return createNormal |
|
|
|
(ca, instr, new InstanceOfOperator(type)); |
|
|
|
(ca, instr, new InstanceOfOperator(type)); |
|
|
|
} |
|
|
|
} |
|
|
@ -350,7 +350,7 @@ public abstract class Opcodes implements jode.bytecode.Opcodes { |
|
|
|
new MonitorExitOperator()); |
|
|
|
new MonitorExitOperator()); |
|
|
|
case opc_multianewarray: { |
|
|
|
case opc_multianewarray: { |
|
|
|
Type type = Type.tType((String) instr.objData); |
|
|
|
Type type = Type.tType((String) instr.objData); |
|
|
|
type.useType(); |
|
|
|
ca.useType(type); |
|
|
|
int dimension = instr.intData; |
|
|
|
int dimension = instr.intData; |
|
|
|
return createNormal(ca, instr, |
|
|
|
return createNormal(ca, instr, |
|
|
|
new NewArrayOperator(type, dimension)); |
|
|
|
new NewArrayOperator(type, dimension)); |
|
|
|