Skip to main content

Questions tagged [bytecode]

For questions about design and implementation of bytecode formats, packed instruction formats used as a compilation target and to be run by a virtual machine.

Filter by
Sorted by
Tagged with
11 votes
4 answers
2k views

Executable files with a bytecode compiler/interpreter

Let's say I have a bytecode compiler. Even though it doesn't generate native machine code, is there a simple way for it to produce native executable files that I can directly run? One method I've ...
7 votes
4 answers
288 views

How can we backpatch differently-sized jump instructions?

Consider a compiler whose target language is some virtual machine bytecode. The jump instructions have to encode the size of their jumps. For example, in JVM bytecode the ...
5 votes
1 answer
172 views

What are the pros and cons of ways to implement the LOAD command in a statically typed VM?

What are the pros and cons of ways to implement the LOAD command in a statically typed VM? There is two ways to implement LOAD ...
3 votes
2 answers
160 views

Why does the bytecode need to be verified before uploading to a virtual machine?

Some virtual machines needs to verify bytecode before running, like JVM. But, why does the bytecode need to be verified before uploading to a virtual machine?
3 votes
2 answers
176 views

What operations are common in register-based virtual machines?

A register-based virtual machine necessarily contains at least some operations to manipulate registers. Like PUSH <register> <value>. What are some of ...
11 votes
3 answers
234 views

How are strings, lists and dicts implemented in bytecode?

How do I implement strings, lists and dicts in bytecode? For example, disassembling the bytecode might look like this: LOAD str "hello, world" But how ...