Interface of get/putfield, invoke operators changed

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@101 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 474c229d66
commit af9ce24395
  1. 63
      jode/jode/bytecode/Opcodes.java

@ -517,36 +517,37 @@ public abstract class Opcodes {
case opc_dcmpl: case opc_dcmpg: case opc_dcmpl: case opc_dcmpg:
return createNormal return createNormal
(ca, addr, 1, new CompareToIntOperator (ca, addr, 1, new CompareToIntOperator
(types[3][(opcode-opc_lcmp+3)/2], (opcode-opc_lcmp+3)%2)); (types[3][(opcode-(opc_lcmp-3))/2],
(opcode-(opc_lcmp-3))%2));
case opc_ifeq: case opc_ifne: case opc_ifeq: case opc_ifne:
return createIfGoto return createIfGoto
(ca, addr, 3, addr+stream.readShort(), (ca, addr, 3, addr+stream.readShort(),
new CompareUnaryOperator new CompareUnaryOperator
(BOOL_INT_TYPE, opcode - opc_ifeq+Operator.COMPARE_OP)); (BOOL_INT_TYPE, opcode - (opc_ifeq-Operator.COMPARE_OP)));
case opc_iflt: case opc_ifge: case opc_ifgt: case opc_ifle: case opc_iflt: case opc_ifge: case opc_ifgt: case opc_ifle:
return createIfGoto return createIfGoto
(ca, addr, 3, addr+stream.readShort(), (ca, addr, 3, addr+stream.readShort(),
new CompareUnaryOperator new CompareUnaryOperator
(ALL_INT_TYPE, opcode - opc_ifeq+Operator.COMPARE_OP)); (ALL_INT_TYPE, opcode - (opc_ifeq-Operator.COMPARE_OP)));
case opc_if_icmpeq: case opc_if_icmpne: case opc_if_icmpeq: case opc_if_icmpne:
return createIfGoto return createIfGoto
(ca, addr, 3, addr+stream.readShort(), (ca, addr, 3, addr+stream.readShort(),
new CompareBinaryOperator new CompareBinaryOperator
(Type.tBoolInt, (Type.tBoolInt,
opcode - opc_if_icmpeq+Operator.COMPARE_OP)); opcode - (opc_if_icmpeq-Operator.COMPARE_OP)));
case opc_if_icmplt: case opc_if_icmpge: case opc_if_icmplt: case opc_if_icmpge:
case opc_if_icmpgt: case opc_if_icmple: case opc_if_icmpgt: case opc_if_icmple:
return createIfGoto return createIfGoto
(ca, addr, 3, addr+stream.readShort(), (ca, addr, 3, addr+stream.readShort(),
new CompareBinaryOperator new CompareBinaryOperator
(ALL_INT_TYPE, (ALL_INT_TYPE,
opcode - opc_if_icmpeq+Operator.COMPARE_OP)); opcode - (opc_if_icmpeq-Operator.COMPARE_OP)));
case opc_if_acmpeq: case opc_if_acmpne: case opc_if_acmpeq: case opc_if_acmpne:
return createIfGoto return createIfGoto
(ca, addr, 3, addr+stream.readShort(), (ca, addr, 3, addr+stream.readShort(),
new CompareBinaryOperator new CompareBinaryOperator
(OBJECT_TYPE, (OBJECT_TYPE,
opcode - opc_if_acmpeq+Operator.COMPARE_OP)); opcode - (opc_if_acmpeq-Operator.COMPARE_OP)));
case opc_goto: case opc_goto:
return createGoto return createGoto
(ca, addr, 3, addr+stream.readShort()); (ca, addr, 3, addr+stream.readShort());
@ -602,34 +603,54 @@ public abstract class Opcodes {
return createBlock return createBlock
(ca, addr, 1, new EmptyBlock(new Jump(-1))); (ca, addr, 1, new EmptyBlock(new Jump(-1)));
case opc_getstatic: case opc_getstatic:
case opc_getfield: case opc_getfield: {
CpoolRef field = (CpoolRef)ca.method.classAnalyzer
.getConstant(stream.readUnsignedShort());
return createNormal return createNormal
(ca, addr, 3, new GetFieldOperator (ca, addr, 3, new GetFieldOperator
(ca, opcode == opc_getstatic, (ca, opcode == opc_getstatic,
(CpoolRef)ca.method.classAnalyzer.getConstant Type.tClass(field.getCpoolClass().getName().getString()),
(stream.readUnsignedShort()))); Type.tType(field.getNameAndType().getType().getString()),
field.getNameAndType().getName().getString()));
}
case opc_putstatic: case opc_putstatic:
case opc_putfield: case opc_putfield: {
CpoolRef field = (CpoolRef)ca.method.classAnalyzer
.getConstant(stream.readUnsignedShort());
return createNormal return createNormal
(ca, addr, 3, new PutFieldOperator (ca, addr, 3, new PutFieldOperator
(ca, opcode == opc_putstatic, (ca, opcode == opc_putstatic,
(CpoolRef)ca.method.classAnalyzer.getConstant Type.tClass(field.getCpoolClass().getName().getString()),
(stream.readUnsignedShort()))); Type.tType(field.getNameAndType().getType().getString()),
field.getNameAndType().getName().getString()));
}
case opc_invokevirtual: case opc_invokevirtual:
case opc_invokespecial: case opc_invokespecial:
case opc_invokestatic : case opc_invokestatic : {
CpoolRef field = (CpoolRef)ca.method.classAnalyzer
.getConstant(stream.readUnsignedShort());
return createNormal return createNormal
(ca, addr, 3, new InvokeOperator (ca, addr, 3, new InvokeOperator
(ca, (ca, opcode == opc_invokespecial,
opcode == opc_invokestatic, opcode == opc_invokespecial, Type.tClass(field.getCpoolClass()
(CpoolRef)ca.method.classAnalyzer.getConstant .getName().getString()),
(stream.readUnsignedShort()))); new MethodType(opcode == opc_invokestatic,
field.getNameAndType()
.getType().getString()),
field.getNameAndType().getName().getString()));
}
case opc_invokeinterface: { case opc_invokeinterface: {
CpoolRef field = (CpoolRef)ca.method.classAnalyzer.getConstant
(stream.readUnsignedShort());
FlowBlock fb = createNormal FlowBlock fb = createNormal
(ca, addr, 5, new InvokeOperator (ca, addr, 5, new InvokeOperator
(ca, false, false, (ca, false,
(CpoolRef)ca.method.classAnalyzer.getConstant Type.tClass(field.getCpoolClass()
(stream.readUnsignedShort()))); .getName().getString()),
new MethodType(false, field.getNameAndType()
.getType().getString()),
field.getNameAndType().getName().getString()));
int reserved = stream.readUnsignedShort(); int reserved = stream.readUnsignedShort();
return fb; return fb;
} }
@ -754,7 +775,7 @@ public abstract class Opcodes {
return createIfGoto return createIfGoto
(ca, addr, 3, addr+stream.readShort(), (ca, addr, 3, addr+stream.readShort(),
new CompareUnaryOperator new CompareUnaryOperator
(OBJECT_TYPE, opcode - opc_ifnull+Operator.COMPARE_OP)); (OBJECT_TYPE, opcode - (opc_ifnull-Operator.COMPARE_OP)));
case opc_goto_w: case opc_goto_w:
return createGoto return createGoto
(ca, addr, 5, addr + stream.readInt()); (ca, addr, 5, addr + stream.readInt());

Loading…
Cancel
Save