예제 #1
0
        public JSMethod(
            MethodReference reference, MethodInfo method, MethodTypeFactory methodTypes,
            IEnumerable <TypeReference> genericArguments = null
            )
        {
            if (reference == null)
            {
                throw new ArgumentNullException("reference");
            }
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }

            Reference   = reference;
            Method      = method;
            MethodTypes = methodTypes;

            if (genericArguments == null)
            {
                var gim = Reference as GenericInstanceMethod;
                if (gim != null)
                {
                    genericArguments = gim.GenericArguments;
                }
            }

            GenericArguments = genericArguments;
        }
예제 #2
0
 public ExpandCastExpressions (TypeSystem typeSystem, JSSpecialIdentifiers js, JSILIdentifier jsil, ITypeInfoSource typeInfo, MethodTypeFactory methodTypeFactory) {
     TypeSystem = typeSystem;
     JS = js;
     JSIL = jsil;
     TypeInfo = typeInfo;
     MethodTypeFactory = methodTypeFactory;
 }
예제 #3
0
        public IntroduceEnumCasts(
            TypeSystem typeSystem, JSSpecialIdentifiers js,
            TypeInfoProvider typeInfo, MethodTypeFactory methodTypes,
            IFunctionSource functionSource
            )
        {
            TypeSystem     = typeSystem;
            TypeInfo       = typeInfo;
            MethodTypes    = methodTypes;
            JS             = js;
            FunctionSource = functionSource;

            LogicalOperators = new HashSet <JSOperator>()
            {
                JSOperator.LogicalAnd,
                JSOperator.LogicalOr,
                JSOperator.LogicalNot
            };

            BitwiseOperators = new HashSet <JSOperator>()
            {
                JSOperator.BitwiseAnd,
                JSOperator.BitwiseOr,
                JSOperator.BitwiseXor
            };
        }
예제 #4
0
 public JSCachedMethod(
     MethodReference reference, MethodInfo method, MethodTypeFactory methodTypes,
     IEnumerable <TypeReference> genericArguments, int index
     ) : base(reference, method, methodTypes, genericArguments)
 {
     Index = index;
 }
예제 #5
0
 public SpecialIdentifiers(MethodTypeFactory methodTypes, TypeSystem typeSystem, ITypeInfoSource typeInfo)
 {
     TypeSystem = typeSystem;
     JS         = new JSSpecialIdentifiers(methodTypes, typeSystem);
     CLR        = new CLRSpecialIdentifiers(typeSystem);
     JSIL       = new JSILIdentifier(methodTypes, typeSystem, typeInfo, JS);
 }
예제 #6
0
 public ExpandCastExpressions(TypeSystem typeSystem, JSSpecialIdentifiers js, JSILIdentifier jsil, ITypeInfoSource typeInfo, MethodTypeFactory methodTypeFactory)
 {
     TypeSystem        = typeSystem;
     JS                = js;
     JSIL              = jsil;
     TypeInfo          = typeInfo;
     MethodTypeFactory = methodTypeFactory;
 }
예제 #7
0
 public UnsafeCodeTransforms (
     Configuration configuration,
     TypeSystem typeSystem, 
     MethodTypeFactory methodTypes
 ) {
     Configuration = configuration;
     TypeSystem = typeSystem;
     MethodTypes = methodTypes;
 }
예제 #8
0
        public JSILIdentifier(MethodTypeFactory methodTypes, TypeSystem typeSystem, JSSpecialIdentifiers js)
        {
            TypeSystem = typeSystem;
            MethodTypes = methodTypes;
            JS = js;

            GlobalNamespace = Dot("GlobalNamespace", TypeSystem.Object);
            CopyMembers = Dot("CopyMembers", TypeSystem.Void);
        }
예제 #9
0
        public EmulateInt64(MethodTypeFactory methodTypeFactory, TypeSystem typeSystem)
        {
            TypeSystem        = typeSystem;
            MethodTypeFactory = methodTypeFactory;

            int64 = new JSType(TypeSystem.Int64);

            uint64 = new JSType(TypeSystem.UInt64);
        }
예제 #10
0
        public JSILIdentifier(MethodTypeFactory methodTypes, TypeSystem typeSystem, JSSpecialIdentifiers js)
        {
            TypeSystem  = typeSystem;
            MethodTypes = methodTypes;
            JS          = js;

            GlobalNamespace = Dot("GlobalNamespace", TypeSystem.Object);
            CopyMembers     = Dot("CopyMembers", TypeSystem.Void);
        }
