public static int size(TypeType type) {
        switch (type) {
            case DOUBLE:
            case LONG:
                return 2;
            case INT:
            case SHORT:
            case CHAR:
            case BYTE:
            case BOOLEAN:
                return 1;
            case REF:
            case ARRAY_REF:
                return 1;
            default:
                throw new IllegalArgumentException();
        }
    }