presto-main/src/main/java/io/prestosql/sql/gen/BindCodeGenerator.java/BindCodeGenerator/generateExpression
class BindCodeGenerator:    @Override
    public BytecodeNode generateExpression(ResolvedFunction resolvedFunction, BytecodeGeneratorContext context, Type returnType, List<RowExpression> arguments)
    {
        // Bind expression is used to generate captured lambda.
        // It takes the captured values and the uncaptured lambda, and produces captured lambda as the output.
        // The uncaptured lambda is just a method, and does not have a stack representation during execution.
        // As a result, the bind expression generates the captured lambda in one step.
        int numCaptures = arguments.size() - 1;
        LambdaDefinitionExpression lambda = (LambdaDefinitionExpression) arguments.get(numCaptures);
        checkState(compiledLambdaMap.containsKey(lambda), "lambda expressions map does not contain this lambda definition");
        CompiledLambda compiledLambda = compiledLambdaMap.get(lambda);

        return LambdaBytecodeGenerator.generateLambda(
                context,
                arguments.subList(0, numCaptures),
                compiledLambda,
                lambdaInterface);
    }