Beispiel #1
0
        public static CallSiteBinder StaticFunction(RuntimeTypeHandle type, string name, RuntimeTypeHandle classContext, RuntimeTypeHandle returnType)
        {
            var key = new BinderKey(3, name, null, type, classContext, returnType);

            if (_bindersCache.TryGetValue(key, out CallSiteBinder binder) == false)
            {
                _bindersCache[key] = binder = new CallStaticMethodBinder(type, name, classContext, returnType);
            }

            return(binder);
        }
Beispiel #2
0
        public static CallSiteBinder Function(string name, string nameOpt, RuntimeTypeHandle returnType)
        {
            var key = new BinderKey(1, name, nameOpt, returnType);

            if (_bindersCache.TryGetValue(key, out CallSiteBinder binder) == false)
            {
                _bindersCache[key] = binder = new CallFunctionBinder(name, nameOpt, returnType);
            }

            return(binder);
        }
Beispiel #3
0
        public static CallSiteBinder SetField(string name, RuntimeTypeHandle classContext, AccessMask access)
        {
            var key = new BinderKey(((int)access << 3) + 5, name, null, classContext);

            if (_bindersCache.TryGetValue(key, out CallSiteBinder binder) == false)
            {
                _bindersCache[key] = binder = new SetFieldBinder(name, classContext, access);
            }

            return(binder);
        }
Beispiel #4
0
        public static CallSiteBinder GetClassConst(string name, RuntimeTypeHandle classContext, RuntimeTypeHandle returnType, AccessMask access)
        {
            var key = new BinderKey(((int)access << 3) + 6, name, null, classContext, returnType);

            if (_bindersCache.TryGetValue(key, out CallSiteBinder binder) == false)
            {
                _bindersCache[key] = binder = new GetClassConstBinder(name, classContext, returnType, access);
            }

            return(binder);
        }
Beispiel #5
0
        public static CallSiteBinder InstanceFunction(string name, RuntimeTypeHandle classContext, RuntimeTypeHandle returnType, int genericParams)
        {
            var key = new BinderKey(2, name, null, classContext, returnType, generics: genericParams);

            if (_bindersCache.TryGetValue(key, out CallSiteBinder binder) == false)
            {
                _bindersCache[key] = binder = new CallInstanceMethodBinder(name, classContext, returnType, genericParams);
            }

            return(binder);
        }