Class CallArguments
java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.CallArguments
THE evaluation of a call's arguments (EXPR-1): each argument expression is evaluated into its own managed
temporary (retained and scope registered by
VariableMemoryManagement), in source order, and the
temporary's name and resolved type are collected. Constructor, function, method, delegating-constructor and
dynamic-construct capture calls all use it - never write another argument loop.
The only observable difference between the call sites that once each had their own loop is whether the
argument temporaries carry debug info, so that is the one thing a caller chooses (CallArguments.DebugInfoPolicy).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhether each argument's temporary carries debug info for the argument's own source position. -
Field Summary
Fields inherited from class AbstractGenerator
constantCopyOnAccessLoader, instructionBuilder, MAX_MESSAGE_LENGTH, stackContext, symbolTypeOrException, synthesisedCallMetaData, typeNameOrException, variableNameForIR -
Constructor Summary
ConstructorsConstructorDescriptionCallArguments(IRGenerationContext stackContext, VariableMemoryManagement variableMemoryManagement) -
Method Summary
Modifier and TypeMethodDescriptionevaluate(EK9Parser.ParamExpressionContext paramExpression, CallArguments.DebugInfoPolicy debugInfoPolicy, Function<ExprProcessingDetails, List<IRInstr>> exprProcessor, List<IRInstr> instructions) Evaluate every argument of the parameter expression (which may be null) into the instructions.
-
Constructor Details
-
CallArguments
public CallArguments(IRGenerationContext stackContext, VariableMemoryManagement variableMemoryManagement)
-
-
Method Details
-
evaluate
public ArgumentDetails evaluate(EK9Parser.ParamExpressionContext paramExpression, CallArguments.DebugInfoPolicy debugInfoPolicy, Function<ExprProcessingDetails, List<IRInstr>> exprProcessor, List<IRInstr> instructions) Evaluate every argument of the parameter expression (which may be null) into the instructions.- Parameters:
paramExpression- The argument list of the call, or null for none.debugInfoPolicy- Whether each argument temporary carries debug info.exprProcessor- Evaluates an argument expression into its result variable.instructions- Receives the evaluation and its memory management, argument by argument.- Returns:
- The argument temporaries and the resolved types of the arguments, in order.
-