Package com.facebook.presto.byteCode

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


            return NOP;
        }
        Block notNull = new Block(context).comment("box primitive");
        Class<?> expectedCurrentStackType;
        if (type == Long.class) {
            notNull.invokeStatic(Long.class, "valueOf", Long.class, long.class);
            expectedCurrentStackType = long.class;
        }
        else if (type == Double.class) {
            notNull.invokeStatic(Double.class, "valueOf", Double.class, double.class);
            expectedCurrentStackType = double.class;
View Full Code Here


        if (type == Long.class) {
            notNull.invokeStatic(Long.class, "valueOf", Long.class, long.class);
            expectedCurrentStackType = long.class;
        }
        else if (type == Double.class) {
            notNull.invokeStatic(Double.class, "valueOf", Double.class, double.class);
            expectedCurrentStackType = double.class;
        }
        else if (type == Boolean.class) {
            notNull.invokeStatic(Boolean.class, "valueOf", Boolean.class, boolean.class);
            expectedCurrentStackType = boolean.class;
View Full Code Here

        else if (type == Double.class) {
            notNull.invokeStatic(Double.class, "valueOf", Double.class, double.class);
            expectedCurrentStackType = double.class;
        }
        else if (type == Boolean.class) {
            notNull.invokeStatic(Boolean.class, "valueOf", Boolean.class, boolean.class);
            expectedCurrentStackType = boolean.class;
        }
        else if (type == Void.class) {
            notNull.pushNull()
                    .checkCast(Void.class);
View Full Code Here

        else {
            LabelNode end = new LabelNode("end");
            switch (node.getType()) {
                case "BOOLEAN":
                    block.append(ifWasNullPopAndGoto(context, end, boolean.class, value.getType()));
                    block.invokeStatic(Operations.class, "castToBoolean", boolean.class, value.getType());
                    return typedByteCodeNode(block.visitLabel(end), boolean.class);
                case "BIGINT":
                    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);
View Full Code Here

                    block.append(ifWasNullPopAndGoto(context, end, boolean.class, value.getType()));
                    block.invokeStatic(Operations.class, "castToBoolean", boolean.class, value.getType());
                    return typedByteCodeNode(block.visitLabel(end), boolean.class);
                case "BIGINT":
                    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);
View Full Code Here

                    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

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.