All Projects → parrt → Simple Virtual Machine

parrt / Simple Virtual Machine

Licence: bsd-3-clause
A simple VM for a talk on building VMs

Programming Languages

java
68154 projects - #9 most used programming language

simple-virtual-machine

A simple VM for a talk on building VMs in Java. See video and slides.

There are multiple branches:

  • master. Basic instructions only (no function calls).
  • add-functions. Includes CALL/RET instructions, runs factorial test function.
  • split-stack. Split into operand stack and function call stack.
  • func-meta-info. CALL bytecode instruction takes an index into a metadata table for functions rather than an address and the number of arguments. This makes it much easier for bytecode compiler to generate code because it doesn't need to worry about forward references. This branch also properly allocates space for local variables.
  • shatter-stack. Broke apart the Context[] stack into a linked-list with invokingContext as parent pointer to caller. added call stack for trace.

See also a C version derived from split-stack. Parts derived from codyebberson's C implementation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].