Is there any documentation for ServiceStack.Text.JSConfig regarding MonotTouch AOT helpers?

Is there any documentation for ServiceStack.Text.JSConfig regarding MonotTouch AOT helpers?

I found this ... ServiceStack JIT bug in MonoTouch and I looked at the code, but there are no comments, and frankly, this is a little cryptic.

From my understanding of the AOT process, all I need to do to make sure that the type / method method is emitted is that this type / method is used in the same source, where the compiler thinks it can be used / called. There is no need to actually use / call anything at runtime. The whole point of AOT is that it is a compile-time process. Therefore, using a function / call inside a method that is not used will work until the optimizer removes it.

I am trying to use ServiceStack.Text.JsConfig.RegisterTypeForAot (); (in an unused method) to cure my AOT problems, but ran into other strange problems when I have too many calls. See Another question ...

Call ServiceStack.Text.JsConfig.RegisterTypeForAot <T> (); with MonoTouch calls SIGSEGV when run on the device

Perhaps I mistakenly used the RegisterTypeForAot () method? What do other methods do? RegisterForAot () and InitAot ()

+4
source share
1 answer

There is no documentation about JsConfig.InitForAot() , except that it is already in a line in JsConfig , that is:

Provide a hint to the MonotTouch AOT compiler to precompile common classes for all of your DTOs. Just need to be called once in the static constructor.

You only need to call JsConfig.InitForAot() stub and a JsConfig.RegisterTypeForAot<T>() for each type so that the MonoTouch compiler knows that the generated code must be pre-generated ahead of time so that all the code is available for general reflection, If you If you encounter a problem, send a small standalone test case with a question about GitHub problems so that we can see if there is any work around this can be done.

+1
source

All Articles