Invoke() public method

public Invoke ( MethodInfo method, ITypeMapper typeMapper ) : ContextualOperand
method MethodInfo
typeMapper ITypeMapper
return ContextualOperand
Exemplo n.º 1
0
        public void InvokeTailCall(Operand destination, string method, params Operand[] args)
        {
            Invocation call = destination.Invoke(method, args) as Invocation;

            call.tailcall = true;
            BeforeStatement();
            call.EmitGet(this);
        }
Exemplo n.º 2
0
        public void Invoke(Operand target, string method, params Operand[] args)
        {
            if ((object)target == null)
            {
                throw new ArgumentNullException("target");
            }

            DoInvoke(target.Invoke(method, args));
        }
Exemplo n.º 3
0
        public void InvokeTailCall(Operand destination, string method, string labelName, params Operand[] args)
        {
            Invocation call = destination.Invoke(method, args) as Invocation;

            call.tailcall = true;
            BeforeStatement();
            call.EmitGet(this);
            if (labelName != null)
            {
                IL.MarkLabel(RecordLabelMarked(LastLabel = labelName, GetNamedLabel(labelName)));
            }
            UnequivocableReturn();
        }
Exemplo n.º 4
0
            protected override void EndImpl()
            {
                g.il.MarkLabel(lbTest);
                enumerator.Invoke("MoveNext").EmitGet(g);

                g.il.Emit(OpCodes.Brtrue, lbLoop);

                if (endUsed)
                {
                    g.il.MarkLabel(lbEnd);
                }

                g.reachable = true;
            }
Exemplo n.º 5
0
            protected override void EndImpl()
            {
                G.IL.MarkLabel(_lbTest);
                _enumerator.Invoke("MoveNext", _typeMapper).EmitGet(G);

                G.IL.Emit(OpCodes.Brtrue, _lbLoop);

                if (_endUsed)
                {
                    G.IL.MarkLabel(_lbEnd);
                }

                G._reachable = true;
            }
Exemplo n.º 6
0
            protected override void BeginImpl()
            {
                g.BeforeStatement();

                enumerator = g.Local();
                lbLoop     = g.il.DefineLabel();
                lbTest     = g.il.DefineLabel();

                if (typeof(IEnumerable).IsAssignableFrom(collection.Type))
                {
                    collection = collection.Cast(typeof(IEnumerable));
                }

                g.Assign(enumerator, collection.Invoke("GetEnumerator"));
                g.il.Emit(OpCodes.Br, lbTest);
                g.il.MarkLabel(lbLoop);
                element = g.Local(elementType);
                g.Assign(element, enumerator.Property("Current"), true);
            }
Exemplo n.º 7
0
            protected override void BeginImpl()
            {
                G.BeforeStatement();

                _enumerator = G.Local();
                _lbLoop     = G.IL.DefineLabel();
                _lbTest     = G.IL.DefineLabel();

                if (Helpers.IsAssignableFrom(typeof(IEnumerable), _collection.GetReturnType(G.TypeMapper), _typeMapper))
                {
                    _collection = _collection.Cast(_typeMapper.MapType(typeof(IEnumerable)));
                }

                G.Assign(_enumerator, _collection.Invoke("GetEnumerator", _typeMapper));
                G.IL.Emit(OpCodes.Br, _lbTest);
                G.IL.MarkLabel(_lbLoop);
                Element = G.Local(_elementType);
                G.Assign(Element, _enumerator.Property("Current", _typeMapper), true);
            }
		public void Invoke(Operand target, string method, params Operand[] args)
		{
			if ((object)target == null)
				throw new ArgumentNullException("target");

			DoInvoke(target.Invoke(method, args));
		}
Exemplo n.º 9
0
 public void Invoke(Operand target, MethodInfo method, params Operand[] args)
 {
     DoInvoke(target.Invoke(method, TypeMapper, args));
 }