且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MonoTouch:使用ServiceStack导致JIT错误?

更新时间:2023-12-05 12:03:16

我正在使用Service Stack的MonoTouch构建版本

I am using the MonoTouch build of Service Stack from

这些.dll已有3个多月的历史了,出现了一个类似问题在一个月前找到并修复.

Those .dll are more than 3 months old and a similar issue was found and fixed one month ago.

我收到一个JIT错误.我以为MonoTouch会在构建过程中解决这个问题?

I get a JIT error. I thought MonoTouch took care of that in the build?

是的.为MonoTouch构建时,将使用AOT(提前)编译器.它会在运行时知道所需的所有内容进行编译.

Yes. When building for MonoTouch the AOT (ahead of time) compiler is used. It compiles everything it knows it will require at runtime.

但是,有时AOT编译器不能了解所有内容(例如通用虚拟方法)编译所有可能的变体(例如值类型).请参阅文档网站中的通用限制.在这种情况下,它的AOT编译器可能需要帮助(签名将确保编译正确的代码,例如

However sometimes the AOT compiler cannot know everything (e.g. generic virtual methods) or compile every possible variations (e.g. value types). See the section generic limitations in the documentation web site. In such case it AOT compiler might need help (a signature that will ensure the right code will be compiled, e.g. something like this).

这也可能是一个错误-由于某种原因未对所需方法进行AOT.发现该错误后,在运行时将发生异常,因为缺少代码并且无法使用JIT来提供它.

It can also be a bug - where a required method was not AOT'ed for some reason. When this is discovered, at runtime, an exception will occurs because the code is missing and the JIT cannot be used to provide it.