예제 #11
0
        public EmulateInt64(MethodTypeFactory methodTypeFactory, TypeSystem typeSystem)
        {
            TypeSystem = typeSystem;
            MethodTypeFactory = methodTypeFactory;

            int64 = new JSType(TypeSystem.Int64);

            uint64 = new JSType(TypeSystem.UInt64);
        }
예제 #12
0
        public FunctionCache(ITypeInfoSource typeInfo)
        {
            TypeInfo = typeInfo;
            Comparer = new QualifiedMemberIdentifier.Comparer(typeInfo);

            Cache = new ConcurrentCache <QualifiedMemberIdentifier, Entry>(
                Environment.ProcessorCount, 4096, Comparer
                );
            PendingTransformsQueue = new ConcurrentHashQueue <QualifiedMemberIdentifier>(
                Math.Max(1, Environment.ProcessorCount / 4), 4096, Comparer
                );
            ActiveTransformPipelines = new ConcurrentDictionary <QualifiedMemberIdentifier, FunctionTransformPipeline>(
                Math.Max(1, Environment.ProcessorCount / 4), 128, Comparer
                );
            MethodTypes = new MethodTypeFactory();

            MakeCacheEntry = (id, method) => {
                PendingTransformsQueue.TryEnqueue(id);

                return(new Entry(id, Locks)
                {
                    Info = method.Method,
                    Reference = method.Reference,
                    SecondPass = new FunctionAnalysis2ndPass(this, method.Method)
                });
            };

            MakePopulatedCacheEntry = (id, args) => {
                var result = new JSFunctionExpression(
                    new JSMethod(args.Method, args.Info, MethodTypes),
                    args.Translator.Variables,
                    args.Parameters,
                    args.Body,
                    MethodTypes
                    );

                PendingTransformsQueue.TryEnqueue(id);

                return(new Entry(id, Locks)
                {
                    Info = args.Info,
                    Reference = args.Method,
                    Expression = result,
                    SpecialIdentifiers = args.Translator.SpecialIdentifiers
                });
            };

            MakeNullCacheEntry = (id, args) => {
                return(new Entry(id, Locks)
                {
                    Info = args.Info,
                    Reference = args.Method,
                    Expression = null
                });
            };
        }
예제 #13
0
 public HoistAllocations (
     QualifiedMemberIdentifier member, 
     IFunctionSource functionSource, 
     TypeSystem typeSystem,
     MethodTypeFactory methodTypes
 ) 
     : base (member, functionSource) {
     TypeSystem = typeSystem;
     MethodTypes = methodTypes;
 }
예제 #14
0
 public UnsafeCodeTransforms(
     Configuration configuration,
     TypeSystem typeSystem,
     MethodTypeFactory methodTypes
     )
 {
     Configuration = configuration;
     TypeSystem    = typeSystem;
     MethodTypes   = methodTypes;
 }
예제 #15
0
        public FunctionCache(ITypeInfoSource typeInfo)
        {
            var comparer = new QualifiedMemberIdentifier.Comparer(typeInfo);

            Cache = new ConcurrentCache <QualifiedMemberIdentifier, Entry>(
                Environment.ProcessorCount, 4096, comparer
                );
            OptimizationQueue = new ConcurrentHashQueue <QualifiedMemberIdentifier>(
                Math.Max(1, Environment.ProcessorCount / 4), 4096, comparer
                );
            MethodTypes = new MethodTypeFactory();

            MakeCacheEntry = (id, method) => {
                OptimizationQueue.TryEnqueue(id);

                return(new Entry {
                    Info = method.Method,
                    Reference = method.Reference,
                    Identifier = id,
                    ParameterNames = new HashSet <string>(from p in method.Method.Parameters select p.Name),
                    SecondPass = new FunctionAnalysis2ndPass(this, method.Method)
                });
            };

            MakePopulatedCacheEntry = (id, args) => {
                var result = new JSFunctionExpression(
                    new JSMethod(args.Method, args.Info, MethodTypes),
                    args.Translator.Variables,
                    args.Parameters,
                    args.Body,
                    MethodTypes
                    );

                OptimizationQueue.TryEnqueue(id);

                return(new Entry {
                    Identifier = id,
                    Info = args.Info,
                    Reference = args.Method,
                    Expression = result,
                    Variables = args.Translator.Variables,
                    ParameterNames = args.Translator.ParameterNames,
                    SpecialIdentifiers = args.Translator.SpecialIdentifiers
                });
            };

            MakeNullCacheEntry = (id, args) => {
                return(new Entry {
                    Identifier = id,
                    Info = args.Info,
                    Reference = args.Method,
                    Expression = null
                });
            };
        }
