开发者

is it prohibited using of JIT(just-in-time) compiled code in iOS app for AppStore?

I heard that JIT compiled code is not allowed in iOS AppStore because placing executable code in heap i开发者_Go百科s prohibited. It that right? Or just a rumor?


  1. Installable code isn't allowed ("or" is the key word in 3.3.2). Everything (except Javascript) has to be statically linked.

  2. JIT compiling into Javascript source code text appears to be allowed. (Not a joke, there is a commercial compiler that does this.) Compiling into bytecode for execution by an interpreter written Javascript and running in a UIWebView may confuse the reviewers enough to possibly reject an app doing that.

  3. The iOS security sandbox will likely kill any app that tries to jump into any dynamically generated data.


That is right. You can read in the iOS standard agreement, which you need to accept when setting up your developer enrollment:

3.3.2 An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple's built-in WebKit framework.


JIT compiling into Javascript source code text appears to be allowed. (Not a joke, there is a commercial compiler that does this.) Compiling into bytecode for execution...

I also made my thoughts about a compiler (not JIT but real programming language) running on iOS. My idea was using addresses to assembler-written functions implementing pseudo-opcodes as instructions instead of "traditional bytecode" (1 byte per pseudo-opcode).

One ARM register is reserved as "code pointer" (here named "rCP") pointing into my "bytecode". The last instruction of a pseudo-opcode-function is "ldmfd rCP!, {pc}". This means the last instruction of the function is not a "return" but a jump into the next opcode.

Using this method you get very fast "bytecode". Maybe the commercial compiler works like this. I cannot believe that there is a JIT compiler running native code on iOS.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