Class BytecodeUtils

java.lang.Object
io.trino.sql.gen.BytecodeUtils

public final class BytecodeUtils extends Object
  • Method Details

    • ifWasNullPopAndGoto

      public static io.airlift.bytecode.BytecodeNode ifWasNullPopAndGoto(io.airlift.bytecode.Scope scope, io.airlift.bytecode.instruction.LabelNode label, Class<?> returnType, Class<?>... stackArgsToPop)
    • ifWasNullPopAndGoto

      public static io.airlift.bytecode.BytecodeNode ifWasNullPopAndGoto(io.airlift.bytecode.Scope scope, io.airlift.bytecode.instruction.LabelNode label, Class<?> returnType, Iterable<? extends Class<?>> stackArgsToPop)
    • ifWasNullClearPopAndGoto

      public static io.airlift.bytecode.BytecodeNode ifWasNullClearPopAndGoto(io.airlift.bytecode.Scope scope, io.airlift.bytecode.instruction.LabelNode label, Class<?> returnType, Class<?>... stackArgsToPop)
    • handleNullValue

      public static io.airlift.bytecode.BytecodeNode handleNullValue(io.airlift.bytecode.Scope scope, io.airlift.bytecode.instruction.LabelNode label, Class<?> returnType, List<Class<?>> stackArgsToPop, boolean clearNullFlag)
    • unboxPrimitive

      public static io.airlift.bytecode.BytecodeNode unboxPrimitive(Class<?> unboxedType)
    • loadConstant

      public static io.airlift.bytecode.expression.BytecodeExpression loadConstant(CallSiteBinder callSiteBinder, Object constant, Class<?> type)
    • loadConstant

      public static io.airlift.bytecode.expression.BytecodeExpression loadConstant(Binding binding)
    • generateInvocation

      public static io.airlift.bytecode.BytecodeNode generateInvocation(io.airlift.bytecode.Scope scope, ResolvedFunction resolvedFunction, FunctionManager functionManager, List<io.airlift.bytecode.BytecodeNode> arguments, CallSiteBinder binder)
    • generateInvocation

      public static io.airlift.bytecode.BytecodeNode generateInvocation(io.airlift.bytecode.Scope scope, String functionName, FunctionNullability functionNullability, Function<InvocationConvention,ScalarFunctionImplementation> functionImplementationProvider, List<io.airlift.bytecode.BytecodeNode> arguments, CallSiteBinder binder)
    • generateFullInvocation

      public static io.airlift.bytecode.BytecodeNode generateFullInvocation(io.airlift.bytecode.Scope scope, ResolvedFunction resolvedFunction, FunctionManager functionManager, Function<MethodHandle,io.airlift.bytecode.BytecodeNode> instanceFactory, List<Function<Optional<Class<?>>,io.airlift.bytecode.BytecodeNode>> argumentCompilers, CallSiteBinder binder)
    • unboxPrimitiveIfNecessary

      public static io.airlift.bytecode.BytecodeBlock unboxPrimitiveIfNecessary(io.airlift.bytecode.Scope scope, Class<?> boxedType)
    • boxPrimitiveIfNecessary

      public static io.airlift.bytecode.BytecodeNode boxPrimitiveIfNecessary(io.airlift.bytecode.Scope scope, Class<?> type)
    • invoke

      public static io.airlift.bytecode.expression.BytecodeExpression invoke(Binding binding, String name, io.airlift.bytecode.expression.BytecodeExpression... parameters)
    • invoke

      public static io.airlift.bytecode.expression.BytecodeExpression invoke(Binding binding, String name, List<io.airlift.bytecode.expression.BytecodeExpression> parameters)
    • invoke

      public static io.airlift.bytecode.expression.BytecodeExpression invoke(Binding binding, BoundSignature signature)
    • sanitizeName

      public static String sanitizeName(String name)
      Replace characters that are not safe to use in a JVM identifier.
    • generateWrite

      public static io.airlift.bytecode.BytecodeNode generateWrite(CallSiteBinder callSiteBinder, io.airlift.bytecode.Scope scope, io.airlift.bytecode.Variable wasNullVariable, Type type)