예제 #16
0
        public FunctionCache(ITypeInfoSource typeInfo)
        {
            TypeInfo = typeInfo;
            Comparer = new QualifiedMemberIdentifier.Comparer(typeInfo);

            Cache = new ConcurrentCache<QualifiedMemberIdentifier, Entry>(
                Environment.ProcessorCount, 4096, Comparer
            );
            PendingTransformsQueue = new ConcurrentHashQueue<QualifiedMemberIdentifier>(
                Math.Max(1, Environment.ProcessorCount / 4), 4096, Comparer
            );
            ActiveTransformPipelines = new ConcurrentDictionary<QualifiedMemberIdentifier, FunctionTransformPipeline>(
                Math.Max(1, Environment.ProcessorCount / 4), 128, Comparer
            );
            MethodTypes = new MethodTypeFactory();

            MakeCacheEntry = (id, method) => {
                PendingTransformsQueue.TryEnqueue(id);

                return new Entry(id, Locks) {
                    Info = method.Method,
                    Reference = method.Reference,
                    SecondPass = new FunctionAnalysis2ndPass(this, method.Method)
                };
            };

            MakePopulatedCacheEntry = (id, args) => {
                var result = new JSFunctionExpression(
                    new JSMethod(args.Method, args.Info, MethodTypes),
                    args.Translator.Variables,
                    args.Parameters,
                    args.Body,
                    MethodTypes
                );

                PendingTransformsQueue.TryEnqueue(id);

                return new Entry(id, Locks) {
                    Info = args.Info,
                    Reference = args.Method,
                    Expression = result,
                    Variables = args.Translator.Variables,
                    SpecialIdentifiers = args.Translator.SpecialIdentifiers
                };
            };

            MakeNullCacheEntry = (id, args) => {
                return new Entry(id, Locks) {
                    Info = args.Info,
                    Reference = args.Method,
                    Expression = null
                };
            };
        }
예제 #17
0
 public FunctionCache(ITypeInfoSource typeInfo)
 {
     var comparer = new QualifiedMemberIdentifier.Comparer(typeInfo);
     Cache = new ConcurrentCache<QualifiedMemberIdentifier, Entry>(
         Environment.ProcessorCount, 4096, comparer
     );
     OptimizationQueue = new ConcurrentHashQueue<QualifiedMemberIdentifier>(
         Math.Max(1, Environment.ProcessorCount / 4), 4096, comparer
     );
     MethodTypes = new MethodTypeFactory();
 }
예제 #18
0
 public UnsafeCodeTransforms (
     Configuration configuration,
     TypeSystem typeSystem, 
     MethodTypeFactory methodTypes,
     IFunctionSource functionSource
 ) {
     Configuration = configuration;
     TypeSystem = typeSystem;
     MethodTypes = methodTypes;
     FunctionSource = functionSource;
 }
예제 #19
0
 public HoistAllocations(
     QualifiedMemberIdentifier member,
     IFunctionSource functionSource,
     TypeSystem typeSystem,
     MethodTypeFactory methodTypes
     )
     : base(member, functionSource)
 {
     TypeSystem  = typeSystem;
     MethodTypes = methodTypes;
 }
예제 #20
0
        public JSSpecialIdentifiers (MethodTypeFactory methodTypes, TypeSystem typeSystem) {
            TypeSystem = typeSystem;
            MethodTypes = methodTypes;

            prototype = Object("prototype");
            eval = new JSFakeMethod("eval", TypeSystem.Object, new[] { TypeSystem.String }, methodTypes);
            toString = new JSFakeMethod("toString", TypeSystem.String, null, methodTypes);
            floor = new JSDotExpression(Object("Math"), new JSFakeMethod("floor", TypeSystem.Int32, null, methodTypes));
            fromCharCode = new JSDotExpression(Object("String"), new JSFakeMethod("fromCharCode", TypeSystem.Char, new[] { TypeSystem.Int32 }, methodTypes));
            charCodeAt = new JSFakeMethod("charCodeAt", TypeSystem.Int32, new[] { TypeSystem.Char }, methodTypes);
        }
