Eclipse OMR - JitBuilder

Let's start with JIT compilation.

The full name of the JIT compiler is: Just-In-Time Compiler. The literal meaning of JIT is: instant, anytime. In layman's terms, the workflow of the JIT compiler is: when the code is running, the code is compiled into machine code, and then executed. A more detailed process is: a certain piece of code is first interpreted and executed. After a certain number of interpretations and executions, the virtual machine speculates that this code will continue to be executed, and compiles it into machine code (this machine code is stored in memory. ), and then when the code is executed again, it is replaced by the machine code in memory to run, thereby speeding up the execution of the program.

With a JIT compiler, the code can be gradually transitioned from interpreted execution to compiled execution.

Writing a JIT compiler is technically very difficult. For example, PHP did not develop JIT until this year (2017). PHP had a JIT experimental project before, but it was a failed attempt.

With that background out of the way, let's talk about Eclipse OMR JitBuilder.

JitBuilder is a toolkit for building JIT compilers. This toolkit is provided in the form of C++ code and libraries.

JitBuilder is a toolkit formed by encapsulating the compiler module in Eclipse OMR as the core.

This blog does not explain the usage of JitBuilder in detail, and these contents are reserved for subsequent blogs. Let's just talk about the general information first.

Let's take a look at a few examples of applying JitBuilder:

https://github.com/youngar/Base9  - This is an instructional demo project implementing a virtual machine whose language is a subset of JavaScript (known as Base9)

https://github.com/Leonardo2718/lua-vermelha  - Implements a JIT compiler for the Lua language. I have participated in the translation of the documentation for this project and are constantly following up.

The above two are relatively simple cases, which are very suitable for introductory learning.

here [  https://github.com/eclipse/omr/tree/master/jitbuilder/release  ]

There are many demos (also JitBuilder's Test use cases), which must be studied first to learn JitBuilder. In future blogs, I will carefully explain the specific usage of each demo code here.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325466754&siteId=291194637