Regarding the Jit probably this is not the best place to ask, but I need some general information to understand if it can be applicable to my case.
Just a few questions if someone can give me a simple answer or redirect me to the available information ...
1) Does the JIT generate processor (x86 in my case) instructions, or it is some additional byte code optimization but still interpreted by a virtual machine?
2) In case real processor instructions are generated, I expect that they are first generated as data. So what is the method used to "jump" to the data? Nowadays processor normally disable data execution and only privileged instructions are allowed to change this.
3) Instead, in case only some internal optimization is done and not real processor instructions, what is the expected execution speed gain against the average script code?
1) It produces native x86 instructions with fallback to the VM under various conditions (some specific types of calls it can't handle natively, script exceptions, and any new ops that might be added since it was last updated).
2) The JIT requests a page from the OS which can be set to be executable. There is a rather simple class, CodePage, which is responsible for this allocation and can easily be changed. The JIT does expect that new code pages can be allocated dynamically, but a single large static page should be sufficient for most purposes. Jumping to the executable page is handled by the JIT instructions in the VM.
3) Native code runs between 2x and 10x faster depending on the exact code being executed and the architecture involved.