Package com.facebook.presto.byteCode

Examples of com.facebook.presto.byteCode.Block.invokeStatic()


                    block.append(ifWasNullPopAndGoto(context, end, long.class, value.getType()));
                    block.invokeStatic(Operations.class, "castToLong", long.class, value.getType());
                    return typedByteCodeNode(block.visitLabel(end), long.class);
                case "DOUBLE":
                    block.append(ifWasNullPopAndGoto(context, end, double.class, value.getType()));
                    block.invokeStatic(Operations.class, "castToDouble", double.class, value.getType());
                    return typedByteCodeNode(block.visitLabel(end), double.class);
                case "VARCHAR":
                    block.append(ifWasNullPopAndGoto(context, end, Slice.class, value.getType()));
                    block.invokeStatic(Operations.class, "castToSlice", Slice.class, value.getType());
                    return typedByteCodeNode(block.visitLabel(end), Slice.class);
View Full Code Here


                    block.append(ifWasNullPopAndGoto(context, end, double.class, value.getType()));
                    block.invokeStatic(Operations.class, "castToDouble", double.class, value.getType());
                    return typedByteCodeNode(block.visitLabel(end), double.class);
                case "VARCHAR":
                    block.append(ifWasNullPopAndGoto(context, end, Slice.class, value.getType()));
                    block.invokeStatic(Operations.class, "castToSlice", Slice.class, value.getType());
                    return typedByteCodeNode(block.visitLabel(end), Slice.class);
            }
        }
        throw new UnsupportedOperationException("Unsupported type: " + node.getType());
    }
View Full Code Here

        block.append(coerceToType(context, right, type).getNode());
        block.append(ifWasNullPopAndGoto(context, end, type, type, right.getType()));

        switch (node.getType()) {
            case ADD:
                block.invokeStatic(Operations.class, "add", type, type, type);
                break;
            case SUBTRACT:
                block.invokeStatic(Operations.class, "subtract", type, type, type);
                break;
            case MULTIPLY:
View Full Code Here

        switch (node.getType()) {
            case ADD:
                block.invokeStatic(Operations.class, "add", type, type, type);
                break;
            case SUBTRACT:
                block.invokeStatic(Operations.class, "subtract", type, type, type);
                break;
            case MULTIPLY:
                block.invokeStatic(Operations.class, "multiply", type, type, type);
                break;
            case DIVIDE:
View Full Code Here

                break;
            case SUBTRACT:
                block.invokeStatic(Operations.class, "subtract", type, type, type);
                break;
            case MULTIPLY:
                block.invokeStatic(Operations.class, "multiply", type, type, type);
                break;
            case DIVIDE:
                block.invokeStatic(Operations.class, "divide", type, type, type);
                break;
            case MODULUS:
View Full Code Here

                break;
            case MULTIPLY:
                block.invokeStatic(Operations.class, "multiply", type, type, type);
                break;
            case DIVIDE:
                block.invokeStatic(Operations.class, "divide", type, type, type);
                break;
            case MODULUS:
                block.invokeStatic(Operations.class, "modulus", type, type, type);
                break;
            default:
View Full Code Here

                break;
            case DIVIDE:
                block.invokeStatic(Operations.class, "divide", type, type, type);
                break;
            case MODULUS:
                block.invokeStatic(Operations.class, "modulus", type, type, type);
                break;
            default:
                throw new UnsupportedOperationException(format("not yet implemented: %s(%s, %s)", node.getType(), left.getType(), right.getType()));
        }
        return typedByteCodeNode(block.visitLabel(end), type);
View Full Code Here

    public static ByteCodeNode boxPrimitive(CompilerContext context, Class<?> type)
    {
        Block block = new Block(context).comment("box primitive");
        if (type == long.class) {
            return block.invokeStatic(Long.class, "valueOf", Long.class, long.class);
        }
        if (type == double.class) {
            return block.invokeStatic(Double.class, "valueOf", Double.class, double.class);
        }
        if (type == boolean.class) {
View Full Code Here

        Block block = new Block(context).comment("box primitive");
        if (type == long.class) {
            return block.invokeStatic(Long.class, "valueOf", Long.class, long.class);
        }
        if (type == double.class) {
            return block.invokeStatic(Double.class, "valueOf", Double.class, double.class);
        }
        if (type == boolean.class) {
            return block.invokeStatic(Boolean.class, "valueOf", Boolean.class, boolean.class);
        }
        if (type.isPrimitive()) {
View Full Code Here

        }
        if (type == double.class) {
            return block.invokeStatic(Double.class, "valueOf", Double.class, double.class);
        }
        if (type == boolean.class) {
            return block.invokeStatic(Boolean.class, "valueOf", Boolean.class, boolean.class);
        }
        if (type.isPrimitive()) {
            throw new UnsupportedOperationException("not yet implemented: " + type);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.