type = Type.INT;
}
insList.append(insFactory.createInvoke(STACK_CLASS, getPopMethod(type), type, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
insList.append(InstructionFactory.createStore(type, i));
} else if (type == null) {
insList.append(new ACONST_NULL());
insList.append(InstructionFactory.createStore(new ObjectType("<null object>"), i));
} else if (type instanceof UninitializedObjectType) {
// No uninitilaized objects should be found
// in the local variables.
} else if (type instanceof ReferenceType) {
insList.append(InstructionFactory.createLoad(STACK_TYPE, method.getMaxLocals()+1));
insList.append(insFactory.createInvoke(STACK_CLASS, getPopMethod(Type.OBJECT), Type.OBJECT, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
if (!type.equals(Type.OBJECT) && (!type.equals(Type.NULL))) {
insList.append(insFactory.createCast(Type.OBJECT, type));
}
insList.append(InstructionFactory.createStore(type, i));
}
}
InvokeInstruction inv = (InvokeInstruction) handle.getInstruction();
Type returnType = getReturnType(method.getConstantPool().getConstantPool(), inv.getIndex());
boolean skipFirst = returnType.getSize() > 0;
// restore stack
OperandStack os = frame.getStack();
for (int i = os.size() - 1; i >= (skipFirst ? 1 : 0); i--) {
Type type = os.peek(i);
if (type instanceof BasicType) {
if (type.getSize() < 2 && !type.equals(Type.FLOAT)) {
type = Type.INT;
}
insList.append(InstructionFactory.createLoad(STACK_TYPE, method.getMaxLocals()+1));
insList.append(insFactory.createInvoke(STACK_CLASS, getPopMethod(type), type, Type.NO_ARGS, Constants.INVOKEVIRTUAL));
} else if (type == null) {
insList.append(new ACONST_NULL());
} else if (type instanceof UninitializedObjectType) {
// After the remove of new, there shouldn't be a
// uninitialized object on the stack
} else if (type instanceof ReferenceType) {
insList.append(InstructionFactory.createLoad(STACK_TYPE, method.getMaxLocals()+1));