Package io.prestosql.sql.gen
Class BytecodeUtils
- java.lang.Object
-
- io.prestosql.sql.gen.BytecodeUtils
-
public final class BytecodeUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.airlift.bytecode.BytecodeNode
boxPrimitive(Class<?> type)
static io.airlift.bytecode.BytecodeNode
boxPrimitiveIfNecessary(io.airlift.bytecode.Scope scope, Class<?> type)
static io.airlift.bytecode.BytecodeNode
generateFullInvocation(io.airlift.bytecode.Scope scope, FunctionMetadata functionMetadata, Function<InvocationConvention,FunctionInvoker> functionInvokerProvider, Function<MethodHandle,io.airlift.bytecode.BytecodeNode> instanceFactory, List<Function<Optional<Class<?>>,io.airlift.bytecode.BytecodeNode>> argumentCompilers, CallSiteBinder binder)
static io.airlift.bytecode.BytecodeNode
generateFullInvocation(io.airlift.bytecode.Scope scope, ResolvedFunction resolvedFunction, Metadata metadata, Function<MethodHandle,io.airlift.bytecode.BytecodeNode> instanceFactory, List<Function<Optional<Class<?>>,io.airlift.bytecode.BytecodeNode>> argumentCompilers, CallSiteBinder binder)
static io.airlift.bytecode.BytecodeNode
generateInvocation(io.airlift.bytecode.Scope scope, FunctionMetadata functionMetadata, Function<InvocationConvention,FunctionInvoker> functionInvokerProvider, List<io.airlift.bytecode.BytecodeNode> arguments, CallSiteBinder binder)
static io.airlift.bytecode.BytecodeNode
generateInvocation(io.airlift.bytecode.Scope scope, ResolvedFunction resolvedFunction, Metadata metadata, List<io.airlift.bytecode.BytecodeNode> arguments, CallSiteBinder binder)
static io.airlift.bytecode.BytecodeNode
generateWrite(CallSiteBinder callSiteBinder, io.airlift.bytecode.Scope scope, io.airlift.bytecode.Variable wasNullVariable, Type type)
static io.airlift.bytecode.BytecodeNode
handleNullValue(io.airlift.bytecode.Scope scope, io.airlift.bytecode.instruction.LabelNode label, Class<?> returnType, List<Class<?>> stackArgsToPop, boolean clearNullFlag)
static io.airlift.bytecode.BytecodeNode
ifWasNullClearPopAndGoto(io.airlift.bytecode.Scope scope, io.airlift.bytecode.instruction.LabelNode label, Class<?> returnType, Class<?>... stackArgsToPop)
static io.airlift.bytecode.BytecodeNode
ifWasNullPopAndGoto(io.airlift.bytecode.Scope scope, io.airlift.bytecode.instruction.LabelNode label, Class<?> returnType, Class<?>... stackArgsToPop)
static io.airlift.bytecode.BytecodeNode
ifWasNullPopAndGoto(io.airlift.bytecode.Scope scope, io.airlift.bytecode.instruction.LabelNode label, Class<?> returnType, Iterable<? extends Class<?>> stackArgsToPop)
static io.airlift.bytecode.expression.BytecodeExpression
invoke(Binding binding, BoundSignature signature)
static io.airlift.bytecode.expression.BytecodeExpression
invoke(Binding binding, String name)
static io.airlift.bytecode.expression.BytecodeExpression
loadConstant(Binding binding)
static io.airlift.bytecode.expression.BytecodeExpression
loadConstant(CallSiteBinder callSiteBinder, Object constant, Class<?> type)
static String
sanitizeName(String name)
Replace characters that are not safe to use in a JVM identifier.static io.airlift.bytecode.BytecodeNode
unboxPrimitive(Class<?> unboxedType)
static io.airlift.bytecode.BytecodeBlock
unboxPrimitiveIfNecessary(io.airlift.bytecode.Scope scope, Class<?> boxedType)
-
-
-
Method Detail
-
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)
-
boxPrimitive
public static io.airlift.bytecode.BytecodeNode boxPrimitive(Class<?> type)
-
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, Metadata metadata, List<io.airlift.bytecode.BytecodeNode> arguments, CallSiteBinder binder)
-
generateInvocation
public static io.airlift.bytecode.BytecodeNode generateInvocation(io.airlift.bytecode.Scope scope, FunctionMetadata functionMetadata, Function<InvocationConvention,FunctionInvoker> functionInvokerProvider, List<io.airlift.bytecode.BytecodeNode> arguments, CallSiteBinder binder)
-
generateFullInvocation
public static io.airlift.bytecode.BytecodeNode generateFullInvocation(io.airlift.bytecode.Scope scope, ResolvedFunction resolvedFunction, Metadata metadata, Function<MethodHandle,io.airlift.bytecode.BytecodeNode> instanceFactory, List<Function<Optional<Class<?>>,io.airlift.bytecode.BytecodeNode>> argumentCompilers, CallSiteBinder binder)
-
generateFullInvocation
public static io.airlift.bytecode.BytecodeNode generateFullInvocation(io.airlift.bytecode.Scope scope, FunctionMetadata functionMetadata, Function<InvocationConvention,FunctionInvoker> functionInvokerProvider, 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)
-
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)
-
-