Embedders of V8 should generally use the head of the branch corresponding to the minor version of V8 that ships in Chrome.
Finding the minor version of V8 corresponding to the latest stable Chrome
To find out what version this is,
- Go to https://omahaproxy.appspot.com/
- Find the latest stable Chrome version in the table
- Enter it into the "Translate a Chrome verison to a V8 version" box below the table.
- Ignore the last two parts.
Example: at the time of this writing, the site indicates that for
stable, the Chrome release version is 39.0.2171.95. Entering that into the box gives back "V8 Version: 126.96.36.199." Cutting that down to only the minor version gives 3.29.
Finding the head of the corresponding branch
V8's version-related branches do not appear in the online repository at https://chromium.googlesource.com/v8/v8.git; instead only tags appear. To find the head of that branch, go to the URL in this form:
Example: for the V8 minor version 3.29 found above, we go to https://chromium.googlesource.com/v8/v8.git/+/branch-heads/3.29, finding a commit titled "Version 188.8.131.52 (cherry-pick)." Thus, the version of V8 that embedders should use at the time of this writing is 184.108.40.206.
Caution: You should not simply find the numerically-greatest tag corresponding to the above minor V8 version, as sometimes those are not supported, e.g. they are tagged before deciding where to cut minor releases. Such versions will not receive backports or similar.
Example: the V8 tags 3.29.91, 3.29.92, 3.29.93, and 220.127.116.11 are abandoned, despite being numerically greater than the branch head of 18.104.22.168.
Checking out the head of the corresponding branch
If you have the source already, you can check out the head somewhat directly. If you have retrieved the source using depot_tools then you should be able to do
$ git branch --remotes | grep branch-heads/
to list the relevant branches. You'll want to check out the one corresponding to the minor V8 version you found above, and use that. The tag that you end up on will be the appropriate V8 version for you as the embedder.
If you did not use depot_tools, you'll need to edit
.git/config and add the line below to the
[remote "origin"] section:
fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*
Example: for the V8 minor version 3.29 found above, we can do
$ git checkout branch-heads/3.29 HEAD is now at 02f2ff3... Version 22.214.171.124 (cherry-pick)