Class LambdaCompiler

java.lang.Object
com.strobel.expressions.LambdaCompiler

final class LambdaCompiler extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getParameterTypes

      private TypeList getParameterTypes(LambdaExpression<?> lambda)
    • getParameters

      ParameterExpressionList getParameters()
    • canEmitBoundConstants

      boolean canEmitBoundConstants()
    • emitDebugSymbols

      boolean emitDebugSymbols()
    • emitClosureArgument

      void emitClosureArgument()
    • emitLambdaArgument

      void emitLambdaArgument(int index)
    • createStaticField

      private FieldBuilder createStaticField(String name, Type type)
    • initializeMethod

      void initializeMethod()
    • addReturnLabel

      private void addReturnLabel(LambdaExpression lambda)
    • notEmpty

      private static boolean notEmpty(Expression node)
    • significant

      private static boolean significant(Expression node)
    • compile

      static <T> Delegate<T> compile(LambdaExpression<T> lambda, DebugInfoGenerator debugInfoGenerator)
    • createDelegate

      private <T> Delegate<T> createDelegate(Class<T> generatedClass)
    • compile

      static <T> void compile(LambdaExpression<T> lambda, MethodBuilder methodBuilder, DebugInfoGenerator debugInfoGenerator)
    • analyzeLambda

      private static <T> Pair<AnalyzedTree,LambdaExpression<T>> analyzeLambda(LambdaExpression<T> lambda)
    • getNamedLocal

      LocalBuilder getNamedLocal(Type type, ParameterExpression variable)
    • getLambdaArgument

      int getLambdaArgument(int index)
    • getLocal

      LocalBuilder getLocal(Type<?> type)
    • freeLocal

      void freeLocal(LocalBuilder local)
    • updateEmitAsTailCallFlag

      private static int updateEmitAsTailCallFlag(int flags, int newValue)
    • updateEmitExpressionStartFlag

      private static int updateEmitExpressionStartFlag(int flags, int newValue)
    • updateEmitAsTypeFlag

      private static int updateEmitAsTypeFlag(int flags, int newValue)
    • emitExpression

      void emitExpression(Expression node)
    • emitExpressionStart

      private int emitExpressionStart(Expression node)
    • emitExpressionEnd

      private void emitExpressionEnd(int flags)
    • emitExpression

      private void emitExpression(Expression node, int flags)
    • emitExtensionExpression

      private void emitExtensionExpression(Expression node)
    • emitExpressionAsVoid

      private void emitExpressionAsVoid(Expression node)
    • emitExpressionAsVoid

      private void emitExpressionAsVoid(Expression node, int flags)
    • emitExpressionAsType

      private void emitExpressionAsType(Expression node, Type type, int flags)
    • emitAssignBinaryExpression

      private void emitAssignBinaryExpression(Expression expr)
    • emitAssign

      private void emitAssign(BinaryExpression node, int emitAs)
    • emitMemberAssignment

      private void emitMemberAssignment(BinaryExpression node, int flags)
    • emitVariableAssignment

      private void emitVariableAssignment(BinaryExpression node, int flags)
    • emitIndexAssignment

      private void emitIndexAssignment(BinaryExpression node, int flags)
    • emitSetIndexCall

      private void emitSetIndexCall(BinaryExpression index)
    • hasVariables

      private static boolean hasVariables(Object node)
    • enterTry

      private void enterTry(TryExpression tryExpression)
    • exitTry

      private void exitTry(TryExpression tryExpression)
    • enterScope

      private void enterScope(Object node)
    • exitScope

      private void exitScope(Object node)
    • emitBlockExpression

      private void emitBlockExpression(Expression expr, int flags)
    • emit

      private void emit(BlockExpression node, int flags)
    • emitAndAlsoBinaryExpression

      private void emitAndAlsoBinaryExpression(Expression expr, int flags)
    • emitPrimitiveAndAlso

      private void emitPrimitiveAndAlso(BinaryExpression b)
    • emitUnboxingAndAlso

      private void emitUnboxingAndAlso(BinaryExpression b)
    • emitOrElseBinaryExpression

      private void emitOrElseBinaryExpression(Expression expr, int flags)
    • emitPrimitiveOrElse

      private void emitPrimitiveOrElse(BinaryExpression b)
    • emitUnboxingOrElse

      private void emitUnboxingOrElse(BinaryExpression b)
    • emitCoalesceBinaryExpression

      private void emitCoalesceBinaryExpression(Expression expr)
    • emitReferenceCoalesceWithoutConversion

      private void emitReferenceCoalesceWithoutConversion(BinaryExpression b)
    • emitLambdaReferenceCoalesce

      private void emitLambdaReferenceCoalesce(BinaryExpression b)
    • emitConditionalExpression

      private void emitConditionalExpression(Expression expr, int flags)
    • emitBinaryExpression

      private void emitBinaryExpression(Expression expr)
    • emitBinaryExpression

      private void emitBinaryExpression(Expression expr, int flags)
    • getEqualityOperand

      private Expression getEqualityOperand(Expression expression)
    • emitBinaryMethod

      private void emitBinaryMethod(BinaryExpression b, int flags)
    • emitBinaryOperator

      private void emitBinaryOperator(ExpressionType op, Type<?> leftType, Type<?> rightType, Type resultType)
    • emitConvertArithmeticResult

      private void emitConvertArithmeticResult(ExpressionType op, Type sourceType, Type resultType)
    • emitPrimitiveBinaryOp

      private Type<?> emitPrimitiveBinaryOp(ExpressionType op, Type leftType, Type rightType)
    • emitUnboxingBinaryOp

      private void emitUnboxingBinaryOp(ExpressionType op, Type leftType, Type rightType, Type resultType)
    • emitUnboxingBinaryArithmetic

      private void emitUnboxingBinaryArithmetic(ExpressionType op, Type leftType, Type rightType, Type resultType)
    • emitLiftedRelational

      private void emitLiftedRelational(ExpressionType op, Type leftType, Type rightType, Type resultType)
    • unboxRightBinaryOperand

      private Type unboxRightBinaryOperand(Type rightType)
    • unboxLeftBinaryOperand

      private Type unboxLeftBinaryOperand(Type leftType, Type rightType)
    • emitLiftedBooleanAnd

      private void emitLiftedBooleanAnd(Type leftType, Type rightType)
    • emitLiftedBooleanOr

      private void emitLiftedBooleanOr(Type leftType, Type rightType)
    • emitObjectBinaryOp

      private void emitObjectBinaryOp(ExpressionType op)
    • emitArithmeticBinaryOp

      private void emitArithmeticBinaryOp(ExpressionType op, Type<?> operandType)
    • emitConstantExpression

      private void emitConstantExpression(Expression expr)
    • emitConstant

      private void emitConstant(Object value, Type<?> type)
    • emitDefaultValueExpression

      private void emitDefaultValueExpression(Expression node)
    • emitGotoExpression

      private void emitGotoExpression(Expression expr, int flags)
    • emitUnreachable

      private void emitUnreachable(Expression node, int flags)
    • emitExpressionAndBranch

      private void emitExpressionAndBranch(boolean branchValue, Expression node, Label label)
    • emitBranchNot

      private void emitBranchNot(boolean branch, UnaryExpression node, Label label)
    • emitBranchNullCheck

      private void emitBranchNullCheck(boolean branch, UnaryExpression node, Label label)
    • emitBranchRelation

      private void emitBranchRelation(boolean branch, BinaryExpression node, Label label)
    • emitRelationalBranchOp

      private void emitRelationalBranchOp(ExpressionType op, Type<?> operandType, boolean branch, Label label)
    • emitBranchOp

      private void emitBranchOp(boolean branch, Label label)
    • emitBranchLogical

      private void emitBranchLogical(boolean branch, BinaryExpression node, Label label)
    • emitBranchAnd

      private void emitBranchAnd(boolean branch, BinaryExpression node, Label label)
    • emitBranchOr

      private void emitBranchOr(boolean branch, BinaryExpression node, Label label)
    • emitBranchBlock

      private void emitBranchBlock(boolean branch, BlockExpression node, Label label)
    • emitInvocationExpression

      private void emitInvocationExpression(Expression expr, int flags)
    • emitInlinedInvoke

      private void emitInlinedInvoke(InvocationExpression invoke, int flags)
    • emitLabelExpression

      private void emitLabelExpression(Expression expr, int flags)
    • pushLabelBlock

      private void pushLabelBlock(LabelScopeKind type)
    • tryPushLabelBlock

      private boolean tryPushLabelBlock(Expression node)
    • popLabelBlock

      private void popLabelBlock(LabelScopeKind kind)
    • defineBlockLabels

      private void defineBlockLabels(Expression node)
    • ensureLabel

      private LabelInfo ensureLabel(LabelTarget node)
    • referenceLabel

      private LabelInfo referenceLabel(LabelTarget node)
    • defineLabel

      private LabelInfo defineLabel(LabelTarget node)
    • emitLambdaExpression

      private void emitLambdaExpression(Expression expr)
    • emitDelegateConstruction

      private void emitDelegateConstruction(LambdaExpression lambda)
    • getUniqueMethodName

      static String getUniqueMethodName()
    • getUniqueLambdaName

      static String getUniqueLambdaName(String name, Class<?> creationContext)
    • emitLambdaBody

      private void emitLambdaBody()
    • emitLambdaBody

      private void emitLambdaBody(CompilerScope parent, boolean inlined, int flags)
    • emitDelegateConstruction

      private void emitDelegateConstruction(LambdaCompiler inner)
    • emitClosureCreation

      private void emitClosureCreation(LambdaCompiler inner)
    • ensureConstructor

      private void ensureConstructor()
    • ensureClosure

      private void ensureClosure()
    • emitConstantArray

      final void emitConstantArray(Object array)
    • emitLoopExpression

      private void emitLoopExpression(Expression expr)
    • emitMemberExpression

      private void emitMemberExpression(Expression expr)
    • emitMemberGet

      private void emitMemberGet(MemberInfo member)
    • emitMethodCallExpression

      private void emitMethodCallExpression(Expression expr)
    • emitMethodCallExpression

      private void emitMethodCallExpression(Expression expr, int flags)
    • emitMethodCall

      private void emitMethodCall(Expression target, MethodInfo method, IArgumentProvider methodCallExpr)
    • emitMethodCall

      private void emitMethodCall(Expression target, MethodInfo method, IArgumentProvider expr, int flags)
    • emitMethodCall

      private void emitMethodCall(Expression target, MethodInfo method, MethodCallExpression expr, int flags)
    • emitMethodCall

      private void emitMethodCall(MethodInfo method, IArgumentProvider args, Type<?> objectType, int flags)
    • emitArguments

      private void emitArguments(MethodBase method, IArgumentProvider args)
    • emitArguments

      private void emitArguments(MethodBase method, IArgumentProvider args, int skipParameters)
    • emitNewExpression

      private void emitNewExpression(Expression expr)
    • emitNewArrayExpression

      private void emitNewArrayExpression(Expression expr)
    • emitParameterExpression

      private void emitParameterExpression(Expression expr)
    • emitRuntimeVariablesExpression

      private void emitRuntimeVariablesExpression(Expression expr)
    • emitTypeBinaryExpression

      private void emitTypeBinaryExpression(Expression expr)
    • emitUnaryExpression

      private void emitUnaryExpression(Expression expr, int flags)
    • emitUnary

      private void emitUnary(UnaryExpression node, int flags)
    • emitUnaryOperator

      private void emitUnaryOperator(ExpressionType op, Type operandType, Type resultType)
    • emitUnaryMethod

      private void emitUnaryMethod(UnaryExpression node, int flags)
    • emitConvertUnaryExpression

      private void emitConvertUnaryExpression(Expression expr, int flags)
    • emitConvert

      private void emitConvert(UnaryExpression node, int flags)
    • emitUnboxUnaryExpression

      private void emitUnboxUnaryExpression(Expression expr)
    • emitThrowUnaryExpression

      private void emitThrowUnaryExpression(Expression expr)
    • emitThrow

      private void emitThrow(UnaryExpression expr, int flags)
    • emitTryExpression

      private void emitTryExpression(Expression expr)
    • emitCatchStart

      private void emitCatchStart(CatchBlock cb)
    • checkTry

      private void checkTry()
    • emitSaveExceptionOrPop

      private void emitSaveExceptionOrPop(CatchBlock cb)
    • emitSwitchExpression

      private void emitSwitchExpression(Expression expr, int flags)
    • tryEmitStringSwitch

      private boolean tryEmitStringSwitch(SwitchExpression node, int flags)
    • tryEmitLookupSwitch

      private boolean tryEmitLookupSwitch(SwitchExpression node, int flags)
    • canOptimizeSwitchType

      private static boolean canOptimizeSwitchType(Type<?> valueType)