|
|
|
|
|
by MobiusHorizons
342 days ago
|
|
The way I understand it, the machine code generator emits machine code for some particular piece of bytecode (or whatever the JIT IR is). This is almost like an assembler and probably has templates that it expands. It is important for this machine code to be fast, but it each template is at a pretty low level, and lacks the context for structural optimizations. The optimizer works at a higher level of abstraction, and can make these structural optimizations. You can get very large speed-ups when you can remove code that isn't necessary, or emit equivalent code that has a lower complexity or memory overhead. Typical examples of things optimizers do are
* use registers instead of memory for function arguments
* constant folding
* function inlining
* loop unrolling I don't know if that's exactly how it works for this particular effort, but that would be my expectation. |
|