https://github.com/svenslaggare/stackjit
Simple virtual machine for a stack-based assembler language.
https://github.com/svenslaggare/stackjit
jit-compiler multi-platform virtual-machine x64
Last synced: 11 months ago
JSON representation
Simple virtual machine for a stack-based assembler language.
- Host: GitHub
- URL: https://github.com/svenslaggare/stackjit
- Owner: svenslaggare
- License: mit
- Created: 2014-07-01T13:43:54.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-10-15T19:48:58.000Z (over 8 years ago)
- Last Synced: 2025-04-05T06:51:14.582Z (about 1 year ago)
- Topics: jit-compiler, multi-platform, virtual-machine, x64
- Language: C++
- Homepage:
- Size: 1.34 MB
- Stars: 21
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/svenslaggare/StackJIT) [](https://ci.appveyor.com/project/svenslaggare/stackjit)
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 `.
* `-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 `: Loads a library.
## Supported platforms
* Linux x64
* Windows x64
## Build
### Linux
Requirments:
* C++11 compiler.
* [CxxTest](http://cxxtest.com/) for tests.
To build:
```
make all
```
To run tests:
```
make test
```
### Windows
Requirements:
* Visual Studio 2015.
* CMake.
* [CxxTest](http://cxxtest.com/) 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](https://github.com/svenslaggare/StackJIT/tree/master/documentation).