Package com.facebook.presto.byteCode

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


        if (body != null) {
            block.append(body);
        }

        block.visitLabel(continueLabel)
                .append(update)
                .gotoLabel(beginLabel)
                .visitLabel(endLabel);

        block.accept(visitor);
View Full Code Here


                block.dup(methodType.returnType())
                        .ifNotNullGoto(end)
                        .putVariable("wasNull", true);
            }
        }
        block.visitLabel(end);

        return block;
    }

    private static ByteCodeNode boxPrimitiveIfNecessary(CompilerContext context, Class<?> type)
View Full Code Here

        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)
    {
        TypedByteCodeNode left = process(node.getLeft(), context);
View Full Code Here

        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

                block.dup(methodType.returnType())
                        .ifNotNullGoto(end)
                        .putVariable("wasNull", true);
            }
        }
        block.visitLabel(end);

        return block;
    }

    private static ByteCodeNode unboxPrimitive(CompilerContext context, Class<?> unboxedType)
View Full Code Here

                    .visitLabel(falseLabel)
                    .append(ifFalse)
                    .visitLabel(outLabel);
        }
        else {
            block.visitLabel(falseLabel);
        }

        block.accept(visitor);
    }
View Full Code Here

        if (body != null) {
            block.append(body);
        }

        block.visitLabel(continueLabel)
                .append(update)
                .gotoLabel(beginLabel)
                .visitLabel(endLabel);

        block.accept(visitor);
View Full Code Here

                block.dup(methodType.returnType())
                        .ifNotNullGoto(end)
                        .putVariable("wasNull", true);
            }
        }
        block.visitLabel(end);

        return typedByteCodeNode(block, unboxedReturnType);
    }

    private static ByteCodeNode unboxPrimitive(CompilerContext context, Class<?> unboxedType)
View Full Code Here

            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);
                case "DOUBLE":
View Full Code Here

                    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);
                case "VARCHAR":
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.