Open rrnewton opened 7 years ago
If you want "zero copy" compile/run while maintaining the external interface of an AOT compiler like gcc, maybe you would produce a fake executable on disk that would simply communicate with the JIT process when called.
This was briefly discussed with @chamibuddhika in Slack. (CC @samth)
The simple question is -- can ELF binary format be a good JIT target? If it were, then optional AOT compilation ==
msync
.We've been asking "what barriers can be removed from the compiler", i.e. pass/pass barriers. But another big one is the global compile/run barrirer. Essentially the compiler is a global synchronization barrier, you don't run the binary until the entire compiler finishes.
"JIT mode" may be a way of running the code before all of it is compiled. JITs create a kind of streaming situation, where the start of the main function is the thing that should be compiled first, and then everything else is prioritized based on its first occurrence in the execution. (Or, in the hotspot style, 1st execution is always interpreted.)
Interpreting would just be "speculation" in this sense. If you MUST produce the compiled binary on disk, then all the work of compilation is scheduled to happen eventually. The only reason to interpret is if a parallel worker is so starved for work that it makes sense to do this "low quality" (less efficient) work. (correct? @kunalwagrawal).