Package com.facebook.presto.byteCode

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


        }
        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


            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 {
            throw new UnsupportedOperationException("not yet implemented: " + type);
        }
View Full Code Here

        for (ByteCodeExpression parameter : parameters) {
            block.append(parameter);
        }

        if (instance == null) {
            return block.invokeStatic(methodTargetType, methodName, returnType, parameterTypes);
        }
        else if (instance.getType().isInterface()) {
            return block.invokeInterface(methodTargetType, methodName, returnType, parameterTypes);
        }
        else {
View Full Code Here

        block.append(ifWasNullPopAndGoto(context, end, boolean.class, left.getType()));

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

        block.invokeStatic(Operations.class, function, boolean.class, type, type);
        return typedByteCodeNode(block.visitLabel(end), boolean.class);
    }

    private TypedByteCodeNode visitIsDistinctFrom(ComparisonExpression node, CompilerContext context)
    {
View Full Code Here

        block.append(ifWasNullPopAndGoto(context, end, boolean.class, type, type));

        block.append(coerceToType(context, max, type).getNode());
        block.append(ifWasNullPopAndGoto(context, end, boolean.class, type, type, type));

        block.invokeStatic(Operations.class, "between", boolean.class, type, type, type);
        return typedByteCodeNode(block.visitLabel(end), boolean.class);
    }

    @Override
    protected TypedByteCodeNode visitIsNotNullPredicate(IsNotNullPredicate node, CompilerContext context)
View Full Code Here

            if (checkForNulls) {
                condition.getVariable("wasNull")
                        .putVariable(caseWasNull.getLocalVariableDefinition())
                        .append(ifWasNullPopAndGoto(context, elseLabel, void.class, type, type));
            }
            condition.invokeStatic(Operations.class, "equal", boolean.class, type, type);
            test.condition(condition);

            test.ifTrue(new Block(context).gotoLabel(matchLabel));
            test.ifFalse(elseNode);
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

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.