"
+ ],
"includeAutoGeneratedTags": false,
"minifyCSS": true,
"minifyJS": true,
diff --git a/.markdownlintignore b/.markdownlintignore
new file mode 100644
index 000000000..20de61303
--- /dev/null
+++ b/.markdownlintignore
@@ -0,0 +1 @@
+src/docs/
diff --git a/markdown-link-check.json b/markdown-link-check.json
index 3bb277c73..adb313c0e 100644
--- a/markdown-link-check.json
+++ b/markdown-link-check.json
@@ -1,7 +1,48 @@
{
+ "ignorePatterns": [
+ {
+ "pattern": "^https?://"
+ },
+ {
+ "pattern": "^mailto:"
+ },
+ {
+ "pattern": "^/bugs?$"
+ },
+ {
+ "pattern": "^\\.\\./\\.\\./src/"
+ },
+ {
+ "pattern": "^#"
+ },
+ {
+ "pattern": "torque(\\.md)?$"
+ },
+ {
+ "pattern": "torque-builtins(\\.md)?$"
+ },
+ {
+ "pattern": "csa-builtins(\\.md)?$"
+ },
+ {
+ "pattern": "turbofan(\\.md)?$"
+ },
+ {
+ "pattern": "ignition(\\.md)?$"
+ },
+ {
+ "pattern": "hidden-classes(\\.md)?$"
+ },
+ {
+ "pattern": "wasm-compilation-pipeline(\\.md)?$"
+ },
+ {
+ "pattern": "sandbox(\\.md)?$"
+ }
+ ],
"replacementPatterns": [
{
- "pattern": "^/((docs|blog|features)/[\\w-]+)(?:#.*)?$",
+ "pattern": "^/((docs|blog|features)/[\\w/-]+)(?:#.*)?$",
"replacement": "{{BASEURL}}/src/$1.md"
},
{
diff --git a/package.json b/package.json
index 6dbd936bd..b83b6c259 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,8 @@
{
"private": true,
"scripts": {
- "lint": "markdownlint \"src/**/*.md\"",
+ "lint": "markdownlint \"src/**/*.md\" && npm run lint:links",
+ "lint:links": "markdown-link-check -q --config markdown-link-check.json src/docs/**/*.md",
"eleventy": "eleventy",
"html": "html-minifier-terser --config-file=.html-minifier.json --input-dir=dist --output-dir=dist --file-ext=html",
"css": "postcss src/_css/main.css --output dist/_css/main.css && postcss src/_css/feature-support.css --output dist/_css/feature-support.css",
@@ -13,8 +14,9 @@
"copy-js": "shx cp ./node_modules/dark-mode-toggle/dist/dark-mode-toggle.min.mjs dist/_js/dark-mode-toggle.mjs",
"img-video-dimensions": "node add-image-and-video-dimensions.js",
"clean": "shx rm -rf -- dist",
- "build": "npm run clean && npm run css && npm run js && npm run json && npm run copy-img && npm run copy-js && npm run eleventy && npm run sw && npm run xml && npm run html",
- "watch": "npm run build && npx eleventy --watch",
+ "sync-docs": "node sync-docs.mjs",
+ "build": "npm run clean && npm run sync-docs && npm run css && npm run js && npm run json && npm run copy-img && npm run copy-js && npm run eleventy && npm run sw && npm run xml && npm run html",
+ "watch": "npm run sync-docs && npm run build && npx eleventy --watch",
"serve": "npm start",
"dev": "npm start",
"debug": "DEBUG=* npx eleventy",
diff --git a/prism-languages.js b/prism-languages.js
index df0f7ff84..52c87e1b2 100644
--- a/prism-languages.js
+++ b/prism-languages.js
@@ -12,6 +12,9 @@
// limitations under the License.
const installPrismLanguages = (Prism) => {
+ // Define an empty dummy language for 'text' so Prism does not fail
+ // when trying to highlight plain text blocks.
+ Prism.languages.text = {};
// Based on the grammar defined at the bottom of:
// https://cs.chromium.org/chromium/src/v8/src/torque/torque-parser.cc
diff --git a/src/docs/README_V8_DEV.md b/src/docs/README_V8_DEV.md
new file mode 100644
index 000000000..3697108de
--- /dev/null
+++ b/src/docs/README_V8_DEV.md
@@ -0,0 +1,8 @@
+# V8 Documentation
+
+This folder is synced automatically during deployment.
+The main V8 documentation is hosted and updated directly in the [V8 repository](https://github.com/v8/v8/tree/main/docs).
+
+Any modifications to the documentation should be done in the V8 repository. The files here in `v8.dev` are synced continuously on build via GitHub actions.
+
+Only files that are specific to the `v8.dev` website rendering (such as `docs.json` or this README) should be committed to this directory.
diff --git a/src/docs/api.md b/src/docs/api.md
deleted file mode 100644
index cdfa291f8..000000000
--- a/src/docs/api.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: 'V8’s public API'
-description: 'This document discusses the stability of V8’s public API, and how developers can make changes to it.'
----
-This document discusses the stability of V8’s public API, and how developers can make changes to it.
-
-## API stability
-
-If V8 in a Chromium canary turns out to be crashy, it gets rolled back to the V8 version of the previous canary. It is therefore important to keep V8’s API compatible from one canary version to the next.
-
-We continuously run a [bot](https://ci.chromium.org/p/v8/builders/luci.v8.ci/Linux%20V8%20API%20Stability) that signals API stability violations. It compiles Chromium’s HEAD with V8’s [current canary version](https://chromium.googlesource.com/v8/v8/+/refs/heads/canary).
-
-Failures of this bot are currently only FYI and no action is required. The blame list can be used to easily identify dependent CLs in case of a rollback.
-
-If you break this bot, be reminded to increase the window between a V8 change and a dependent Chromium change next time.
-
-## How to change V8’s public API
-
-V8 is used by many different embedders: Chrome, Node.js, gjstest, etc. When changing V8’s public API (basically the files under the `include/` directory) we need to ensure that the embedders can smoothly update to the new V8 version. In particular, we cannot assume that an embedder updates to the new V8 version and adjusts their code to the new API in one atomic change.
-
-The embedder should be able to adjust their code to the new API while still using the previous version of V8. All instructions below follow from this rule.
-
-- Adding new types, constants, and functions is safe with one caveat: do not add a new pure virtual function to an existing class. New virtual functions should have default implementation.
-- Adding a new parameter to a function is safe if the parameter has the default value.
-- Removing or renaming types, constants, functions is unsafe. Use the [`V8_DEPRECATED`](https://cs.chromium.org/chromium/src/v8/include/v8config.h?l=395&rcl=0425b20ad9a8ba38c2e0dd16e8814abb722bfdde) and [`V8_DEPRECATE_SOON`](https://cs.chromium.org/chromium/src/v8/include/v8config.h?l=403&rcl=0425b20ad9a8ba38c2e0dd16e8814abb722bfdde) macros, which causes compile-time warnings when the deprecated methods are called by the embedder. For example, let’s say we want to rename function `foo` to function `bar`. Then we need to do the following:
- - Add the new function `bar` near the existing function `foo`.
- - Wait until the CL rolls in Chrome. Adjust Chrome to use `bar`.
- - Annotate `foo` with `V8_DEPRECATED("Use bar instead") void foo();`
- - In the same CL adjust the tests that use `foo` to use `bar`.
- - Write in CL motivation for the change and high-level update instructions.
- - Wait until the next V8 branch.
- - Remove function `foo`.
-
- `V8_DEPRECATE_SOON` is a softer version of `V8_DEPRECATED`. Chrome will not break with it, so step b is not need. `V8_DEPRECATE_SOON` is not sufficient for removing the function.
-
- You still need to annotate with `V8_DEPRECATED` and wait for the next branch before removing the function.
-
- `V8_DEPRECATED` can be tested using the `v8_deprecation_warnings` GN flag.
- `V8_DEPRECATE_SOON` can be tested using `v8_imminent_deprecation_warnings`.
-
-- Changing function signatures is unsafe. Use the `V8_DEPRECATED` and `V8_DEPRECATE_SOON` macros as described above.
-
-We maintain a [document mentioning important API changes](https://docs.google.com/document/d/1g8JFi8T_oAE_7uAri7Njtig7fKaPDfotU6huOa1alds/edit) for each V8 version.
-
-There is also a regularly updated [doxygen api documentation](https://v8.dev/api).
diff --git a/src/docs/become-committer.md b/src/docs/become-committer.md
deleted file mode 100644
index 9e6218443..000000000
--- a/src/docs/become-committer.md
+++ /dev/null
@@ -1,46 +0,0 @@
----
-title: 'Becoming a committer'
-description: 'How does one become a V8 committer? This document explains.'
----
-Technically, committers are people who have write access to the V8 repository. All patches need to be reviewed by at least two committers (including the author). Independently from this requirement, patches also need to be authored or reviewed by an OWNER.
-
-This privilege is granted with some expectation of responsibility: committers are people who care about the V8 project and want to help meet its goals. Committers are not just people who can make changes, but people who have demonstrated their ability to collaborate with the team, get the most knowledgeable people to review code, contribute high-quality code, and follow through to fix issues (in code or tests).
-
-A committer is a contributor to the V8 project’s success and a citizen helping the projects succeed. See [Committer’s Responsibility](/docs/committer-responsibility).
-
-## How do I become a committer?
-
-*Note to Googlers: There is a [slightly different approach for V8 team members](http://go/v8/setup_permissions.md).*
-
-If you haven't done so already, **you'll need to set up a Security Key on your account before you're added to the committer list.**. For more information about this requirement see [Gerrit ReAuth](https://chromium.googlesource.com/chromium/src/+/main/docs/gerrit_reauth.md).
-
-In a nutshell, contribute 20 non-trivial patches and get at least three different people to review them (you'll need three people to support you). Then ask someone to nominate you. You're demonstrating your:
-
-- commitment to the project (20 good patches requires a lot of your valuable time),
-- ability to collaborate with the team,
-- understanding of how the team works (policies, processes for testing and code review, etc),
-- understanding of the projects' code base and coding style, and
-- ability to write good code (last but certainly not least)
-
-A current committer nominates you by sending email to containing:
-
-- your first and last name
-- your email address in Gerrit
-- an explanation of why you should be a committer,
-- embedded list of links to revisions (about top 10) containing your patches
-
-Two other committers need to second your nomination. If no one objects in 5 working days, you're a committer. If anyone objects or wants more information, the committers discuss and usually come to a consensus (within the 5 working days). If issues cannot be resolved, there's a vote among current committers.
-
-Once you get approval from the existing committers, you are granted additional review permissions. You'll also be added to the mailing list v8-committers@chromium.org.
-
-In the worst case, the process can drag out for two weeks. Keep writing patches! Even in the rare cases where a nomination fails, the objection is usually something easy to address like “more patches” or “not enough people are familiar with this person’s work.”
-
-## Maintaining committer status
-
-You don't really need to do much to maintain committer status: just keep being awesome and helping the V8 project!
-
-In the unhappy event that a committer continues to disregard good citizenship (or actively disrupts the project), we may need to revoke that person's status. The process is the same as for nominating a new committer: someone suggests the revocation with a good reason, two people second the motion, and a vote may be called if consensus cannot be reached. I hope that's simple enough, and that we never have to test it in practice.
-
-In addition, as a security measure, if you are inactive on Gerrit (no upload, no comment and no review) for more than a year, we may revoke your committer privileges. An email notification is sent about 7 days prior to the removal. This is not meant as a punishment, so if you wish to resume contributing after that, contact v8-committers@chromium.org to ask that it be restored, and we will normally do so.
-
-(This document was inspired by .)
diff --git a/src/docs/benchmarks.md b/src/docs/benchmarks.md
deleted file mode 100644
index a69827f5a..000000000
--- a/src/docs/benchmarks.md
+++ /dev/null
@@ -1,140 +0,0 @@
----
-title: 'Running benchmarks locally'
-description: 'This document explains how to run classic benchmark suites in d8.'
----
-We have a simple workflow for running the “classic” benchmarks of SunSpider, Kraken and Octane. You can run with different binaries and flag combinations, and results are averaged over multiple runs.
-
-## CPU
-
-Build the `d8` shell following the instructions at [Building with GN](/docs/build-gn).
-
-Before you run benchmarks, make sure you set your CPU frequency scaling governor to performance.
-
-```bash
-sudo tools/cpu.sh fast
-```
-
-The commands `cpu.sh` understands are
-
-- `fast`, performance (alias for `fast`)
-- `slow`, powersave (alias for `slow`)
-- `default`, ondemand (alias for `default`)
-- `dualcore` (disables all but two cores), dual (alias for `dualcore`)
-- `allcores` (re-enables all available cores), all (alias for `allcores`).
-
-## CSuite
-
-`CSuite` is our simple benchmark runner:
-
-```bash
-test/benchmarks/csuite/csuite.py
- (sunspider | kraken | octane)
- (baseline | compare)
-
- [-x ""]
-```
-
-First run in `baseline` mode to create the baselines, then in `compare` mode to get results. `CSuite` defaults to doing 10 runs for Octane, 100 for SunSpider, and 80 for Kraken, but you can override these for quicker results with the `-r` option.
-
-`CSuite` creates two subdirectories in the directory where you run from:
-
-1. `./_benchmark_runner_data` — this is cached output from the N runs.
-1. `./_results` — it writes the results into file master here. You could save these
- files with different names, and they’ll show up in compare mode.
-
-In compare mode, you’ll naturally use a different binary or at least different flags.
-
-## Example usage
-
-Say you’ve built two versions of `d8`, and want to see what happens to SunSpider. First, create baselines:
-
-```bash
-$ test/benchmarks/csuite/csuite.py sunspider baseline out.gn/master/d8
-Wrote ./_results/master.
-Run sunspider again with compare mode to see results.
-```
-
-As suggested, run again but this time in `compare` mode with a different binary:
-
-```
-$ test/benchmarks/csuite/csuite.py sunspider compare out.gn/x64.release/d8
-
- benchmark: score | master | % |
-===================================================+==========+========+
- 3d-cube-sunspider: 13.9 S 13.4 S -3.6 |
- 3d-morph-sunspider: 8.6 S 8.4 S -2.3 |
- 3d-raytrace-sunspider: 15.1 S 14.9 S -1.3 |
- access-binary-trees-sunspider: 3.7 S 3.9 S 5.4 |
- access-fannkuch-sunspider: 11.9 S 11.8 S -0.8 |
- access-nbody-sunspider: 4.6 S 4.8 S 4.3 |
- access-nsieve-sunspider: 8.4 S 8.1 S -3.6 |
- bitops-3bit-bits-in-byte-sunspider: 2.0 | 2.0 | |
- bitops-bits-in-byte-sunspider: 3.7 S 3.9 S 5.4 |
- bitops-bitwise-and-sunspider: 2.7 S 2.9 S 7.4 |
- bitops-nsieve-bits-sunspider: 5.3 S 5.6 S 5.7 |
- controlflow-recursive-sunspider: 3.8 S 3.6 S -5.3 |
- crypto-aes-sunspider: 10.9 S 9.8 S -10.1 |
- crypto-md5-sunspider: 7.0 | 7.4 S 5.7 |
- crypto-sha1-sunspider: 9.2 S 9.0 S -2.2 |
- date-format-tofte-sunspider: 9.8 S 9.9 S 1.0 |
- date-format-xparb-sunspider: 10.3 S 10.3 S |
- math-cordic-sunspider: 6.1 S 6.2 S 1.6 |
- math-partial-sums-sunspider: 20.2 S 20.1 S -0.5 |
- math-spectral-norm-sunspider: 3.2 S 3.0 S -6.2 |
- regexp-dna-sunspider: 7.6 S 7.8 S 2.6 |
- string-base64-sunspider: 14.2 S 14.0 | -1.4 |
- string-fasta-sunspider: 12.8 S 12.6 S -1.6 |
- string-tagcloud-sunspider: 18.2 S 18.2 S |
- string-unpack-code-sunspider: 20.0 | 20.1 S 0.5 |
- string-validate-input-sunspider: 9.4 S 9.4 S |
- SunSpider: 242.6 S 241.1 S -0.6 |
----------------------------------------------------+----------+--------+
-```
-
-The output of the previous run is cached in a subdirectory created in the current directory (`_benchmark_runner_data`). The aggregate results are also cached, in directory `_results`. These directories can be deleted after you’ve run the compare step.
-
-Another situation is when you have the same binary, but want to see the results of different flags. Feeling rather droll, you’d like to see how Octane performs without an optimizing compiler. First the baseline:
-
-```bash
-$ test/benchmarks/csuite/csuite.py -r 1 octane baseline out.gn/x64.release/d8
-
-Normally, octane requires 10 runs to get stable results.
-Wrote /usr/local/google/home/mvstanton/src/v8/_results/master.
-Run octane again with compare mode to see results.
-```
-
-Note the warning that one run usually isn’t enough to be sure of many performance optimizations, however, our “change” should have a reproducible effect with only one run! Now let’s compare, passing the `--noopt` flag to turn off [TurboFan](/docs/turbofan):
-
-```bash
-$ test/benchmarks/csuite/csuite.py -r 1 octane compare out.gn/x64.release/d8 \
- -x "--noopt"
-
-Normally, octane requires 10 runs to get stable results.
- benchmark: score | master | % |
-===================================================+==========+========+
- Richards: 973.0 | 26770.0 | -96.4 |
- DeltaBlue: 1070.0 | 57245.0 | -98.1 |
- Crypto: 923.0 | 32550.0 | -97.2 |
- RayTrace: 2896.0 | 75035.0 | -96.1 |
- EarleyBoyer: 4363.0 | 42779.0 | -89.8 |
- RegExp: 2881.0 | 6611.0 | -56.4 |
- Splay: 4241.0 | 19489.0 | -78.2 |
- SplayLatency: 14094.0 | 57192.0 | -75.4 |
- NavierStokes: 1308.0 | 39208.0 | -96.7 |
- PdfJS: 6385.0 | 26645.0 | -76.0 |
- Mandreel: 709.0 | 33166.0 | -97.9 |
- MandreelLatency: 5407.0 | 97749.0 | -94.5 |
- Gameboy: 5440.0 | 54336.0 | -90.0 |
- CodeLoad: 25631.0 | 25282.0 | 1.4 |
- Box2D: 3288.0 | 67572.0 | -95.1 |
- zlib: 59154.0 | 58775.0 | 0.6 |
- Typescript: 12700.0 | 23310.0 | -45.5 |
- Octane: 4070.0 | 37234.0 | -89.1 |
----------------------------------------------------+----------+--------+
-```
-
-Neat to see that `CodeLoad` and `zlib` were relatively unharmed.
-
-## Under the hood
-
-`CSuite` is based on two scripts in the same directory, `benchmark.py` and `compare-baseline.py`. There are more options in those scripts. For example, you can record multiple baselines and do 3-, 4-, or 5-way comparisons. `CSuite` is optimized for quick use, and sacrifices some flexibility.
diff --git a/src/docs/blink-layout-tests.md b/src/docs/blink-layout-tests.md
deleted file mode 100644
index e08e4823e..000000000
--- a/src/docs/blink-layout-tests.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: 'Blink web tests (a.k.a. layout tests)'
-description: 'V8’s infrastructure continuously runs Blink’s web tests to prevent integration problems with Chromium. This document describes what to do in case such a test fails.'
----
-We continuously run [Blink’s web tests (formerly known as “layout tests”)](https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_tests.md) on our [integration console](https://ci.chromium.org/p/v8/g/integration/console) to prevent integration problems with Chromium.
-
-On test failures, the bots compare the results of V8 Tip-of-Tree with Chromium’s pinned V8 version, to only flag newly introduced V8 problems (with false positives < 5%). Blame assignment is trivial as the [Linux release](https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Blink%20Linux) bot tests all revisions.
-
-Commits with newly-introduced failures are normally reverted to unblock auto-rolling into Chromium. In case you notice you break layout tests or your commit gets reverted because of such breakage, and in case the changes are expected, follow this procedure to add updated baselines to Chromium before (re-)landing your CL:
-
-1. Land a Chromium change setting `[ Failure Pass ]` for the changed tests ([more](https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_test_expectations.md#updating-the-expectations-files)).
-1. Land your V8 CL and wait 1-2 days until it cycles into Chromium.
-1. Follow [these instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_tests.md#Rebaselining-Web-Tests) to manually generate the new baselines. Note that if you’re making changes only to Chromium, [this preferred automatic procedure](https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_test_expectations.md#how-to-rebaseline) should work for you.
-1. Remove the `[ Failure Pass ]` entry from the test expectations file and commit it along with the new baselines in Chromium.
-
-Please associate all CLs with a `Bug: …` footer.
diff --git a/src/docs/build-gn.md b/src/docs/build-gn.md
deleted file mode 100644
index 8464d7d01..000000000
--- a/src/docs/build-gn.md
+++ /dev/null
@@ -1,134 +0,0 @@
----
-title: 'Building V8 with GN'
-description: 'This document explains how to use GN to build V8.'
----
-V8 is built with the help of [GN](https://gn.googlesource.com/gn/+/master/docs/). GN is a meta build system of sorts, as it generates build files for a number of other build systems. How you build therefore depends on what “back-end” build system and compiler you’re using.
-The instructions below assume that you already have a [checkout of V8](/docs/source-code) and that you have [installed the build dependencies](/docs/build).
-
-More information on GN can be found in [Chromium’s documentation](https://www.chromium.org/developers/gn-build-configuration) or [GN’s own docs](https://gn.googlesource.com/gn/+/master/docs/).
-
-Building V8 from source involves three steps:
-
-1. generating build files
-1. compiling
-1. running tests
-
-There are two workflows for building V8:
-
-- the convenience workflow using a helper script called `gm` that nicely combines all three steps
-- the raw workflow, where you run separate commands on a lower level for each step manually
-
-## Building V8 using `gm` (the convenience workflow) { #gm }
-
-`gm` is a convenience all-in-one script that generates build files, triggers the build and optionally also runs the tests. It can be found at `tools/dev/gm.py` in your V8 checkout. We recommend adding an alias to your shell configuration:
-
-```bash
-alias gm=/path/to/v8/tools/dev/gm.py
-```
-
-You can then use `gm` to build V8 for known configurations, such as `x64.release`:
-
-```bash
-gm x64.release
-```
-
-To run the tests right after the build, run:
-
-```bash
-gm x64.release.check
-```
-
-`gm` outputs all the commands it’s executing, making it easy to track and re-execute them if necessary.
-
-`gm` enables building the required binaries and running specific tests with a single command:
-
-```bash
-gm x64.debug mjsunit/foo cctest/test-bar/*
-```
-
-## Building V8: the raw, manual workflow { #manual }
-
-### Step 1: generate build files { #generate-build-files }
-
-There are several ways of generating the build files:
-
-1. The raw, manual workflow involves using `gn` directly.
-1. A helper script named `v8gen` streamlines the process for common configurations.
-
-#### Generating build files using `gn` { #gn }
-
-Generate build files for the directory `out/foo` using `gn`:
-
-```bash
-gn args out/foo
-```
-
-This opens an editor window for specifying the [`gn` arguments](https://gn.googlesource.com/gn/+/master/docs/reference.md). Alternatively, you can pass the arguments on the command line:
-
-```bash
-gn gen out/foo --args='is_debug=false target_cpu="x64" v8_target_cpu="arm64"'
-```
-
-This generates build files for compiling V8 with the arm64 simulator in release mode.
-
-For an overview of all available `gn` arguments, run:
-
-```bash
-gn args out/foo --list
-```
-
-#### Generate build files using `v8gen` { #v8gen }
-
-The V8 repository includes a `v8gen` convenience script to more easily generate build files for common configurations. We recommend adding an alias to your shell configuration:
-
-```bash
-alias v8gen=/path/to/v8/tools/dev/v8gen.py
-```
-
-Call `v8gen --help` for more information.
-
-List available configurations (or bots from a master):
-
-```bash
-v8gen list
-```
-
-```bash
-v8gen list -m client.v8
-```
-
-Build like a particular bot from the `client.v8` waterfall in folder `foo`:
-
-```bash
-v8gen -b 'V8 Linux64 - debug builder' -m client.v8 foo
-```
-
-### Step 2: compile V8 { #compile }
-
-To build all of V8 (assuming `gn` generated to the `x64.release` folder), run:
-
-```bash
-ninja -C out/x64.release
-```
-
-To build specific targets like `d8`, append them to the command:
-
-```bash
-ninja -C out/x64.release d8
-```
-
-### Step 3: run tests { #tests }
-
-You can pass the output directory to the test driver. Other relevant flags are inferred from the build:
-
-```bash
-tools/run-tests.py --outdir out/foo
-```
-
-You can also test your most recently compiled build (in `out.gn`):
-
-```bash
-tools/run-tests.py --gn
-```
-
-**Build issues? File a bug at [v8.dev/bug](/bug) or ask for help on .**
diff --git a/src/docs/build.md b/src/docs/build.md
deleted file mode 100644
index 50ae91996..000000000
--- a/src/docs/build.md
+++ /dev/null
@@ -1,63 +0,0 @@
----
-title: 'Building V8 from source'
-description: 'This document explains how to build V8 from source.'
----
-In order to be able to build V8 from scratch on Windows/Linux/macOS for x64, please follow the following steps.
-
-## Getting the V8 source code
-
-Follow the instructions in our guide on [checking out the V8 source code](/docs/source-code).
-
-## Installing build dependencies
-
-1. For macOS: install Xcode and accept its license agreement. (If you’ve installed the command-line tools separately, [remove them first](https://bugs.chromium.org/p/chromium/issues/detail?id=729990#c1).)
-
-1. Make sure that you are in the V8 source directory. If you followed every step in the previous section, you’re already at the right location.
-
-1. Download all the build dependencies:
-
- ```bash
- gclient sync
- ```
-
- For Googlers - If you see Failed to fetch file or Login required errors when running the hooks, try authenticating with Google Storage first by running:
-
- ```bash
- gsutil.py config
- ```
-
- Login with your @google.com account, and enter `0` when asked for a project ID.
-
-1. This step is only needed on Linux. Install additional build dependencies:
-
- ```bash
- ./build/install-build-deps.sh
- ```
-
-## Building V8
-
-1. Make sure that you are in the V8 source directory on the `main` branch.
-
- ```bash
- cd /path/to/v8
- ```
-
-1. Pull in the latest changes and install any new build dependencies:
-
- ```bash
- git pull && gclient sync
- ```
-
-1. Compile the source:
-
- ```bash
- tools/dev/gm.py x64.release
- ```
-
- Or, to compile the source and immediately run the tests:
-
- ```bash
- tools/dev/gm.py x64.release.check
- ```
-
- For more information on the `gm.py` helper script and the commands it triggers, see [Building with GN](/docs/build-gn).
diff --git a/src/docs/builtin-functions.md b/src/docs/builtin-functions.md
deleted file mode 100644
index b32df77b1..000000000
--- a/src/docs/builtin-functions.md
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 'Built-in functions'
-description: 'This document explains what “built-ins” are in V8.'
----
-Built-in functions in V8 come in different flavors w.r.t. implementation, depending on their functionality, performance requirements, and sometimes plain historical development.
-
-Some are implemented in JavaScript directly, and are compiled into executable code at runtime just like any user JavaScript. Some of them resort to so-called _runtime functions_ for part of their functionality. Runtime functions are written in C++ and called from JavaScript through a `%`-prefix. Usually, these runtime functions are limited to V8 internal JavaScript code. For debugging purposes, they can also be called from normal JavaScript code, if V8 is run with the flag `--allow-natives-syntax`. Some runtime functions are directly embedded by the compiler into generated code. For a list, see `src/runtime/runtime.h`.
-
-Other functions are implemented as _built-ins_, which themselves can be implemented in a number of different ways. Some are implemented directly in platform-dependent assembly. Some are implemented in _CodeStubAssembler_, a platform-independent abstraction. Yet others are directly implemented in C++. Built-ins are sometimes also used to implement pieces of glue code, not necessarily entire functions. For a list, see `src/builtins/builtins.h`.
diff --git a/src/docs/committer-responsibility.md b/src/docs/committer-responsibility.md
deleted file mode 100644
index 68e7b4ab8..000000000
--- a/src/docs/committer-responsibility.md
+++ /dev/null
@@ -1,42 +0,0 @@
----
-title: 'Responsibilities of V8 committers and reviewers'
-description: 'This document lists guidelines for V8 contributors.'
----
-When you’re committing to the V8 repositories, ensure that you follow these guidelines (adapted from ):
-
-1. Find the right reviewer for your changes and for patches you’re asked to review.
-1. Be available on IM and/or email before and after you land the change.
-1. Watch the [waterfall](https://ci.chromium.org/p/v8/g/main/console) until all bots turn green after your change.
-1. When landing a TBR change (To Be Reviewed), make sure to notify the people whose code you’re changing. Usually just send the review e-mail.
-
-In short, do the right thing for the project, not the easiest thing to get code committed, and above all: use your best judgement.
-
-**Don’t be afraid to ask questions. There is always someone who will immediately read messages sent to the v8-committers mailing list who can help you.**
-
-## Changes with multiple reviewers
-
-There are occasionally changes with a lot of reviewers on them, since sometimes several people might need to be in the loop for a change because of multiple areas of responsibility and expertise.
-
-The problem is that without some guidelines, there’s no clear responsibility given in these reviews.
-
-If you’re the sole reviewer on a change, you know you have to do a good job. When there are three other people, you sometimes assume that somebody else must have looked carefully at some part of the review. Sometimes all the reviewers think this and the change isn’t reviewed properly.
-
-In other cases, some reviewers say “LGTM” for a patch, while others are still expecting changes. The author can get confused as to the status of the review, and some patches have been checked in where at least one reviewer expected further changes before committing.
-
-At the same time, we want to encourage many people to participate in the review process and keep tabs on what’s going on.
-
-So, here are some guidelines to help clarify the process:
-
-1. When a patch author requests more than one reviewer, they should make clear in the review request email what they expect the responsibility of each reviewer to be. For example, you could write this in the email:
-
- ```
- - larry: bitmap changes
- - sergey: process hacks
- - everybody else: FYI
- ```
-
-1. In this case, you might be on the review list because you’ve asked to be in the loop for multiprocess changes, but you wouldn’t be the primary reviewer and the author and other reviewers wouldn’t be expecting you to review all the diffs in detail.
-1. If you get a review that includes many other people, and the author didn’t do (1), please ask them what part you’re responsible for if you don’t want to review the whole thing in detail.
-1. The author should wait for approval from everybody on the reviewer list before checking in.
-1. People who are on a review without clear review responsibility (i.e. drive-by reviews) should be super responsive and not hold up the review. The patch author should feel free to ping them mercilessly if they are.
-1. If you’re an “FYI” person on a review and you didn’t actually review in detail (or at all), but don’t have a problem with the patch, note this. You could say something like “rubber stamp” or “ACK” instead of “LGTM”. This way the real reviewers know not to trust that you did their work for them, but the author of the patch knows they don’t have to wait for further feedback from you. Hopefully we can still keep everybody in the loop but have clear ownership and detailed reviews. It might even speed up some changes since you can quickly “ACK” changes you don’t care about, and the author knows they don’t have to wait for feedback from you.
diff --git a/src/docs/compile-arm64.md b/src/docs/compile-arm64.md
deleted file mode 100644
index 57b2ecfb5..000000000
--- a/src/docs/compile-arm64.md
+++ /dev/null
@@ -1,86 +0,0 @@
----
-title: 'Compiling on Arm64 Linux'
-description: 'Tips and tricks to build V8 natively on Arm64 Linux'
----
-If you've gone through instructions on how to [check out](/docs/source-code) and [build](/docs/build-gn) V8 on a machine that is neither x86 nor an Apple Silicon Mac, you may have ran into a bit of trouble, due to the build system downloading native binaries and then not being able to run them. However, even though using an Arm64 Linux machine to work on V8 is __not officially supported__, overcoming those hurdles is pretty straightforward.
-
-## Bypassing `vpython`
-
-`fetch v8`, `gclient sync` and other `depot_tools` commands use a wrapper for python called "vpython". If you see errors related to it, you can define the following variable to use the system's python installation instead:
-
-```bash
-export VPYTHON_BYPASS="manually managed python not supported by chrome operations"
-```
-
-## Compatible `ninja` binary
-
-The first thing to do is to make sure we use a native binary for `ninja`, which we pick instead of the one in `depot_tools`. A simple way to do this is to tweak your PATH as follows when installing `depot_tools`:
-
-```bash
-export PATH=$PATH:/path/to/depot_tools
-```
-
-This way, you'll be able to use your system's `ninja` installation, given it's likely to be available. Although if it isn't you can [build it from source](https://github.com/ninja-build/ninja#building-ninja-itself).
-
-## Compiling clang
-
-By default, V8 will want to use its own build of clang that may not run on your machine. You could tweak GN arguments in order to [use the system's clang or GCC](#system_clang_gcc), however, you may want to use the same clang as upstream, as it will be the most supported version.
-
-You can build it locally directly from the V8 checkout:
-
-```bash
-./tools/clang/scripts/build.py --without-android --without-fuchsia \
- --host-cc=gcc --host-cxx=g++ \
- --gcc-toolchain=/usr \
- --use-system-cmake --disable-asserts
-```
-
-## Setting up GN arguments manually
-
-Convenience scripts may not work by default, instead you'll have to set GN arguments manually following the [manual](/docs/build-gn#gn) workflow. You can get the usual "release", "optdebug" and "debug" configurations with the following arguments:
-
-- `release`
-
-```bash
-is_debug=false
-```
-
-- `optdebug`
-
-```bash
-is_debug=true
-v8_enable_backtrace=true
-v8_enable_slow_dchecks=true
-```
-
-- `debug`
-
-```bash
-is_debug=true
-v8_enable_backtrace=true
-v8_enable_slow_dchecks=true
-v8_optimized_debug=false
-```
-
-## Using the system's clang or GCC { #system_clang_gcc }
-
-Building with GCC is only a case of disabling compiling with clang:
-
-```bash
-is_clang=false
-```
-
-Note that by default, V8 will link using `lld`, which requires a recent version of GCC. You can use `use_lld=false` to switch to the gold linker, or additionally use `use_gold=false` to use `ld`.
-
-If you'd like to use the clang that's installed with your system, say in `/usr`, you can use the following arguments:
-
-```bash
-clang_base_path="/usr"
-clang_use_chrome_plugins=false
-```
-
-However, given the system's clang version may not be well supported, you're likely to deal with warnings, such as unknown compiler flags. In this case it's useful to stop treating warnings as errors with:
-
-```bash
-treat_warnings_as_errors=false
-```
diff --git a/src/docs/contribute.md b/src/docs/contribute.md
deleted file mode 100644
index 7e37776ad..000000000
--- a/src/docs/contribute.md
+++ /dev/null
@@ -1,41 +0,0 @@
----
-title: 'Contributing to V8'
-description: 'This document explains how to contribute to V8.'
----
-The information on this page explains how to contribute to V8. Be sure to read the whole thing before sending us a contribution.
-
-## Get the code
-
-See [Checking out the V8 source code](/docs/source-code).
-
-## Before you contribute
-
-### Ask on V8’s mailing list for guidance
-
-Before you start working on a larger V8 contribution, you should get in touch with us first through [the V8 contributor mailing list](https://groups.google.com/group/v8-dev) so we can help out and possibly guide you. Coordinating up front makes it much easier to avoid frustration later on.
-
-### Sign the CLA
-
-Before we can use your code you have to sign the [Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual), which you can do online. This is mainly because you own the copyright to your changes, even after your contribution becomes part of our codebase, so we need your permission to use and distribute your code. We also need to be sure of various other things, for instance that you’ll tell us if you know that your code infringes on other people’s patents. You don’t have to do this until after you’ve submitted your code for review and a member has approved it, but you will have to do it before we can put your code into our codebase.
-
-Contributions made by corporations are covered by a different agreement than the one above, the [Software Grant and Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate).
-
-Sign them online [here](https://cla.developers.google.com/).
-
-## Submit your code
-
-The source code of V8 follows the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) so you should familiarize yourself with those guidelines. Before submitting code you must pass all our [tests](/docs/test), and have to successfully run the presubmit checks:
-
-```bash
-git cl presubmit
-```
-
-The presubmit script uses a linter from Google, [`cpplint.py`](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py). It is part of [`depot_tools`](https://dev.chromium.org/developers/how-tos/install-depot-tools), and it must be in your `PATH` — so if you have `depot_tools` in your `PATH`, everything should just work.
-
-### Upload to V8’s codereview tool
-
-All submissions, including submissions by project members, require review. We use the same code-review tools and process as the Chromium project. In order to submit a patch, you need to get the [`depot_tools`](https://dev.chromium.org/developers/how-tos/install-depot-tools) and follow these instructions on [requesting a review](https://chromium.googlesource.com/chromium/src/+/master/docs/contributing.md) (using your V8 workspace instead of a Chromium workspace).
-
-### Look out for breakage or regressions
-
-Once you have codereview approval, you can land your patch using the commit queue. It runs a bunch of tests and commits your patch if all tests pass. Once your change is committed, it is a good idea to watch [the console](https://ci.chromium.org/p/v8/g/main/console) until the bots turn green after your change, because the console runs a few more tests than the commit queue.
diff --git a/src/docs/cross-compile-arm.md b/src/docs/cross-compile-arm.md
deleted file mode 100644
index f5d0622b9..000000000
--- a/src/docs/cross-compile-arm.md
+++ /dev/null
@@ -1,170 +0,0 @@
----
-title: 'Cross-compiling and debugging for ARM/Android'
-description: 'This document explains how to cross-compile V8 for ARM/Android, and how to debug it.'
----
-First, make sure you can [build with GN](/docs/build-gn).
-
-Then, add `android` to your `.gclient` configuration file.
-
-```python
-target_os = ['android'] # Add this to get Android stuff checked out.
-```
-
-The `target_os` field is a list, so if you're also building on unix it'll look like this:
-
-```python
-target_os = ['android', 'unix'] # Multiple target OSes.
-```
-
-Run `gclient sync`, and you’ll get a large checkout under `./third_party/android_tools`.
-
-Enable developer mode on your phone or tablet, and turn on USB debugging, via instructions [here](https://developer.android.com/studio/run/device.html). Also, get the handy [`adb`](https://developer.android.com/studio/command-line/adb.html) tool on your path. It’s in your checkout at `./third_party/android_sdk/public/platform-tools`.
-
-## Using `gm`
-
-Use [the `tools/dev/gm.py` script](/docs/build-gn#gm) to automatically build V8 tests and run them on the device.
-
-```bash
-alias gm=/path/to/v8/tools/dev/gm.py
-gm android_arm.release.check
-```
-
-This command pushes the binaries and tests to the `/data/local/tmp/v8` directory on the device.
-
-## Manual build
-
-Use `v8gen.py` to generate an ARM release or debug build:
-
-```bash
-tools/dev/v8gen.py arm.release
-```
-
-Then run `gn args out.gn/arm.release` and make sure you have the following keys:
-
-```python
-target_os = "android" # These lines need to be changed manually
-target_cpu = "arm" # as v8gen.py assumes a simulator build.
-v8_target_cpu = "arm"
-is_component_build = false
-```
-
-The keys should be the same for debug builds. If you are building for an arm64 device like the Pixel C, which supports 32bit and 64bit binaries, the keys should look like this:
-
-```python
-target_os = "android" # These lines need to be changed manually
-target_cpu = "arm64" # as v8gen.py assumes a simulator build.
-v8_target_cpu = "arm64"
-is_component_build = false
-```
-
-Now build:
-
-```bash
-ninja -C out.gn/arm.release d8
-```
-
-Use `adb` to copy the binary and snapshot files to the phone:
-
-```bash
-adb shell 'mkdir -p /data/local/tmp/v8/bin'
-adb push out.gn/arm.release/d8 /data/local/tmp/v8/bin
-adb push out.gn/arm.release/icudtl.dat /data/local/tmp/v8/bin
-adb push out.gn/arm.release/snapshot_blob.bin /data/local/tmp/v8/bin
-```
-
-```bash
-rebuffat:~/src/v8$ adb shell
-bullhead:/ $ cd /data/local/tmp/v8/bin
-bullhead:/data/local/tmp/v8/bin $ ls
-v8 icudtl.dat snapshot_blob.bin
-bullhead:/data/local/tmp/v8/bin $ ./d8
-V8 version 5.8.0 (candidate)
-d8> 'w00t!'
-"w00t!"
-d8>
-```
-
-## Debugging
-
-### d8
-
-Remote debugging `d8` on an Android device is relatively simple. First start `gdbserver` on the Android device:
-
-```bash
-bullhead:/data/local/tmp/v8/bin $ gdbserver :5039 $D8
-```
-
-Then connect to the server on your host device.
-
-```bash
-adb forward tcp:5039 tcp:5039
-gdb $D8
-gdb> target remote :5039
-```
-
-`gdb` and `gdbserver` need to be compatible with each other, if in doubt use the binaries from the [Android NDK](https://developer.android.com/ndk). Note that by default the `d8` binary is stripped (debugging info removed), `$OUT_DIR/exe.unstripped/d8` contains the unstripped binary though.
-
-### Logging
-
-By default, some of `d8`’s debugging output ends up in the Android system log, which can be dumped using [`logcat`](https://developer.android.com/studio/command-line/logcat). Unfortunately, sometimes part of a particular debugging output is split between system log and `adb`, and sometimes some part seems to be completely missing. To avoid these issues, it is recommended to add the following setting to the `gn args`:
-
-```python
-v8_android_log_stdout = true
-```
-
-### Floating-point issues
-
-The `gn args` setting `arm_float_abi = "hard"`, which is used by the V8 Arm GC Stress bot, can result in completely nonsensical program behavior on hardware different from the one the GC stress bot is using (e.g. on Nexus 7).
-
-## Using Sourcery G++ Lite
-
-The Sourcery G++ Lite cross compiler suite is a free version of Sourcery G++ from [CodeSourcery](http://www.codesourcery.com/). There is a page for the [GNU Toolchain for ARM Processors](http://www.codesourcery.com/sgpp/lite/arm). Determine the version you need for your host/target combination.
-
-The following instructions use [2009q1-203 for ARM GNU/Linux](http://www.codesourcery.com/sgpp/lite/arm/portal/release858), and if using a different version please change the URLs and `TOOL_PREFIX` below accordingly.
-
-### Installing on host and target
-
-The simplest way of setting this up is to install the full Sourcery G++ Lite package on both the host and target at the same location. This will ensure that all the libraries required are available on both sides. If you want to use the default libraries on the host there is no need the install anything on the target.
-
-The following script installs in `/opt/codesourcery`:
-
-```bash
-#!/bin/sh
-
-sudo mkdir /opt/codesourcery
-cd /opt/codesourcery
-sudo chown "$USERNAME" .
-chmod g+ws .
-umask 2
-wget http://www.codesourcery.com/sgpp/lite/arm/portal/package4571/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
-tar -xvf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
-```
-
-## Profile
-
-- Compile a binary, push it to the device, keep a copy of it on the host:
-
- ```bash
- adb shell cp /data/local/tmp/v8/bin/d8 /data/local/tmp/v8/bin/d8-version.under.test
- cp out.gn/arm.release/d8 ./d8-version.under.test
- ```
-
-- Get a profiling log and copy it to the host:
-
- ```bash
- adb push benchmarks /data/local/tmp
- adb shell cd /data/local/tmp/benchmarks; ../v8/bin/d8-version.under.test run.js --prof
- adb shell /data/local/tmp/v8/bin/d8-version.under.test benchmark.js --prof
- adb pull /data/local/tmp/benchmarks/v8.log ./
- ```
-
-- Open `v8.log` in your favorite editor and edit the first line to match the full path of the `d8-version.under.test` binary on your workstation (instead of the `/data/local/tmp/v8/bin/` path it had on the device)
-
-- Run the tick processor with the host’s `d8` and an appropriate `nm` binary:
-
- ```bash
- cp out/x64.release/d8 . # only required once
- cp out/x64.release/natives_blob.bin . # only required once
- cp out/x64.release/snapshot_blob.bin . # only required once
- tools/linux-tick-processor --nm=$(pwd)/third_party/android_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm
- ```
diff --git a/src/docs/cross-compile-ios.md b/src/docs/cross-compile-ios.md
deleted file mode 100644
index 5b8ecc68b..000000000
--- a/src/docs/cross-compile-ios.md
+++ /dev/null
@@ -1,52 +0,0 @@
----
-title: 'Cross-compiling for iOS'
-description: 'This document explains how to cross-compile V8 for iOS.'
----
-This page serves as a brief introduction to building V8 for iOS targets.
-
-## Requirements
-
-- A macOS (OS X) host machine with Xcode installed.
-- A 64-bit target iOS device (legacy 32-bit iOS devices are unsupported).
-- V8 v7.5 or newer.
-- jitless is a hard requirement for iOS (as of Dec. 2020). Therefore please use the flags '--expose_gc --jitless'
-
-## Initial setup
-
-Follow [the instructions to build V8](/docs/build).
-
-Fetch additional tools needed for iOS cross-compilation by adding `target_os` in your `.gclient` configuration file, located in the parent directory of the `v8` source directory:
-
-```python
-# [... other contents of .gclient such as the 'solutions' variable ...]
-target_os = ['ios']
-```
-
-After updating `.gclient`, run `gclient sync` to download the additional tools.
-
-## Manual build
-
-This section shows how to build a monolithic V8 version for use on either a physical iOS device or the Xcode iOS simulator. The output of this build is a `libv8_monolith.a` file that contains all V8 libraries as well as the V8 snapshot.
-
-Set up GN build files by running `gn args out/release-ios` and inserting the following keys:
-
-```python
-ios_deployment_target = 10
-is_component_build = false
-is_debug = false
-target_cpu = "arm64" # "x64" for a simulator build.
-target_os = "ios"
-use_custom_libcxx = false # Use Xcode's libcxx.
-v8_enable_i18n_support = false # Produces a smaller binary.
-v8_monolithic = true # Enable the v8_monolith target.
-v8_use_external_startup_data = false # The snaphot is included in the binary.
-v8_enable_pointer_compression = false # Unsupported on iOS.
-```
-
-Now build:
-
-```bash
-ninja -C out/release-ios v8_monolith
-```
-
-Finally, add the generated `libv8_monolith.a` file to your Xcode project as a static library. For further documentation on embedding V8 in your application, see [Getting started with embedding V8](/docs/embed).
diff --git a/src/docs/csa-builtins.md b/src/docs/csa-builtins.md
deleted file mode 100644
index c425f5bbb..000000000
--- a/src/docs/csa-builtins.md
+++ /dev/null
@@ -1,228 +0,0 @@
----
-title: 'CodeStubAssembler builtins'
-description: 'This document is intended as an introduction to writing CodeStubAssembler builtins, and is targeted towards V8 developers.'
----
-This document is intended as an introduction to writing CodeStubAssembler builtins, and is targeted towards V8 developers.
-
-:::note
-**Note:** [Torque](/docs/torque) replaces CodeStubAssembler as the recommended way to implement new builtins. See [Torque builtins](/docs/torque-builtins) for the Torque version of this guide.
-:::
-
-## Builtins
-
-In V8, builtins can be seen as chunks of code that are executable by the VM at runtime. A common use case is to implement the functions of builtin objects (such as RegExp or Promise), but builtins can also be used to provide other internal functionality (e.g. as part of the IC system).
-
-V8’s builtins can be implemented using a number of different methods (each with different trade-offs):
-
-- **Platform-dependent assembly language**: can be highly efficient, but need manual ports to all platforms and are difficult to maintain.
-- **C++**: very similar in style to runtime functions and have access to V8’s powerful runtime functionality, but usually not suited to performance-sensitive areas.
-- **JavaScript**: concise and readable code, access to fast intrinsics, but frequent usage of slow runtime calls, subject to unpredictable performance through type pollution, and subtle issues around (complicated and non-obvious) JS semantics.
-- **CodeStubAssembler**: provides efficient low-level functionality that is very close to assembly language while remaining platform-independent and preserving readability.
-
-The remaining document focuses on the latter and give a brief tutorial for developing a simple CodeStubAssembler (CSA) builtin exposed to JavaScript.
-
-## CodeStubAssembler
-
-V8’s CodeStubAssembler is a custom, platform-agnostic assembler that provides low-level primitives as a thin abstraction over assembly, but also offers an extensive library of higher-level functionality.
-
-```cpp
-// Low-level:
-// Loads the pointer-sized data at addr into value.
-Node* addr = /* ... */;
-Node* value = Load(MachineType::IntPtr(), addr);
-
-// And high-level:
-// Performs the JS operation ToString(object).
-// ToString semantics are specified at https://tc39.es/ecma262/#sec-tostring.
-Node* object = /* ... */;
-Node* string = ToString(context, object);
-```
-
-CSA builtins run through part of the TurboFan compilation pipeline (including block scheduling and register allocation, but notably not through optimization passes) which then emits the final executable code.
-
-## Writing a CodeStubAssembler builtin
-
-In this section, we will write a simple CSA builtin that takes a single argument, and returns whether it represents the number `42`. The builtin is exposed to JS by installing it on the `Math` object (because we can).
-
-This example demonstrates:
-
-- Creating a CSA builtin with JavaScript linkage, which can be called like a JS function.
-- Using CSA to implement simple logic: Smi and heap-number handling, conditionals, and calls to TFS builtins.
-- Using CSA Variables.
-- Installation of the CSA builtin on the `Math` object.
-
-In case you’d like to follow along locally, the following code is based off revision [7a8d20a7](https://chromium.googlesource.com/v8/v8/+/7a8d20a79f9d5ce6fe589477b09327f3e90bf0e0).
-
-## Declaring `MathIs42`
-
-Builtins are declared in the `BUILTIN_LIST_BASE` macro in [`src/builtins/builtins-definitions.h`](https://cs.chromium.org/chromium/src/v8/src/builtins/builtins-definitions.h?q=builtins-definitions.h+package:%5Echromium$&l=1). To create a new CSA builtin with JS linkage and one parameter named `X`:
-
-```cpp
-#define BUILTIN_LIST_BASE(CPP, API, TFJ, TFC, TFS, TFH, ASM, DBG) \
- // […snip…]
- TFJ(MathIs42, 1, kX) \
- // […snip…]
-```
-
-Note that `BUILTIN_LIST_BASE` takes several different macros that denote different builtin kinds (see inline documentation for more details). CSA builtins specifically are split into:
-
-- **TFJ**: JavaScript linkage.
-- **TFS**: Stub linkage.
-- **TFC**: Stub linkage builtin requiring a custom interface descriptor (e.g. if arguments are untagged or need to be passed in specific registers).
-- **TFH**: Specialized stub linkage builtin used for IC handlers.
-
-## Defining `MathIs42`
-
-Builtin definitions are located in `src/builtins/builtins-*-gen.cc` files, roughly organized by topic. Since we will be writing a `Math` builtin, we’ll put our definition into [`src/builtins/builtins-math-gen.cc`](https://cs.chromium.org/chromium/src/v8/src/builtins/builtins-math-gen.cc?q=builtins-math-gen.cc+package:%5Echromium$&l=1).
-
-```cpp
-// TF_BUILTIN is a convenience macro that creates a new subclass of the given
-// assembler behind the scenes.
-TF_BUILTIN(MathIs42, MathBuiltinsAssembler) {
- // Load the current function context (an implicit argument for every stub)
- // and the X argument. Note that we can refer to parameters by the names
- // defined in the builtin declaration.
- Node* const context = Parameter(Descriptor::kContext);
- Node* const x = Parameter(Descriptor::kX);
-
- // At this point, x can be basically anything - a Smi, a HeapNumber,
- // undefined, or any other arbitrary JS object. Let’s call the ToNumber
- // builtin to convert x to a number we can use.
- // CallBuiltin can be used to conveniently call any CSA builtin.
- Node* const number = CallBuiltin(Builtins::kToNumber, context, x);
-
- // Create a CSA variable to store the resulting value. The type of the
- // variable is kTagged since we will only be storing tagged pointers in it.
- VARIABLE(var_result, MachineRepresentation::kTagged);
-
- // We need to define a couple of labels which will be used as jump targets.
- Label if_issmi(this), if_isheapnumber(this), out(this);
-
- // ToNumber always returns a number. We need to distinguish between Smis
- // and heap numbers - here, we check whether number is a Smi and conditionally
- // jump to the corresponding labels.
- Branch(TaggedIsSmi(number), &if_issmi, &if_isheapnumber);
-
- // Binding a label begins generating code for it.
- BIND(&if_issmi);
- {
- // SelectBooleanConstant returns the JS true/false values depending on
- // whether the passed condition is true/false. The result is bound to our
- // var_result variable, and we then unconditionally jump to the out label.
- var_result.Bind(SelectBooleanConstant(SmiEqual(number, SmiConstant(42))));
- Goto(&out);
- }
-
- BIND(&if_isheapnumber);
- {
- // ToNumber can only return either a Smi or a heap number. Just to make sure
- // we add an assertion here that verifies number is actually a heap number.
- CSA_ASSERT(this, IsHeapNumber(number));
- // Heap numbers wrap a floating point value. We need to explicitly extract
- // this value, perform a floating point comparison, and again bind
- // var_result based on the outcome.
- Node* const value = LoadHeapNumberValue(number);
- Node* const is_42 = Float64Equal(value, Float64Constant(42));
- var_result.Bind(SelectBooleanConstant(is_42));
- Goto(&out);
- }
-
- BIND(&out);
- {
- Node* const result = var_result.value();
- CSA_ASSERT(this, IsBoolean(result));
- Return(result);
- }
-}
-```
-
-## Attaching `Math.Is42`
-
-Builtin objects such as `Math` are set up mostly in [`src/bootstrapper.cc`](https://cs.chromium.org/chromium/src/v8/src/bootstrapper.cc?q=src/bootstrapper.cc+package:%5Echromium$&l=1) (with some setup occurring in `.js` files). Attaching our new builtin is simple:
-
-```cpp
-// Existing code to set up Math, included here for clarity.
-Handle math = factory->NewJSObject(cons, TENURED);
-JSObject::AddProperty(global, name, math, DONT_ENUM);
-// […snip…]
-SimpleInstallFunction(math, "is42", Builtins::kMathIs42, 1, true);
-```
-
-Now that `Is42` is attached, it can be called from JS:
-
-```bash
-$ out/debug/d8
-d8> Math.is42(42);
-true
-d8> Math.is42('42.0');
-true
-d8> Math.is42(true);
-false
-d8> Math.is42({ valueOf: () => 42 });
-true
-```
-
-## Defining and calling a builtin with stub linkage
-
-CSA builtins can also be created with stub linkage (instead of JS linkage as we used above in `MathIs42`). Such builtins can be useful to extract commonly-used code into a separate code object that can be used by multiple callers, while the code is only produced once. Let’s extract the code that handles heap numbers into a separate builtin called `MathIsHeapNumber42`, and call it from `MathIs42`.
-
-Defining and using TFS stubs is easy; declaration are again placed in [`src/builtins/builtins-definitions.h`](https://cs.chromium.org/chromium/src/v8/src/builtins/builtins-definitions.h?q=builtins-definitions.h+package:%5Echromium$&l=1):
-
-```cpp
-#define BUILTIN_LIST_BASE(CPP, API, TFJ, TFC, TFS, TFH, ASM, DBG) \
- // […snip…]
- TFS(MathIsHeapNumber42, kX) \
- TFJ(MathIs42, 1, kX) \
- // […snip…]
-```
-
-Note that currently, order within `BUILTIN_LIST_BASE` does matter. Since `MathIs42` calls `MathIsHeapNumber42`, the former needs to be listed after the latter (this requirement should be lifted at some point).
-
-The definition is also straightforward. In [`src/builtins/builtins-math-gen.cc`](https://cs.chromium.org/chromium/src/v8/src/builtins/builtins-math-gen.cc?q=builtins-math-gen.cc+package:%5Echromium$&l=1):
-
-```cpp
-// Defining a TFS builtin works exactly the same way as TFJ builtins.
-TF_BUILTIN(MathIsHeapNumber42, MathBuiltinsAssembler) {
- Node* const x = Parameter(Descriptor::kX);
- CSA_ASSERT(this, IsHeapNumber(x));
- Node* const value = LoadHeapNumberValue(x);
- Node* const is_42 = Float64Equal(value, Float64Constant(42));
- Return(SelectBooleanConstant(is_42));
-}
-```
-
-Finally, let’s call our new builtin from `MathIs42`:
-
-```cpp
-TF_BUILTIN(MathIs42, MathBuiltinsAssembler) {
- // […snip…]
- BIND(&if_isheapnumber);
- {
- // Instead of handling heap numbers inline, we now call into our new TFS stub.
- var_result.Bind(CallBuiltin(Builtins::kMathIsHeapNumber42, context, number));
- Goto(&out);
- }
- // […snip…]
-}
-```
-
-Why should you care about TFS builtins at all? Why not leave the code inline (or extracted into a helper method for better readability)?
-
-An important reason is code space: builtins are generated at compile-time and included in the V8 snapshot, thus unconditionally taking up (significant) space in every created isolate. Extracting large chunks of commonly used code to TFS builtins can quickly lead to space savings in the 10s to 100s of KBs.
-
-## Testing stub-linkage builtins
-
-Even though our new builtin uses a non-standard (at least non-C++) calling convention, it’s possible to write test cases for it. The following code can be added to [`test/cctest/compiler/test-run-stubs.cc`](https://cs.chromium.org/chromium/src/v8/test/cctest/compiler/test-run-stubs.cc?l=1&rcl=4cab16db27808cf66ab883e7904f1891f9fd0717) to test the builtin on all platforms:
-
-```cpp
-TEST(MathIsHeapNumber42) {
- HandleAndZoneScope scope;
- Isolate* isolate = scope.main_isolate();
- Heap* heap = isolate->heap();
- Zone* zone = scope.main_zone();
-
- StubTester tester(isolate, zone, Builtins::kMathIs42);
- Handle