private void callMixinStatic() { FPod.NMethod ncall = pod.ncall(u2(), FConst.CallMixinStatic); Method method = emitter.findMethod(ncall.parentType, ncall.methodName, ncall.paramTypes, ncall.returnType); code.MethInst(MethodOp.call, method); }
private void callMixinVirtual() { FPod.NMethod ncall = pod.ncall(u2(), FConst.CallMixinVirtual); Method method = emitter.findMethod(ncall.parentType, ncall.methodName, ncall.paramTypes, ncall.returnType); method.AddCallConv(CallConv.Instance); code.MethInst(MethodOp.callvirt, method); }
////////////////////////////////////////////////////////////////////////// // Calls ////////////////////////////////////////////////////////////////////////// private void callNew() { // constructors are implemented as static factory methods FPod.NMethod ncall = pod.ncall(u2(), FConst.CallNew); Method method = emitter.findMethod(ncall.parentType, ncall.methodName, ncall.paramTypes, ncall.returnType); code.MethInst(MethodOp.call, method); }
private void callMixinNonVirtual() { FPod.NMethod ncall = pod.ncall(u2(), FConst.CallMixinNonVirtual); string parent = ncall.parentType; string name = ncall.methodName; string ret = ncall.returnType; string[] pars = new string[ncall.paramTypes.Length + 1]; pars[0] = parent; for (int i = 1; i < pars.Length; i++) { pars[i] = ncall.paramTypes[i - 1]; } Method method = emitter.findMethod(parent + "_", name, pars, ret); code.MethInst(MethodOp.call, method); }
private void callVirtual() { int index = u2(); FPod.NMethod ncall = pod.ncall(index, FConst.CallVirtual); Method method = emitter.findMethod(ncall.parentType, ncall.methodName, ncall.paramTypes, ncall.returnType); if (ncall.isStatic) { code.MethInst(MethodOp.call, method); } else { method.AddCallConv(CallConv.Instance); code.MethInst(MethodOp.callvirt, method); } }