Skip to content

svenslaggare/StackJIT

Repository files navigation

Linux Build Status Windows Build Status StackJIT

Simple multi-platform virtual machine for a stack-based assembler language.

Features

  • 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.

Running

To run the VM, supply a program via stdin:

./stackjit < programs/basic/program.txt

Options

  • -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.

Supported platforms

  • Linux x64
  • Windows x64

Build

Linux

Requirments:

  • C++11 compiler.
  • CxxTest for tests.

To build:

make all

To run tests:

make test

Windows

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" ..\

Documentation

See the documentation folder.

About

Simple virtual machine for a stack-based assembler language.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages