Do programming language compilers first translate to assembly or directly to machine code?

前端 未结 13 2006
渐次进展
渐次进展 2020-12-02 09:52

I\'m primarily interested in popular and widely used compilers, such as gcc. But if things are done differently with different compilers, I\'d like to know that, too.

13条回答
  •  余生分开走
    2020-12-02 10:22

    Java compilers compile to java byte code (binary format) and then run this using a virtual machine (jvm).

    Whilst this may seem slow it - it can be faster because the JVM can take advantage of later CPU instructions and new optimizations. A C++ compiler won't do this - you have to target the instruction set at compile time.

提交回复
热议问题