示例#1
0
        void AddExternDef(string name, libtysila.Assembler.TypeToCompile ret, List <libtysila.Assembler.TypeToCompile> p, string cc)
        {
            libtysila.Signature.Method msig = new libtysila.Signature.Method
            {
                CallingConvention = libtysila.Signature.Method.CallConv.Default,
                ExplicitThis      = false,
                HasThis           = false,
                RetType           = ret.tsig,
                GenParamCount     = 0,
                ParamCount        = p.Count,
                Params            = new List <libtysila.Signature.Param>()
            };
            foreach (libtysila.Assembler.TypeToCompile i in p)
            {
                msig.Params.Add(i.tsig);
            }

            libtysila.Assembler.MethodToCompile mtc = new libtysila.Assembler.MethodToCompile {
                _ass = ass, meth = null,
                msig = msig
            };

            callconvs[name] = cc;
            msigs[name]     = msig;
        }
示例#2
0
        public void RequestMethod(libtysila.Assembler.MethodToCompile mtc, bool jit_stub)
        {
            if (mtc.type.IsDelegate(ass) && (mtc.meth.Name == ".ctor"))
            {
                // Rewrite delegate constructors
                mtc.msig.Method.Params[1] = new libtysila.Signature.Param(libtysila.BaseType_Type.VirtFtnPtr);
            }

            string mangled_name = mtc.ToString();

            if (compiled_objects.Contains(mangled_name))
            {
                return;
            }
            if (Program.IsCompiled(mangled_name))
            {
                return;
            }
            foreach (JitMethod jm in req_meths)
            {
                if (jm.mtc.Equals(mtc))
                {
                    return;
                }
            }

            base.RequestMethod(mtc);
            req_meths.Add(new JitMethod {
                mtc = mtc, is_jit_stub = jit_stub
            });
        }
示例#3
0
 public libtysila.Assembler.MethodToCompile? GetNextJitMethodInfo()
 {
     if (req_gms.Count > 0)
     {
         libtysila.Assembler.MethodToCompile ret = req_gms[0];
         req_gms.RemoveAt(0);
         compiled_objects.Add(ret.ToString());
         return(ret);
     }
     return(null);
 }
示例#4
0
        public override void RequestGenericMethodInfo(libtysila.Assembler.MethodToCompile mtc)
        {
            string mangled_name = libtysila.Mangler2.MangleMethodInfoSymbol(mtc, ass);

            if (compiled_objects.Contains(mangled_name))
            {
                return;
            }
            if (Program.IsCompiled(mangled_name))
            {
                return;
            }
            if (req_gms.Contains(mtc))
            {
                return;
            }

            base.RequestGenericMethodInfo(mtc);
            req_gms.Add(mtc);
        }
示例#5
0
 public override void RequestMethod(libtysila.Assembler.MethodToCompile mtc)
 {
     RequestMethod(mtc, true);
 }
示例#6
0
 public override void ExcludeGenericMethodInfo(libtysila.Assembler.MethodToCompile mtc)
 {
     throw new NotImplementedException();
 }