a0572f0bc7
Previously we stored the source position table, which stored a mapping of pc offsets to line numbers, and the inline_locations, which stored a mapping of pc offsets to stacks of {CodeEntry, line_number} pairs. This was slightly wasteful because we had two different tables which were both keyed on the pc offset and contained some overlapping information. This CL combines the two tables in a way. The source position table now maps a pc offset to a pair of {line_number, inlining_id}. If the inlining_id is valid, then it can be used to look up the inlining stack which is stored in inline_locations, but is now keyed by inlining_id rather than pc offset. This also has the nice effect of de-duplicating inline stacks which we previously duplicated. The new structure is similar to how this data is stored by the compiler, except that we convert 'source positions' (char offset in a file) into line numbers as we go, because we only care about attributing ticks to a given line. Also remove the helper RecordInliningInfo() as this is only actually used to add inline stacks by one caller (where it is now inlined). The other callers would always bail out or are only called from test-cpu-profiler. Remove AddInlineStack and replace it with SetInlineStacks which adds all of the stacks at once. We need to do it this way because the source pos table is passed into the constructor of CodeEntry, so we need to create it before the CodeEntry, but the inline stacks are not (they are part of rare_data which is not always present), so we need to add them after construction. Given that we calculate both the source pos table and the inline stacks before construction, it's just easier to add them all at once. Also add a print() method to CodeEntry to make future debugging easier as I'm constantly rewriting this locally. Bug: v8:8575, v8:7719, v8:7203 Change-Id: I39324d6ea13d116d5da5d0a0d243cae76a749c79 Reviewed-on: https://chromium-review.googlesource.com/c/1392195 Commit-Queue: Peter Marshall <petermarshall@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#58554} |
||
---|---|---|
benchmarks | ||
build_overrides | ||
custom_deps | ||
docs | ||
gni | ||
include | ||
infra | ||
samples | ||
src | ||
test | ||
testing | ||
third_party | ||
tools | ||
.clang-format | ||
.clang-tidy | ||
.editorconfig | ||
.git-blame-ignore-revs | ||
.gitattributes | ||
.gitignore | ||
.gn | ||
.vpython | ||
.ycm_extra_conf.py | ||
AUTHORS | ||
BUILD.gn | ||
ChangeLog | ||
CODE_OF_CONDUCT.md | ||
codereview.settings | ||
DEPS | ||
LICENSE | ||
LICENSE.fdlibm | ||
LICENSE.strongtalk | ||
LICENSE.v8 | ||
LICENSE.valgrind | ||
OWNERS | ||
PRESUBMIT.py | ||
README.md | ||
snapshot_toolchain.gni | ||
WATCHLISTS |
V8 JavaScript Engine
V8 is Google's open source JavaScript engine.
V8 implements ECMAScript as specified in ECMA-262.
V8 is written in C++ and is used in Google Chrome, the open source browser from Google.
V8 can run standalone, or can be embedded into any C++ application.
V8 Project page: https://github.com/v8/v8/wiki
Getting the Code
Checkout depot tools, and run
fetch v8
This will checkout V8 into the directory v8
and fetch all of its dependencies.
To stay up to date, run
git pull origin
gclient sync
For fetching all branches, add the following into your remote
configuration in .git/config
:
fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*
fetch = +refs/tags/*:refs/tags/*
Contributing
Please follow the instructions mentioned on the V8 wiki.