Class BinaryOperatorInvoker

java.lang.Object
org.ek9lang.compiler.phase7.support.BinaryOperatorInvoker
All Implemented Interfaces:
Function<BinaryOperatorParams, List<IRInstr>>

public final class BinaryOperatorInvoker extends Object implements Function<BinaryOperatorParams, List<IRInstr>>
CONCERN: Binary operator invocation with memory management. RESPONSIBILITY: Call binary operator (_add, _lt, _cmp, etc.) with ARC compliance. REUSABILITY: ALL generators calling binary operators.

Encapsulates the pattern: 1. Create CallContext for binary operation 2. Build CallDetails via CallDetailsBuilder 3. Execute operator call 4. Apply memory management (RETAIN/SCOPE_REGISTER)

Ensures all binary operator calls follow consistent memory management, preventing reference counting bugs.

  • Constructor Details

  • Method Details

    • apply

      public List<IRInstr> apply(BinaryOperatorParams params)
      Invoke binary operator on two operands.

      Handles: - CallContext creation - CallDetailsBuilder invocation - Memory management (RETAIN/SCOPE_REGISTER)

      Specified by:
      apply in interface Function<BinaryOperatorParams, List<IRInstr>>
      Parameters:
      params - Binary operator parameters
      Returns:
      Instructions ending with result in params.resultTemp()