Bytecode - Execution

Execution

A bytecode program may be executed by parsing and directly executing the instructions, one at a time. This kind of bytecode interpreter is very portable. Some systems, called dynamic translators, or "just-in-time" (JIT) compilers, translate bytecode into machine language as necessary at runtime: this makes the virtual machine unportable, but doesn't lose the portability of the bytecode itself. For example, Java and Smalltalk code is typically stored in bytecoded format, which is typically then JIT compiled to translate the bytecode to machine code before execution. This introduces a delay before a program is run, when bytecode is compiled to native machine code, but improves execution speed considerably compared to direct interpretation of the source code—normally by several magnitudes. Please note that bytecode as mandatory step for performance improvement is currently challenged, ex: Google's V8 and Dart VM do direct translation of source code to JITed machine code without bytecode intermediary.

Because of its performance advantage, today many language implementations execute a program in two phases, first compiling the source code into bytecode, and then passing the bytecode to the virtual machine. Therefore, there are virtual machines for Java, Python, PHP, Forth, and Tcl. The implementation of Perl and Ruby 1.8 instead work by walking an abstract syntax tree representation derived from the source code.

Read more about this topic:  Bytecode

Famous quotes containing the word execution:

    I herewith commission you to carry out all preparations with regard to ... a total solution of the Jewish question in those territories of Europe which are under German influence.... I furthermore charge you to submit to me as soon as possible a draft showing the ... measures already taken for the execution of the intended final solution of the Jewish question.
    Hermann Goering (1893–1946)

    It is clear that in a monarchy, where he who commands the exceution of the laws generally thinks himself above them, there is less need of virtue than in a popular government, where the person entrusted with the execution of the laws is sensible of his being subject to their direction.
    —Charles Louis de Secondat Montesquieu (1689–1755)

    If Germany is to become a colonising power, all I say is, “God speed her!” She becomes our ally and partner in the execution of the great purposes of Providence for the advantage of mankind.
    —W.E. (William Ewart)