Exemplo n.º 1
0
        /// <summary>
        /// Generates a map of unique method names and the corresponding compiled-methods.
        /// </summary>
        /// <returns></returns>
        private List <MethodInformation> GetMethodNameMap()
        {
            Dictionary <string, MethodInformation> map = new Dictionary <string, MethodInformation>();

            foreach (CompiledMethod method in this.Methods.Values)
            {
                RuntimeCompiledMethod runtimeMethod = method as RuntimeCompiledMethod;
                if (runtimeMethod == null)
                {
                    throw new Exception("Expected to see a RuntimeCompiledMethod"); // ... since we have compiled everything ourself.
                }
                string name = MethodGenerator.GetUniqueName(map, this.Compiler.NativeGenerator.AsLegalMethodName(method.Selector.Value));
                map.Add(name, MethodInformation.CreateMethodInformation(this.Compiler, name, runtimeMethod));
            }

            return(map.Values.ToList());
        }
Exemplo n.º 2
0
 private MethodInformation(NativeCompiler compiler, string name, RuntimeCompiledMethod method)
 {
     this.Compiler   = compiler;
     this.Method     = method;
     this.MethodName = name;
 }
Exemplo n.º 3
0
 public static MethodInformation CreateMethodInformation(NativeCompiler compiler, string name, RuntimeCompiledMethod method)
 {
     return(new MethodInformation(compiler, name, method));
 }
        public bool ValidateMethod(MethodDefinition definition, IDefinitionInstallerContext installer, SmalltalkClass cls, CompiledMethod.MethodType methodType, ICodeValidationErrorSink errorSink)
        {
            RuntimeCompiledMethod method = (RuntimeCompiledMethod)this.CreateMethod(definition, installer, cls, methodType);

            return(method.Validate(installer.NameScope, this.GetErrorSink(errorSink)));
        }