{"id":21807119,"url":"https://github.com/mmtk/mmtk-v8","last_synced_at":"2025-04-13T20:41:52.784Z","repository":{"id":36982965,"uuid":"249878359","full_name":"mmtk/mmtk-v8","owner":"mmtk","description":"V8 binding for MMTk","archived":false,"fork":false,"pushed_at":"2025-01-06T21:59:51.000Z","size":321,"stargazers_count":7,"open_issues_count":5,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-27T11:02:42.685Z","etag":null,"topics":["javascript","mmtk","v8","vm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmtk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-25T03:30:22.000Z","updated_at":"2025-01-06T21:59:55.000Z","dependencies_parsed_at":"2023-01-17T11:31:56.086Z","dependency_job_id":"d851dbc5-e2f0-4a8c-a287-0fce0743b1a5","html_url":"https://github.com/mmtk/mmtk-v8","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmtk%2Fmmtk-v8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmtk%2Fmmtk-v8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmtk%2Fmmtk-v8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmtk%2Fmmtk-v8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmtk","download_url":"https://codeload.github.com/mmtk/mmtk-v8/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782265,"owners_count":21160716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","mmtk","v8","vm"],"created_at":"2024-11-27T12:37:11.406Z","updated_at":"2025-04-13T20:41:52.739Z","avatar_url":"https://github.com/mmtk.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MMTk-V8\n\nThis repository provides the V8 binding for MMTk.\n\n## Contents\n\n* [Requirements](#requirements)\n* [Build](#build)\n* [Test](#test)\n\n## Requirements\n\nWe maintain an up to date list of the prerequisite for building MMTk and its bindings in the [mmtk-dev-env](https://github.com/mmtk/mmtk-dev-env) repository.\nPlease make sure your dev machine satisfies those prerequisites.\n\nMMTk/V8 currently only supports `linux-x86_64`.\n\n### Before you continue\n\nThe minimal supported Rust version for MMTk-V8 binding is 1.57.0. Make sure your Rust version is higher than this. We test MMTk-V8\nbinding with Rust 1.59.0 (as specified in [`rust-toolchain`](mmtk/rust-toolchain)).\n\n### Getting Sources (for MMTk and VM)\n\nFirst, set environment variables to refer to the root directories for MMTk and V8 respectively (change these to match your preferred locations):\n\n```console\n$ export MMTK_V8_ROOT=$HOME/mmtk_v8_root\n```\n\n#### MMTk\n\n```console\n$ cd $MMTK_V8_ROOT\n$ git clone git@github.com:mmtk/mmtk-v8.git\n```\n\n#### V8\n\nThe following is based on the [V8 documentation](https://v8.dev/docs/source-code).  Please refer to the original documentation if you run into difficulties getting V8.\n\nFirst, fetch and then update _depot_tools_, which contains the key build dependencies for V8.\n\n```console\n$ cd $MMTK_V8_ROOT\n$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git\n$ export PATH=`pwd`/depot_tools:$PATH\n$ gclient\n```\n\nYou will need _depot_tools_ in your path when you build V8, so you may wish to update your shell profile (e.g. `.bash_profile`) accordingly.\n\nYou should now be able to fetch the V8 sources:\n\n```console\n$ fetch v8\n```\n\nThe fetch command will get the V8 sources and create a build directory for you.   It intentionally puts your V8 repo in a detached head state.\n\n_Tip:_ if you decide to maintain your own fork of V8, be mindful that the fetch command is a necessary step in setting up a new repo; it is not sufficient to simply clone the source.\n\nTo update your V8 sources, use:\n\n```console\n$ fetch v8\n```\n\nOccasionally V8 won't build after a fetch because dependencies have changed.   This is fixed by synching:\n\n```console\n$ gclient sync\n```\n\n## Build\n\nFirst build MMTk, then V8\n\n### Building MMTk\n\n```console\n$ cd $MMTK_V8_ROOT/mmtk-v8/mmtk\n$ cargo build --features nogc\n```\n\n### Building V8\n\nWe provide instructions here for building V8 with its [_gm_ workflow](https://v8.dev/docs/build-gn).\n\nFirst you may wish to create an alias to the _gm_ script, which lives in the `tools/dev` directory of the V8 source tree.\n\n```console\n$ alias gm=$MMTK_V8_ROOT/v8/tools/dev/gm.py\n```\n\nYou may wish to add the above alias to your shell profile.\n\nNow you can build V8.\n\n### First Ensure you can Build Release V8\n\nBefore trying to build V8 with MMTk, ensure you can build V8 without MMTk:\n\n```console\n$ cd $MMTK_V8_ROOT/v8\n$ gm x64.release\n```\nThe above builds a standard release build of v8.\n\n### Next Ensure you can Build a Debug V8\n\nYou need to create a config file, which we'll call `x64.debug`.\n\nUse `gn`, which will open an editor:\n\n```console\n$ gn args out/x64.debug\n```\n\nEnter the following values:\n\n```\nis_component_build = true\nis_debug = true\nsymbol_level = 2\ntarget_cpu = \"x64\"\nuse_goma = false\nv8_enable_backtrace = true\nv8_enable_fast_mksnapshot = true\nv8_enable_verify_csa = true\nv8_enable_slow_dchecks = false\nv8_optimized_debug = false\n```\n\n### Then Build with MMTk\n\nCreate a gn config for building v8 with mmtk, which we'll call `x64.debug-mmtk`.\n\nUse `gn`, which will open an editor:\n\n```console\n$ cd $MMTK_V8_ROOT/v8\n$ gn args out/x64.debug-mmtk\n```\n\nEnter the following values:\n\n```\nis_component_build = true\nis_debug = true\nsymbol_level = 2\ntarget_cpu = \"x64\"\nuse_goma = false\nv8_enable_backtrace = true\nv8_enable_fast_mksnapshot = true\nv8_enable_verify_csa = true\nv8_enable_slow_dchecks = false\nv8_optimized_debug = false\nv8_disable_write_barriers = true\nv8_enable_single_generation = true\nv8_enable_shared_ro_heap = false\nv8_enable_pointer_compression = false\nv8_enable_third_party_heap = true\nv8_third_party_heap_files = [ \"../mmtk-v8/v8/third_party/heap/mmtk/mmtk.cc\",\n\"../mmtk-v8/v8/third_party/heap/mmtk/mmtk.h\",\n\"../mmtk-v8/v8/third_party/heap/mmtk/mmtkUpcalls.h\",\n\"../mmtk-v8/v8/third_party/heap/mmtk/mmtkUpcalls.cc\"]\nv8_third_party_heap_libs = [ \"../mmtk-v8/mmtk/target/debug/libmmtk_v8.so\" ]\n```\n\nThen build:\n\n```console\n$ gm x64.debug-mmtk\n```\n\n## Test\n\nThe [V8 document on testing](https://v8.dev/docs/test) discusses various options for running V8 tests.\n\nFor instance, `benchmarks` tests can be run on _\"V8 with MMTk\"_ as:\n\n```console\n$ gm x64.debug-mmtk benchmarks/*\n# autoninja -C out/x64.debug-mmtk d8\nninja: Entering directory `out/x64.debug-mmtk'\nninja: no work to do.\n# \"/usr/bin/python2\" tools/run-tests.py --outdir=out/x64.debug-mmtk benchmarks/*\nBuild found: /home/javad/sources/v8/v8/v8/out/x64.debug-mmtk\n\u003e\u003e\u003e Autodetected:\nverify_csa\n\u003e\u003e\u003e Running tests for x64.debug\n\u003e\u003e\u003e Running with test processors\n[02:20|%  96|+  53|-   0]: Done\n\u003e\u003e\u003e 55 base tests produced 53 (96%) non-filtered tests\n\u003e\u003e\u003e 53 tests ran\nDone! - V8 compilation finished successfully.\n```\n\n### Limitations\n\nThere are a few reasons why MMTk-V8 can not pass all V8 tests, including regression and unit tests:\n\n* MMTk-V8 does not support garbage collection yet.\n* MMTk does not support multiple heap instances yet.\n* Many of the V8 tests are unit tests targeting specific V8 features, and are not applicable to MMTk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmtk%2Fmmtk-v8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmtk%2Fmmtk-v8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmtk%2Fmmtk-v8/lists"}