示例#1
0
        public void Action()
        {
            Call call = Call.Begin();

            if (pushSelf)
            {
                call.PushObject(anonObj);
            }
            virtualMachine.Execute(methodId, ref call, extraArgNum);
        }
示例#2
0
        public TResult Func <TResult>()
            where TResult : class
        {
            Call call = Call.Begin();

            if (pushSelf)
            {
                call.PushObject(anonObj);
            }
            virtualMachine.Execute(methodId, ref call, extraArgNum);
            return((TResult)call.GetObject());
        }
示例#3
0
        public override string ToString()
        {
            if (toStringMethodId == -1)
            {
                return(ObjectToString());
            }
            Call call = Call.Begin();

            call.PushObject(this);
            virtualMachine.Execute(toStringMethodId, ref call, 1, 0);
            return(call.GetAsType <string>(0));
        }
示例#4
0
        public override int GetHashCode()
        {
            if (getHashCodeMethodId == -1)
            {
                return(ObjectGetHashCode());
            }
            Call call = Call.Begin();

            call.PushObject(this);
            virtualMachine.Execute(getHashCodeMethodId, ref call, 1, 0);
            return(call.GetInt32(0));
        }
示例#5
0
        public override bool Equals(object obj)
        {
            if (equalMethodId == -1)
            {
                return(ObjectEquals(obj));
            }
            Call call = Call.Begin();

            call.PushObject(this);
            call.PushObject(obj);
            virtualMachine.Execute(equalMethodId, ref call, 2, 0);
            return(call.GetBoolean(0));
        }
示例#6
0
        public void Action <T1, T2>(T1 p1, T2 p2)
            where T1 : class
            where T2 : class
        {
            Call call = Call.Begin();

            if (pushSelf)
            {
                call.PushObject(anonObj);
            }
            call.PushObject(p1);
            call.PushObject(p2);
            virtualMachine.Execute(methodId, ref call, 2 + extraArgNum);
        }
示例#7
0
        public TResult Func <T1, TResult>(T1 p1)
            where T1 : class
            where TResult : class
        {
            Call call = Call.Begin();

            if (pushSelf)
            {
                call.PushObject(anonObj);
            }
            call.PushObject(p1);
            virtualMachine.Execute(methodId, ref call, 1 + extraArgNum);
            //从栈上获取结果
            return((TResult)call.GetObject());
        }
示例#8
0
        public void Action <T1>(T1 p1)
            where T1 : class
        {
            //创建call对象
            Call call = Call.Begin();

            if (pushSelf)
            {
                //如果有绑定的匿名对象,push
                call.PushObject(anonObj);
            }
            //push第一个参数
            call.PushObject(p1);
            //调用指定id的虚拟机方法
            virtualMachine.Execute(methodId, ref call, 1 + extraArgNum);
        }
示例#9
0
        public TResult Func <T1, T2, T3, TResult>(T1 p1, T2 p2, T3 p3)
            where T1 : class
            where T2 : class
            where T3 : class
            where TResult : class
        {
            Call call = Call.Begin();

            if (pushSelf)
            {
                call.PushObject(anonObj);
            }
            call.PushObject(p1);
            call.PushObject(p2);
            call.PushObject(p3);
            virtualMachine.Execute(methodId, ref call, 3 + extraArgNum);
            return((TResult)call.GetObject());
        }