This repository provides the JikesRVM binding for MMTk.
We maintain an up to date list of the prerequisites for building MMTk and its bindings in the mmtk-dev-env repository. Please make sure your dev machine satisfies those prerequisites.
MMTk/JikesRVM supports linux-i686
and linux-x86_64
(as a 32-bit program).
If you use the set-up explained in mmtk-dev-env, make sure to do the following steps before continuing to the Build section:
- Set the default Rust toolchain to the one specified in mmtk-dev-env, e.g. by running:
$ # replace nightly-YYYY-MM-DD with the toolchain specified in mmtk-dev-env
$ export RUSTUP_TOOLCHAIN=nightly-YYYY-MM-DD
- Set
openjdk-8-jdk
as the default JDK (openjdk-8-jdk is a build requirement of JikesRVM), e.g. by running:
$ update-java-alternatives --set java-1.8.0-openjdk-amd64
- You may also need to use ssh-agent to authenticate with github (see here for more info):
$ eval `ssh-agent`
$ ssh-add
You will need the correct revisions of MMTk and JikesRVM.
Both are checked in as git submodules under repos
.
You would simply need to run the following lines under the root directory of mmtk-jikesrvm
to fetch submodules' sources for MMTk and JikesRVM:
$ git submodule init
$ git submodule update
Alternatively, you could fetch the sources by yourself (make sure you have the right VM/MMTk revisions that match the mmtk-jikesrvm
revision.
If you clone the MMTk core in a folder other than repos/mmtk-core
, you would need to modify mmtk/Cargo.toml
to point the mmtk
dependency to your MMTk core folder.
- JikesRVM: https://github.com/mmtk/jikesrvm
- MMTk Core: https://github.com/mmtk/mmtk-core
The rest of this instruction assumes you have done the git submodule init/update
and have both repositories under repos
.
MMTk building is integrated as as a step of the JikesRVM build.
We recommend using the buildit
script for the JikesRVM build.
$ cd repos/jikesrvm
$ ./bin/buildit localhost RBaseBaseSemiSpace --use-third-party-heap=../../ --use-third-party-build-configs=../../jikesrvm/build/configs/ --use-external-source=../../jikesrvm/rvm/src
The JikesRVM binary is under repos/jikesrvm/dist/RBaseBaseSemiSpace_x86_64-linux/rvm
and the MMTk shared library is repos/jikesrvm/dist/RBaseBaseSemiSpace_x86_64-linux/libmmtk.so
.
You can build with other build configs, check jikesrvm/build/configs
.
Fetch DaCapo:
$ # run from the root repo directory
$ mkdir -p repos/jikesrvm/benchmarks
$ wget https://downloads.sourceforge.net/project/dacapobench/archive/2006-10-MR2/dacapo-2006-10-MR2.jar -O repos/jikesrvm/benchmarks/dacapo-2006-10-MR2.jar
Run rvm
:
$ LD_LIBRARY_PATH=repos/jikesrvm/dist/RBaseBaseSemiSpace_x86_64-linux/ repos/jikesrvm/dist/RBaseBaseSemiSpace_x86_64-linux/rvm -Xms75M -Xmx75M -jar repos/jikesrvm/benchmarks/dacapo-2006-10-MR2.jar fop
===== DaCapo fop starting =====
ThreadId(1)[INFO:/root/mmtk-jikesrvm/repos/mmtk-core/src/plan/global.rs:112] [POLL] copyspace0: Triggering collection
ThreadId(1)[INFO:/root/mmtk-jikesrvm/repos/mmtk-core/src/plan/global.rs:112] [POLL] copyspace1: Triggering collection
ThreadId(1)[INFO:/root/mmtk-jikesrvm/repos/mmtk-core/src/plan/global.rs:112] [POLL] copyspace0: Triggering collection
ThreadId(1)[INFO:/root/mmtk-jikesrvm/repos/mmtk-core/src/plan/global.rs:112] [POLL] immortal: Triggering collection
ThreadId(1)[INFO:/root/mmtk-jikesrvm/repos/mmtk-core/src/plan/global.rs:112] [POLL] copyspace0: Triggering collection
ThreadId(1)[INFO:/root/mmtk-jikesrvm/repos/mmtk-core/src/plan/global.rs:112] [POLL] copyspace1: Triggering collection
===== DaCapo fop PASSED in 3934 msec =====