Class CallInstr
java.lang.Object
org.ek9lang.compiler.ir.instructions.IRInstr
org.ek9lang.compiler.ir.instructions.CallInstr
- 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 TypeMethodDescriptionvoidaccept(INodeVisitor visitor) static CallInstrcall(String result, DebugInfo debugInfo, CallDetails callDetails) Create method call with complete type information from resolved symbols: CALL result = object.method(args...)static CallInstrcallStatic(String result, DebugInfo debugInfo, CallDetails callDetails) Create static method call with complete type information: CALL_STATIC result = Type.method(args...)static CallInstrcallStatic(VariableDetails variableDetails, CallDetails callDetails) static CallInstrconstructor(String result, DebugInfo debugInfo, CallDetails callDetails) Create constructor call with complete type information: CALL result = Type.<init>(args...)Get parameter type names in EK9 format (e.g., ["org.ek9.lang::String"]).Get return type name in EK9 format (e.g., "org.ek9.lang::Void").Get the EK9 format target type name (e.g., "org.ek9.lang::Stdout").booleanCheck if this is a constructor call.booleanCheck if this is an explicit trait default method call (TraitName.method() syntax).booleanCheck if this is a trait call (requires invokeinterface in JVM bytecode).static CallInstroperator(String result, DebugInfo debugInfo, CallDetails callDetails) Create EK9 operator call with complete type information: CALL result = object._operatorMethod(args...) Common operators: _add, _sub, _eq, _lt, _addAss, _isSet, etc.static CallInstroperator(VariableDetails variableDetails, CallDetails callDetails) Methods inherited from class IRInstr
addOperand, addOperands, equals, getDebugInfo, getEscapeMetaData, getOpcode, getOperands, getResult, hasEscapeMetaData, hashCode, hasResult, isControlFlow, isLabel, isMemoryManagement, isMethodCall, setEscapeMetaData, toString
-
Method Details
-
call
Create method call with complete type information from resolved symbols: CALL result = object.method(args...) -
callStatic
Create static method call with complete type information: CALL_STATIC result = Type.method(args...) -
callStatic
-
operator
Create EK9 operator call with complete type information: CALL result = object._operatorMethod(args...) Common operators: _add, _sub, _eq, _lt, _addAss, _isSet, etc. -
operator
-
constructor
Create constructor call with complete type information: CALL result = Type.<init>(args...) -
accept
-
getTargetObject
-
getMethodName
-
getArguments
-
isConstructorCall
public boolean isConstructorCall()Check if this is a constructor call. -
getTargetTypeName
Get the EK9 format target type name (e.g., "org.ek9.lang::Stdout"). -
getParameterTypes
-
getReturnTypeName
Get return type name in EK9 format (e.g., "org.ek9.lang::Void"). -
isTraitCall
public boolean isTraitCall()Check if this is a trait call (requires invokeinterface in JVM bytecode). -
isExplicitTraitDefaultCall
public boolean isExplicitTraitDefaultCall()Check if this is an explicit trait default method call (TraitName.method() syntax). These calls require invokespecial in JVM bytecode to call the interface's default method directly, bypassing virtual dispatch.
-