예제 #21
0
        public FunctionCache(ITypeInfoSource typeInfo)
        {
            var comparer = new QualifiedMemberIdentifier.Comparer(typeInfo);
            Cache = new ConcurrentCache<QualifiedMemberIdentifier, Entry>(
                Environment.ProcessorCount, 4096, comparer
            );
            OptimizationQueue = new ConcurrentHashQueue<QualifiedMemberIdentifier>(
                Math.Max(1, Environment.ProcessorCount / 4), 4096, comparer
            );
            MethodTypes = new MethodTypeFactory();

            MakeCacheEntry = (id, method) => {
                OptimizationQueue.TryEnqueue(id);

                return new Entry {
                    Info = method.Method,
                    Reference = method.Reference,
                    Identifier = id,
                    ParameterNames = new HashSet<string>(from p in method.Method.Parameters select p.Name),
                    SecondPass = new FunctionAnalysis2ndPass(this, method.Method)
                };
            };

            MakePopulatedCacheEntry = (id, args) => {
                var result = new JSFunctionExpression(
                    new JSMethod(args.Method, args.Info, MethodTypes),
                    args.Translator.Variables,
                    args.Parameters,
                    args.Body,
                    MethodTypes
                );

                OptimizationQueue.TryEnqueue(id);

                return new Entry {
                    Identifier = id,
                    Info = args.Info,
                    Reference = args.Method,
                    Expression = result,
                    Variables = args.Translator.Variables,
                    ParameterNames = args.Translator.ParameterNames,
                    SpecialIdentifiers = args.Translator.SpecialIdentifiers
                };
            };

            MakeNullCacheEntry = (id, args) => {
                return new Entry {
                    Identifier = id,
                    Info = args.Info,
                    Reference = args.Method,
                    Expression = null
                };
            };
        }
예제 #22
0
파일: FunctionCache.cs 프로젝트: xen2/JSIL
        public FunctionCache(ITypeInfoSource typeInfo)
        {
            var comparer = new QualifiedMemberIdentifier.Comparer(typeInfo);

            Cache = new ConcurrentCache <QualifiedMemberIdentifier, Entry>(
                Environment.ProcessorCount, 4096, comparer
                );
            OptimizationQueue = new ConcurrentHashQueue <QualifiedMemberIdentifier>(
                Math.Max(1, Environment.ProcessorCount / 4), 4096, comparer
                );
            MethodTypes = new MethodTypeFactory();
        }
예제 #23
0
 public UnsafeCodeTransforms(
     Configuration configuration,
     TypeSystem typeSystem,
     MethodTypeFactory methodTypes,
     IFunctionSource functionSource
     )
 {
     Configuration  = configuration;
     TypeSystem     = typeSystem;
     MethodTypes    = methodTypes;
     FunctionSource = functionSource;
 }
예제 #24
0
 public JSFakeMethod(
     string name, TypeReference returnType,
     TypeReference[] parameterTypes, MethodTypeFactory methodTypes,
     JSExpression[] genericArguments = null
     )
 {
     Name             = name;
     ReturnType       = returnType;
     ParameterTypes   = parameterTypes ?? new TypeReference[0];
     MethodTypes      = methodTypes;
     GenericArguments = genericArguments;
 }
예제 #25
0
        public JSSpecialIdentifiers(MethodTypeFactory methodTypes, TypeSystem typeSystem)
        {
            TypeSystem  = typeSystem;
            MethodTypes = methodTypes;

            prototype    = Object("prototype");
            eval         = new JSFakeMethod("eval", TypeSystem.Object, new[] { TypeSystem.String }, methodTypes);
            toString     = new JSFakeMethod("toString", TypeSystem.String, null, methodTypes);
            floor        = new JSDotExpression(Object("Math"), new JSFakeMethod("floor", TypeSystem.Int32, null, methodTypes));
            fromCharCode = new JSDotExpression(Object("String"), new JSFakeMethod("fromCharCode", TypeSystem.Char, new[] { TypeSystem.Int32 }, methodTypes));
            charCodeAt   = new JSFakeMethod("charCodeAt", TypeSystem.Int32, new[] { TypeSystem.Char }, methodTypes);
        }
        public EliminatePointlessRetargeting (
            QualifiedMemberIdentifier member, 
            IFunctionSource functionSource, 
            TypeSystem typeSystem,
            MethodTypeFactory methodTypes
        ) 
            : base (member, functionSource) {
            TypeSystem = typeSystem;
            MethodTypes = methodTypes;

            SeenRetargetsInScope.Push(new Dictionary<RetargetKey, int>());
            ScopeNodeIndices.Push(-1);
        }
