예제 #1
0
        public Operand Call(MethodInfo info, params Operand[] callArgs)
        {
            if (Ptc.State == PtcState.Disabled)
            {
                IntPtr funcPtr = Delegates.GetDelegateFuncPtr(info);

                OperandType returnType = GetOperandType(info.ReturnType);

                Symbols.Add((ulong)funcPtr.ToInt64(), info.Name);

                return(Call(Const(funcPtr.ToInt64()), returnType, callArgs));
            }
            else
            {
                int index = Delegates.GetDelegateIndex(info);

                IntPtr funcPtr = Delegates.GetDelegateFuncPtrByIndex(index);

                OperandType returnType = GetOperandType(info.ReturnType);

                Symbols.Add((ulong)funcPtr.ToInt64(), info.Name);

                return(Call(Const(funcPtr.ToInt64(), true, index), returnType, callArgs));
            }
        }
예제 #2
0
        public virtual Operand Call(MethodInfo info, params Operand[] callArgs)
        {
            IntPtr funcPtr = Delegates.GetDelegateFuncPtr(info);

            OperandType returnType = GetOperandType(info.ReturnType);

            Symbols.Add((ulong)funcPtr.ToInt64(), info.Name);

            return(Call(Const(funcPtr.ToInt64()), returnType, callArgs));
        }