Exemple #1
0
        public void Emit(OpCode opcode, MethodSpec method)
        {
            if (IsAnonymousStoreyMutateRequired)
            {
                method = method.Mutate(CurrentAnonymousMethod.Storey.Mutator);
            }

            if (method.IsConstructor)
            {
                ig.Emit(opcode, (ConstructorInfo)method.GetMetaInfo());
            }
            else
            {
                ig.Emit(opcode, (MethodInfo)method.GetMetaInfo());
            }
        }
Exemple #2
0
        public void Emit(OpCode opcode, MethodSpec method)
        {
            if (IsAnonymousStoreyMutateRequired)
            {
                method = method.Mutate(CurrentAnonymousMethod.Storey.Mutator);
            }

            if (method.IsConstructor)
            {
                ig.Emit(opcode, (ConstructorInfo)method.GetMetaInfo());
            }
            else
            {
                ig.Emit(opcode, (MethodInfo)method.GetMetaInfo());
            }

            if (TrackStackTypes)
            {
                //
                // Don't bother with ldftn/Ldvirtftn they can never appear on open stack
                //
                if (method.IsConstructor)
                {
                    if (opcode == OpCodes.Newobj)
                    {
                        SetStackType(method.DeclaringType);
                    }
                }
                else
                {
                    if (method.ReturnType.Kind != MemberKind.Void)
                    {
                        SetStackType(method.ReturnType);
                    }
                }
            }
        }