Package com.facebook.presto.byteCode

Examples of com.facebook.presto.byteCode.ByteCodeNode


                    .putVariable("wasNull");
        }

        elseBlock.gotoLabel(noMatchLabel);

        ByteCodeNode elseNode = elseBlock;
        for (TypedByteCodeNode testNode : testValues) {
            LabelNode testLabel = new LabelNode("test");
            IfStatementBuilder test = ifStatementBuilder(context);

            Block condition = new Block(context)
View Full Code Here


        Type type = metadata.getType(node.getType());
        if (type == null) {
            throw new IllegalArgumentException("Unsupported type: " + node.getType());
        }

        ByteCodeNode value = sliceConstant(node.getValue());
        FunctionBinding functionBinding = bootstrapFunctionBinder.bindCastOperator(
                getSessionByteCode,
                value,
                VARCHAR,
                type);
View Full Code Here

        if (expressionTypes.get(node.getExpression()).equals(UNKNOWN)) {
            // set was null and push java default
            return new Block(context).putVariable("wasNull", true).pushJavaDefault(type.getJavaType());
        }

        ByteCodeNode value = process(node.getExpression(), context);
        FunctionBinding functionBinding = bootstrapFunctionBinder.bindCastOperator(
                getSessionByteCode,
                value,
                expressionTypes.get(node.getExpression()),
                type);
View Full Code Here

    }

    @Override
    protected ByteCodeNode visitArithmeticExpression(ArithmeticExpression node, CompilerContext context)
    {
        ByteCodeNode left = process(node.getLeft(), context);
        ByteCodeNode right = process(node.getRight(), context);

        FunctionBinding functionBinding = bootstrapFunctionBinder.bindOperator(
                OperatorType.valueOf(node.getType().name()),
                getSessionByteCode,
                ImmutableList.of(left, right),
View Full Code Here

    }

    @Override
    protected ByteCodeNode visitNegativeExpression(NegativeExpression node, CompilerContext context)
    {
        ByteCodeNode value = process(node.getValue(), context);

        FunctionBinding functionBinding = bootstrapFunctionBinder.bindOperator(
                OperatorType.NEGATION,
                getSessionByteCode,
                ImmutableList.of(value),
View Full Code Here

    }

    @Override
    protected ByteCodeNode visitLogicalBinaryExpression(LogicalBinaryExpression node, CompilerContext context)
    {
        ByteCodeNode left = process(node.getLeft(), context);
        Type leftType = expressionTypes.get(node.getLeft());
        ByteCodeNode right = process(node.getRight(), context);
        Type rightType = expressionTypes.get(node.getRight());

        switch (node.getType()) {
            case AND:
                return visitAnd(context, left, leftType, right, rightType, node.toString());
View Full Code Here

    }

    @Override
    protected ByteCodeNode visitNotExpression(NotExpression node, CompilerContext context)
    {
        ByteCodeNode value = process(node.getValue(), context);

        // simple single op so there is no reason to do a null check
        return new Block(context)
                .comment(node.toString())
                .append(value)
View Full Code Here

        // distinct requires special null handling rules
        if (node.getType() == ComparisonExpression.Type.IS_DISTINCT_FROM) {
            return visitIsDistinctFrom(node, context);
        }

        ByteCodeNode left = process(node.getLeft(), context);
        ByteCodeNode right = process(node.getRight(), context);

        FunctionBinding functionBinding = bootstrapFunctionBinder.bindOperator(
                OperatorType.valueOf(node.getType().name()),
                getSessionByteCode,
                ImmutableList.of(left, right),
View Full Code Here

                OperatorType.EQUAL,
                getSessionByteCode,
                ImmutableList.<ByteCodeNode>of(NOP, NOP),
                ImmutableList.of(leftType, rightType));

        ByteCodeNode equalsCall = new Block(context).comment("equals(%s, %s)", leftType, rightType)
                .invokeDynamic(functionBinding.getName(), functionBinding.getCallSite().type(), functionBinding.getBindingId());

        Block block = new Block(context)
                .comment(node.toString())
                .comment("left")
View Full Code Here

    }

    @Override
    protected ByteCodeNode visitBetweenPredicate(BetweenPredicate node, CompilerContext context)
    {
        ByteCodeNode value = process(node.getValue(), context);
        ByteCodeNode min = process(node.getMin(), context);
        ByteCodeNode max = process(node.getMax(), context);

        FunctionBinding functionBinding = bootstrapFunctionBinder.bindOperator(
                OperatorType.BETWEEN,
                getSessionByteCode,
                ImmutableList.of(value, min, max),
View Full Code Here

TOP

Related Classes of com.facebook.presto.byteCode.ByteCodeNode

Copyright © 2018 www.massapicom. 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.