Class CallInstruction
java.lang.Object
org.ek9lang.compiler.ir.IRInstruction
org.ek9lang.compiler.ir.CallInstruction
- All Implemented Interfaces:
INode
Specialized IR instruction for method calls (CALL, CALL_VIRTUAL, CALL_STATIC, CALL_DISPATCHER).
This instruction type handles ALL EK9 method calls and operators. EK9 operators like a + b become method calls like a._add(b).
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(INodeVisitor visitor) static CallInstruction
Create standard method call: CALL result = object.method(args...)static CallInstruction
call
(String result, String targetObject, String methodName, DebugInfo debugInfo, String... arguments) Create standard method call with debug info: CALL result = object.method(args...)static CallInstruction
callDispatcher
(String result, String targetObject, String methodName, String... arguments) Create dispatcher method call: CALL_DISPATCHER result = object.dispatcherMethod(args...)static CallInstruction
callDispatcher
(String result, String targetObject, String methodName, DebugInfo debugInfo, String... arguments) Create dispatcher method call with debug info: CALL_DISPATCHER result = object.dispatcherMethod(args...)static CallInstruction
callStatic
(String result, String targetType, String methodName, String... arguments) Create static method call: CALL_STATIC result = Type.method(args...)static CallInstruction
callStatic
(String result, String targetType, String methodName, DebugInfo debugInfo, String... arguments) Create static method call with debug info: CALL_STATIC result = Type.method(args...)static CallInstruction
callVirtual
(String result, String targetObject, String methodName, String... arguments) Create virtual method call: CALL_VIRTUAL result = object.method(args...)static CallInstruction
callVirtual
(String result, String targetObject, String methodName, DebugInfo debugInfo, String... arguments) Create virtual method call with debug info: CALL_VIRTUAL result = object.method(args...)static CallInstruction
constructor
(String result, String typeName, String... arguments) Create constructor call: CALL result = Type.<init>(args...)static CallInstruction
constructor
(String result, String typeName, DebugInfo debugInfo, String... arguments) Create constructor call with debug info: CALL result = Type.<init>(args...)boolean
Check if this is a constructor call.boolean
Check if this is an EK9 operator method call.static CallInstruction
Create EK9 operator call: CALL result = object._operatorMethod(args...) Common operators: _add, _sub, _eq, _lt, _addAss, _isSet, etc.static CallInstruction
operator
(String result, String targetObject, String operatorMethod, DebugInfo debugInfo, String... arguments) Create EK9 operator call with debug info: CALL result = object._operatorMethod(args...)Methods inherited from class org.ek9lang.compiler.ir.IRInstruction
addOperand, addOperands, equals, getDebugInfo, getOpcode, getOperands, getResult, hashCode, hasResult, isControlFlow, isMemoryManagement, isMethodCall, toString
-
Method Details
-
call
public static CallInstruction call(String result, String targetObject, String methodName, String... arguments) Create standard method call: CALL result = object.method(args...) -
call
-
callVirtual
public static CallInstruction callVirtual(String result, String targetObject, String methodName, String... arguments) Create virtual method call: CALL_VIRTUAL result = object.method(args...) -
callVirtual
-
callStatic
public static CallInstruction callStatic(String result, String targetType, String methodName, String... arguments) Create static method call: CALL_STATIC result = Type.method(args...) -
callStatic
-
callDispatcher
public static CallInstruction callDispatcher(String result, String targetObject, String methodName, String... arguments) Create dispatcher method call: CALL_DISPATCHER result = object.dispatcherMethod(args...) -
callDispatcher
-
operator
public static CallInstruction operator(String result, String targetObject, String operatorMethod, String... arguments) Create EK9 operator call: CALL result = object._operatorMethod(args...) Common operators: _add, _sub, _eq, _lt, _addAss, _isSet, etc. -
operator
-
constructor
Create constructor call: CALL result = Type.<init>(args...) -
constructor
public static CallInstruction constructor(String result, String typeName, DebugInfo debugInfo, String... arguments) Create constructor call with debug info: CALL result = Type.<init>(args...) -
accept
- Specified by:
accept
in interfaceINode
- Overrides:
accept
in classIRInstruction
-
getTargetObject
-
getMethodName
-
getArguments
-
isOperatorCall
public boolean isOperatorCall()Check if this is an EK9 operator method call. -
isConstructorCall
public boolean isConstructorCall()Check if this is a constructor call.
-