Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

I heard that JIT compiled code is not allowed in iOS AppStore because placing executable code in heap is prohibited. It that right? Or just a rumor?

like image 275
eonil Avatar asked Feb 20 '11 01:02

eonil


People also ask

What is iOS JIT?

Overview. A just-in-time (JIT) compiler translates byte-code or intermediate script code into machine-language instructions, and makes those instructions available for execution. An app initiates JIT compilation as needed to support relevant tasks, and the compilation process takes place within the app's process space.

Why does Python not use JIT?

1. The Python language itself doesn't lend itself to being JIT compiled - it's too dynamic. 2. cPython is the reference implementation.

Can JIT be faster than compiled?

A JIT compiler can be faster because the machine code is being generated on the exact machine that it will also execute on. This means that the JIT has the best possible information available to it to emit optimized code.

Is JIT a compiler or interpreter?

A Just-In-Time (JIT) compiler is a feature of the run-time interpreter, that instead of interpreting bytecode every time a method is invoked, will compile the bytecode into the machine code instructions of the running machine, and then invoke this object code instead.


2 Answers

  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.

like image 197
hotpaw2 Avatar answered Sep 29 '22 18:09

hotpaw2


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.

like image 32
Funkybit Avatar answered Sep 29 '22 19:09

Funkybit