Class FunctionInstance

java.lang.Object
org.ek9lang.compiler.phase7.support.FunctionInstance

public final class FunctionInstance extends Object
THE reading of how a function call finds the function instance it invokes - use this, never read the DELEGATE_CALL mark by hand. Phase 3 marks a call whose function comes from a variable (or the result of a chained call) rather than being named; every call generator asks here.
  • Method Details

    • isDelegateCall

      public static boolean isDelegateCall(ISymbol recordedCallSymbol)
      True when the recorded call symbol is a delegate call: the function instance is loaded from a variable (or is the result of an inner call) instead of being the named function's singleton.
      Parameters:
      recordedCallSymbol - the symbol recorded against the call, which may be null or not a call
    • constructedAsValue

      public static MemoryInstr constructedAsValue(IRGenerationContext stackContext, FunctionSymbol functionSymbol, String resultVariable, DebugInfo debugInfo)
      THE lowering of a function CONSTRUCTED as a value - countOf() of String, a parameterised generic function - to its singleton instance: a FUNCTION_INSTANCE, never an invocation. The type is named through resolveTypeName so that inside a Scenario-3 monomorphised generic body a conceptual parameterisation (Maker of T) is emitted as its concrete, code-generated counterpart. (ExprInstrGenerator.processFunctionConstruction is the expression-context copy that should delegate here.)