[Mono-dev] Registering internal calls at runtime

Robert Jordan robertj at gmx.net
Tue Jul 13 17:08:43 EDT 2010


On 13.07.2010 21:17, Michel Boissé wrote:
>              class Program
>              {
>                  static void Main(string[] args)
>                  {
>                      Registrar.RegisterMethods();
>                      Console.Write(InternallyImplementedClass.InternalMethod());
>                  }

You cannot register the icall from within a method that eventually
calls the icall because the JIT does not know about the icall
at the time it compiles the method.

Something like that should work:

static void Main(string[] args)
{
     Registrar.RegisterMethods();
     DoWork();
}

static void DoWork()
{
     Console.Write(InternallyImplementedClass.InternalMethod());
}


Robert



More information about the Mono-devel-list mailing list