예제 #27
0
        public IntroduceEnumCasts(TypeSystem typeSystem, JSSpecialIdentifiers js, TypeInfoProvider typeInfo, MethodTypeFactory methodTypes)
        {
            TypeSystem  = typeSystem;
            TypeInfo    = typeInfo;
            MethodTypes = methodTypes;
            JS          = js;

            LogicalOperators = new HashSet <JSOperator>()
            {
                JSOperator.LogicalAnd,
                JSOperator.LogicalOr,
                JSOperator.LogicalNot
            };
        }
        public EliminatePointlessRetargeting(
            QualifiedMemberIdentifier member,
            IFunctionSource functionSource,
            TypeSystem typeSystem,
            MethodTypeFactory methodTypes
            )
            : base(member, functionSource)
        {
            TypeSystem  = typeSystem;
            MethodTypes = methodTypes;

            SeenRetargetsInScope.Push(new Dictionary <RetargetKey, int>());
            ScopeNodeIndices.Push(-1);
        }
 public EmulateStructAssignment (
     QualifiedMemberIdentifier member, 
     IFunctionSource functionSource, 
     TypeSystem typeSystem, 
     TypeInfoProvider typeInfo, 
     CLRSpecialIdentifiers clr, 
     MethodTypeFactory methodTypes,
     bool optimizeCopies
 )
     : base (member, functionSource) {
     TypeSystem = typeSystem;
     TypeInfo = typeInfo;
     CLR = clr;
     MethodTypes = methodTypes;
     OptimizeCopies = optimizeCopies;
 }
예제 #30
0
 public EmulateStructAssignment(
     QualifiedMemberIdentifier member,
     IFunctionSource functionSource,
     TypeSystem typeSystem,
     TypeInfoProvider typeInfo,
     CLRSpecialIdentifiers clr,
     MethodTypeFactory methodTypes,
     bool optimizeCopies
     )
     : base(member, functionSource)
 {
     TypeSystem     = typeSystem;
     TypeInfo       = typeInfo;
     CLR            = clr;
     MethodTypes    = methodTypes;
     OptimizeCopies = optimizeCopies;
 }
예제 #31
0
        public IntroduceEnumCasts (TypeSystem typeSystem, JSSpecialIdentifiers js, TypeInfoProvider typeInfo, MethodTypeFactory methodTypes) {
            TypeSystem = typeSystem;
            TypeInfo = typeInfo;
            MethodTypes = methodTypes;
            JS = js;

            LogicalOperators = new HashSet<JSOperator>() {
                JSOperator.LogicalAnd,
                JSOperator.LogicalOr,
                JSOperator.LogicalNot
            };

            BitwiseOperators = new HashSet<JSOperator>() {
                JSOperator.BitwiseAnd,
                JSOperator.BitwiseOr,
                JSOperator.BitwiseXor
            };
        }
예제 #32
0
 public FixupPointerArithmetic(TypeSystem typeSystem, MethodTypeFactory methodTypes)
 {
     TypeSystem = typeSystem;
     MethodTypes = methodTypes;
 }
예제 #33
0
 public UnsafeCodeTransforms(TypeSystem typeSystem, MethodTypeFactory methodTypes)
 {
     TypeSystem = typeSystem;
     MethodTypes = methodTypes;
 }
예제 #34
0
 public JSAstBuilder FakeMethod(string name, TypeReference returnType, TypeReference[] parameterTypes, MethodTypeFactory methodTypeFactory)
 {
     return Dot(new JSFakeMethod(name, returnType, parameterTypes, methodTypeFactory));
 }
예제 #35
0
        public static JSExpression GetItem(TypeReference targetType, TypeInfo targetTypeInfo, JSExpression target, JSExpression index, MethodTypeFactory methodTypes, bool proxy = false)
        {
            var targetGit     = (GenericInstanceType)targetType;
            var getMethodName = "get_Item";
            var getMethod     = (JSIL.Internal.MethodInfo)targetTypeInfo.Members.First(
                (kvp) => kvp.Key.Name == getMethodName
                ).Value;

            if (proxy)
            {
                return(new JSNewPackedArrayElementProxy(
                           target, index, targetGit.GenericArguments[0]
                           ));
            }

            // We have to construct a custom reference to the method in order for ILSpy's
            //  SubstituteTypeArgs method not to explode later on
            var getMethodReference = CecilUtil.RebindMethod(getMethod.Member, targetGit, targetGit.GenericArguments[0]);

            var result = JSInvocationExpression.InvokeMethod(
                new JSType(targetType),
                new JSMethod(getMethodReference, getMethod, methodTypes),
                target,
                new JSExpression[] { index },
                constantIfArgumentsAre: proxy
                );

            return(result);
        }
