Simple multi-platform virtual machine for a stack-based assembler language.
- Supports both Linux and Windows.
- Baseline JIT compiler (no optimizations).
- Supports arrays, classes.
- Compacting generational garbage collector.
- Supports lazy JIT compilation.
- Can easily be embedded.
- No external dependencies.
To run the VM, supply a program via stdin:
./stackjit < programs/basic/program.txt
-d
or--debug
: Enables debugging.-ogc
or--output-generated-code
: Outputs the generated machine code. The output can be viewed using objdump:objdump -D -M intel -b binary -mi386 -Mx86-64 <file name>
.-t
or--test
: Enables test mode, which loads test related libraries.-ngc
or--no-gc
: Disables garbage collection. The GC can still be used by calling the runtime function.-i <library file>
: Loads a library.
- Linux x64
- Windows x64
Requirments:
- C++11 compiler.
- CxxTest for tests.
To build:
make all
To run tests:
make test
Requirements:
- Visual Studio 2015.
- CMake.
- CxxTest for tests.
The following command installs CxxTest:
git clone -q --branch=master https://github.com/svenslaggare/CxxTest.git C:\CXXTest
set PATH=%PATH%;C:\CXXTest\bin
To create the solution file run:
mkdir Windows
cd Windows
cmake -G "Visual Studio 14 2015 Win64" ..\
See the documentation folder.