use of org.ballerinalang.util.codegen.AttachedFunctionInfo in project ballerina by ballerina-lang.
the class CPU method invokeVirtualFunction.
private static WorkerExecutionContext invokeVirtualFunction(WorkerExecutionContext ctx, int receiver, FunctionInfo virtualFuncInfo, int[] argRegs, int[] retRegs, int flags) {
BStruct structVal = (BStruct) ctx.workerLocal.refRegs[receiver];
if (structVal == null) {
ctx.setError(BLangVMErrors.createNullRefException(ctx));
handleError(ctx);
return null;
}
StructInfo structInfo = structVal.getType().structInfo;
AttachedFunctionInfo attachedFuncInfo = structInfo.funcInfoEntries.get(virtualFuncInfo.getName());
FunctionInfo concreteFuncInfo = attachedFuncInfo.functionInfo;
return BLangFunctions.invokeCallable(concreteFuncInfo, ctx, argRegs, retRegs, false, flags);
}
Aggregations