int argCount = arguments.size();
// stack each of the arguments to the constructor
for (int i = 0; i < argCount; i++) {
Type argType = argumentTypes.get(i);
Type paramType = paramTypes.get(i);
int paramCount = (paramType.getNBytes() > 4 ? 2 : 1);
// track extra storage used after type conversion
extraParams += (paramCount);
arguments.get(i).compile(mv, compileContext);
compileTypeConversion(argType, paramType, mv, compileContext);
}
// construct the exception
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, instantiatedClassName, "<init>", getDescriptor());
// modify the stack height to account for the removed exception and params
compileContext.addStackCount(-(extraParams+1));
} else {
// TODO !!! implement compilation for array types !!!
if (arrayDimCount == 1) {
// we can use a NEWARRAY or ANEWARRAY
Type baseType = type.getBaseType();
// compile first array dimension adds 1 to stack
arrayDims.get(0).compile(mv, compileContext);
// compile new array op -- pops 1 and adds 1 to stack
if (baseType.isObject()) {
mv.visitTypeInsn(Opcodes.ANEWARRAY, baseType.getInternalName());
// } else if (baseType.isArray()) { // cannot happen!!!
} else {
int operand = 0;
if (baseType.equals(Type.Z)) {
operand = Opcodes.T_BOOLEAN;
} else if (baseType.equals(Type.B)) {
operand = Opcodes.T_BYTE;
} else if (baseType.equals(Type.S)) {
operand = Opcodes.T_SHORT;
} else if (baseType.equals(Type.C)) {
operand = Opcodes.T_CHAR;
} else if (baseType.equals(Type.I)) {
operand = Opcodes.T_INT;
} else if (baseType.equals(Type.J)) {
operand = Opcodes.T_LONG;
} else if (baseType.equals(Type.F)) {
operand = Opcodes.T_FLOAT;
} else if (baseType.equals(Type.D)) {
operand = Opcodes.T_DOUBLE;
}
mv.visitIntInsn(Opcodes.NEWARRAY, operand);
}
} else {