예제 #36
0
 public JSAstBuilder FakeMethod(string name, TypeReference returnType, TypeReference[] parameterTypes, MethodTypeFactory methodTypeFactory)
 {
     return(Dot(new JSFakeMethod(name, returnType, parameterTypes, methodTypeFactory)));
 }
예제 #37
0
 public IntroducePackedArrays(TypeSystem typeSystem, MethodTypeFactory methodTypes)
 {
     TypeSystem  = typeSystem;
     MethodTypes = methodTypes;
 }
예제 #38
0
 public EmulateInt64(MethodTypeFactory methodTypeFactory, TypeSystem typeSystem)
 {
     TypeSystem = typeSystem;
     MethodTypeFactory = methodTypeFactory;
 }
예제 #39
0
파일: EmulateInt64.cs 프로젝트: ticuth/JSIL
 public EmulateInt64(MethodTypeFactory methodTypeFactory, TypeSystem typeSystem)
 {
     TypeSystem        = typeSystem;
     MethodTypeFactory = methodTypeFactory;
 }
예제 #40
0
        public static JSExpression GetItem (TypeReference targetType, TypeInfo targetTypeInfo, JSExpression target, JSExpression index, MethodTypeFactory methodTypes, bool proxy = false) {
            var targetGit = (GenericInstanceType)targetType;
            var getMethodName = "get_Item";
            var getMethod = (JSIL.Internal.MethodInfo)targetTypeInfo.Members.First(
                (kvp) => kvp.Key.Name == getMethodName
            ).Value;

            if (proxy)
                return new JSNewPackedArrayElementProxy(
                    target, index, targetGit.GenericArguments[0]
                );

            // We have to construct a custom reference to the method in order for ILSpy's
            //  SubstituteTypeArgs method not to explode later on
            var getMethodReference = CecilUtil.RebindMethod(getMethod.Member, targetGit, targetGit.GenericArguments[0]);

            var result = JSInvocationExpression.InvokeMethod(
                new JSType(targetType),
                new JSMethod(getMethodReference, getMethod, methodTypes),
                target,
                new JSExpression[] { index },
                constantIfArgumentsAre: proxy
            );

            return result;
        }
예제 #41
0
 public UnsafeCodeTransforms(TypeSystem typeSystem, MethodTypeFactory methodTypes)
 {
     TypeSystem  = typeSystem;
     MethodTypes = methodTypes;
 }
예제 #42
0
 public SpecialIdentifiers(MethodTypeFactory methodTypes, TypeSystem typeSystem)
 {
     TypeSystem = typeSystem;
     JS = new JSSpecialIdentifiers(methodTypes, typeSystem);
     CLR = new CLRSpecialIdentifiers(typeSystem);
     JSIL = new JSILIdentifier(methodTypes, typeSystem, JS);
 }
예제 #43
0
        public JSMethod(
            MethodReference reference, MethodInfo method, MethodTypeFactory methodTypes,
            IEnumerable<TypeReference> genericArguments = null
        )
        {
            if (reference == null)
                throw new ArgumentNullException("reference");
            if (method == null)
                throw new ArgumentNullException("method");

            Reference = reference;
            Method = method;
            MethodTypes = methodTypes;

            if (genericArguments == null) {
                var gim = Reference as GenericInstanceMethod;
                if (gim != null)
                    genericArguments = gim.GenericArguments;
            }

            GenericArguments = genericArguments;
        }
예제 #44
0
 public JSFakeMethod(
     string name, TypeReference returnType,
     TypeReference[] parameterTypes, MethodTypeFactory methodTypes,
     JSExpression[] genericArguments = null
 )
 {
     Name = name;
     ReturnType = returnType;
     ParameterTypes = parameterTypes ?? new TypeReference[0];
     MethodTypes = methodTypes;
     GenericArguments = genericArguments;
 }
예제 #45
0
 public JSCachedMethod (
     MethodReference reference, MethodInfo method, MethodTypeFactory methodTypes,
     IEnumerable<TypeReference> genericArguments, int index
 ) : base (reference, method, methodTypes, genericArguments) {
     Index = index;
 }
예제 #46
0
 public IntroducePackedArrays (TypeSystem typeSystem, MethodTypeFactory methodTypes) {
     TypeSystem = typeSystem;
     MethodTypes = methodTypes;
 }