예제 #1
0
        /// <summary>
        /// Resolve method with static argument info
        /// </summary>
        /// <param name="method">Resolved method</param>
        /// <returns>Resolved method name</returns>
        public override GeneratorBase StaticResolve(MethodID method)
        {
            if (method == EntryPoint)
            {
                return(new DirectedGenerator(_director));
            }

            return(_wrapped.StaticResolve(method));
        }
예제 #2
0
        /// <summary>
        /// Get generator for given name and arguments.
        /// </summary>
        /// <param name="method">Name of method generator.</param>
        /// <param name="arguments">Arguments of call.</param>
        /// <returns>Instruction generator for given name.</returns>
        private GeneratorBase getGenerator(ref MethodID method, InstanceInfo[] arguments)
        {
            if (method.NeedsDynamicResolving)
            {
                method = _loader.DynamicResolve(method, arguments);
            }

            if (method == null)
            {
                return(null);
            }

            GeneratorBase resolved;

            if (!_methods.TryGetValue(method, out resolved))
            {
                //register resolved method
                resolved         = _loader.StaticResolve(method);
                _methods[method] = resolved;
            }

            return(resolved);
        }