Virtual machine
Executing bytecode
bytecode is an intermediate representation of code. It’s used by lots of different programming languages. It’s executed using a virtual machine (VM).
How do virtual machines execute bytecode?
A virtual machine interprets bytecode one instruction at a time. It translates the bytecode to object code at runtime, the object code being specific to the hardware’s instruction set architecture.
flashcards
| Question | Answer |
|---|---|
| What is bytecode? | Bytecode is an intermediate representation of code used by many programming languages and executed by a virtual machine (VM). |
| How does a virtual machine execute bytecode? | It interprets bytecode one instruction at a time, translating it to object code at runtime, where the object code is specific to the hardware’s instruction set architecture. |
| When does the VM translate bytecode to object code? | It translates bytecode to object code at runtime. |