summaryrefslogtreecommitdiff
path: root/chromium/v8/tools
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-09-01 11:08:40 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-01 12:16:21 +0000
commit03c549e0392f92c02536d3f86d5e1d8dfa3435ac (patch)
treefe49d170a929b34ba82cd10db1a0bd8e3760fa4b /chromium/v8/tools
parent5d013f5804a0d91fcf6c626b2d6fb6eca5c845b0 (diff)
downloadqtwebengine-chromium-03c549e0392f92c02536d3f86d5e1d8dfa3435ac.tar.gz
BASELINE: Update Chromium to 91.0.4472.160
Change-Id: I0def1f08a2412aeed79a9ab95dd50eb5c3f65f31 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/tools')
-rw-r--r--chromium/v8/tools/arguments.mjs6
-rwxr-xr-xchromium/v8/tools/bash-completion.sh113
-rw-r--r--chromium/v8/tools/callstats.html1126
-rw-r--r--chromium/v8/tools/clusterfuzz/js_fuzzer/exceptions.js1
-rw-r--r--chromium/v8/tools/clusterfuzz/js_fuzzer/mutators/function_call_mutator.js26
-rw-r--r--chromium/v8/tools/clusterfuzz/js_fuzzer/resources/differential_fuzz_v8.js2
-rw-r--r--chromium/v8/tools/clusterfuzz/js_fuzzer/test_data/mutate_function_call_baseline_expected.js16
-rw-r--r--chromium/v8/tools/clusterfuzz/v8_foozzie_harness_adjust.js4
-rw-r--r--chromium/v8/tools/clusterfuzz/v8_fuzz_flags.json3
-rw-r--r--chromium/v8/tools/debug_helper/BUILD.gn1
-rw-r--r--chromium/v8/tools/debug_helper/debug-helper-internal.cc2
-rw-r--r--chromium/v8/tools/debug_helper/get-object-properties.cc104
-rwxr-xr-xchromium/v8/tools/dev/gm.py100
-rw-r--r--chromium/v8/tools/dumpcpp.mjs4
-rwxr-xr-xchromium/v8/tools/find-builtin24
-rw-r--r--chromium/v8/tools/gcmole/gcmole.py3
-rw-r--r--chromium/v8/tools/ic-processor-driver.mjs8
-rw-r--r--chromium/v8/tools/index.html13
-rw-r--r--chromium/v8/tools/ninja/ninja_output.py44
-rw-r--r--chromium/v8/tools/profview/profile-utils.js6
-rw-r--r--chromium/v8/tools/profview/profview.js4
-rwxr-xr-xchromium/v8/tools/release/auto_roll.py3
-rw-r--r--chromium/v8/tools/release/git_recipes.py7
-rwxr-xr-xchromium/v8/tools/release/test_scripts.py4
-rw-r--r--chromium/v8/tools/system-analyzer/index.css2
-rw-r--r--chromium/v8/tools/testrunner/base_runner.py3
-rw-r--r--chromium/v8/tools/testrunner/local/variants.py47
-rw-r--r--chromium/v8/tools/tickprocessor.mjs2
-rw-r--r--chromium/v8/tools/v8heapconst.py418
-rw-r--r--chromium/v8/tools/v8windbg/BUILD.gn2
-rw-r--r--chromium/v8/tools/v8windbg/README.md4
-rw-r--r--chromium/v8/tools/v8windbg/src/cur-isolate.h2
-rw-r--r--chromium/v8/tools/v8windbg/src/js-stack.cc229
-rw-r--r--chromium/v8/tools/v8windbg/src/js-stack.h98
-rw-r--r--chromium/v8/tools/v8windbg/src/v8windbg-extension.cc4
-rw-r--r--chromium/v8/tools/vim/ninja-build.vim14
-rw-r--r--chromium/v8/tools/vim/ninja_output.py72
-rwxr-xr-xchromium/v8/tools/wasm/update-wasm-spec-tests.sh2
-rw-r--r--chromium/v8/tools/whitespace.txt4
39 files changed, 1691 insertions, 836 deletions
diff --git a/chromium/v8/tools/arguments.mjs b/chromium/v8/tools/arguments.mjs
index 4e607b7ee9b..1d266b7cee5 100644
--- a/chromium/v8/tools/arguments.mjs
+++ b/chromium/v8/tools/arguments.mjs
@@ -23,10 +23,10 @@ export class BaseArgumentsProcessor {
result() { return this.result_ }
printUsageAndExit() {
- print('Cmdline args: [options] [log-file-name]\n' +
+ console.log('Cmdline args: [options] [log-file-name]\n' +
'Default log file name is "' +
this.result_.logFileName + '".\n');
- print('Options:');
+ console.log('Options:');
for (const arg in this.argsDispatch_) {
const synonyms = [arg];
const dispatch = this.argsDispatch_[arg];
@@ -36,7 +36,7 @@ export class BaseArgumentsProcessor {
delete this.argsDispatch_[synArg];
}
}
- print(` ${synonyms.join(', ').padEnd(20)} ${dispatch[2]}`);
+ console.log(` ${synonyms.join(', ').padEnd(20)} ${dispatch[2]}`);
}
quit(2);
}
diff --git a/chromium/v8/tools/bash-completion.sh b/chromium/v8/tools/bash-completion.sh
index 27e73b7ad64..a7d525f1790 100755
--- a/chromium/v8/tools/bash-completion.sh
+++ b/chromium/v8/tools/bash-completion.sh
@@ -27,33 +27,112 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Inspired by and based on:
-# http://src.chromium.org/viewvc/chrome/trunk/src/tools/bash-completion
+# https://chromium.googlesource.com/chromium/src/+/master/tools/bash-completion
# Flag completion rule for bash.
# To load in your shell, "source path/to/this/file".
-v8_source=$(readlink -f $(dirname $BASH_SOURCE)/..)
+v8_source="$(realpath "$(dirname "$BASH_SOURCE")"/..)"
-_v8_flag() {
- local cur defines targets
- cur="${COMP_WORDS[COMP_CWORD]}"
- defines=$(cat $v8_source/src/flags/flag-definitions.h \
+_get_v8_flags() {
+ # The first `sed` command joins lines when a line ends with '('.
+ # See http://sed.sourceforge.net/sedfaq3.html#s3.2
+ local flags_file="$v8_source/src/flags/flag-definitions.h"
+ local defines=$( \
+ sed -e :a -e '/($/N; s/(\n\s*/(/; ta' < "$flags_file" \
| grep "^DEFINE" \
| grep -v "DEFINE_IMPLICATION" \
+ | grep -v "DEFINE_NEG_IMPLICATION" \
+ | grep -v "DEFINE_VALUE_IMPLICATION" \
| sed -e 's/_/-/g'; \
- cat $v8_source/src/flags/flag-definitions.h \
- | grep "^ V(harmony_" \
+ grep "^ V(harmony_" "$flags_file" \
| sed -e 's/^ V/DEFINE-BOOL/' \
+ | sed -e 's/_/-/g'; \
+ grep "^ V(" "$v8_source/src/wasm/wasm-feature-flags.h" \
+ | sed -e 's/^ V(/DEFINE-BOOL(experimental-wasm-/' \
| sed -e 's/_/-/g')
- targets=$(echo "$defines" \
- | sed -ne 's/^DEFINE-[^(]*(\([^,]*\).*/--\1/p'; \
- echo "$defines" \
- | sed -ne 's/^DEFINE-BOOL(\([^,]*\).*/--no\1/p'; \
- cat $v8_source/src/d8/d8.cc \
- | grep "strcmp(argv\[i\]" \
- | sed -ne 's/^[^"]*"--\([^"]*\)".*/--\1/p')
- COMPREPLY=($(compgen -W "$targets" -- "$cur"))
+ sed -ne 's/^DEFINE-[^(]*(\([^,]*\).*/--\1/p' <<< "$defines"
+ sed -ne 's/^DEFINE-BOOL(\([^,]*\).*/--no\1/p' <<< "$defines"
+}
+
+_get_d8_flags() {
+ grep "strcmp(argv\[i\]" "$v8_source/src/d8/d8.cc" \
+ | sed -ne 's/^[^"]*"--\([^"]*\)".*/--\1/p'
+}
+
+_d8_flag() {
+ local targets
+ targets=$(_get_v8_flags ; _get_d8_flags)
+ COMPREPLY=($(compgen -W "$targets" -- "${COMP_WORDS[COMP_CWORD]}"))
+ return 0
+}
+
+_test_flag() {
+ local targets
+ targets=$(_get_v8_flags)
+ COMPREPLY=($(compgen -W "$targets" -- "${COMP_WORDS[COMP_CWORD]}"))
+ return 0
+}
+
+complete -F _d8_flag -f d8 v8 v8-debug
+complete -F _test_flag -f cctest unittests
+
+# Many distros set up their own GDB completion scripts. The logic below is
+# careful to wrap any such functions (with additional logic), rather than
+# overwriting them.
+# An additional complication is that tested distros dynamically load their
+# completion scripts on first use. So in order to be able to detect their
+# presence, we have to force-load them first.
+_maybe_setup_gdb_completions() {
+ # We only want to set up the wrapping once:
+ [[ -n "$_ORIGINAL_GDB_COMPLETIONS" ]] && return 0;
+
+ # This path works for Debian, Ubuntu, and Gentoo; other distros unknown.
+ # Feel free to submit patches to extend the logic.
+ local GDB_COMP
+ for GDB_COMP in "/usr/share/bash-completion/completions/gdb"; do
+ [[ -f "$GDB_COMP" ]] && source $GDB_COMP
+ done
+ _ORIGINAL_GDB_COMPLETIONS="$(complete -p gdb 2>/dev/null \
+ | sed -e 's/^.*-F \([^ ]*\).*/\1/')"
+
+ _gdb_v8_flag() {
+ local c i next
+ for (( i=1; i<$(($COMP_CWORD-1)); i++ )); do
+ c=${COMP_WORDS[$i]}
+ if [ "$c" = "-args" ] || [ "$c" = "--args" ] || [ "$c" == "--" ]; then
+ next=$(basename -- ${COMP_WORDS[$(($i+1))]})
+ if [ "$next" = "d8" ] ; then
+ _d8_flag
+ return 0
+ elif [ "$next" = "unittests" ] || [ "$next" = "cctest" ]; then
+ _test_flag
+ return 0
+ fi
+ fi
+ done
+ [[ -n "$_ORIGINAL_GDB_COMPLETIONS" ]] && $_ORIGINAL_GDB_COMPLETIONS
+ return 0
+ }
+ complete -F _gdb_v8_flag -f gdb
+}
+_maybe_setup_gdb_completions
+unset _maybe_setup_gdb_completions
+
+_get_gm_flags() {
+ "$v8_source/tools/dev/gm.py" --print-completions
+
+ # cctest ignore directory structure, it's always "cctest/filename".
+ find "$v8_source/test/cctest/" -type f -name 'test-*' | \
+ xargs basename -a -s ".cc" | \
+ while read -r item; do echo "cctest/$item/*"; done
+}
+
+_gm_flag() {
+ local targets=$(_get_gm_flags)
+ COMPREPLY=($(compgen -W "$targets" -- "${COMP_WORDS[COMP_CWORD]}"))
return 0
}
-complete -F _v8_flag -f d8
+# gm might be an alias, based on https://v8.dev/docs/build-gn#gm.
+complete -F _gm_flag gm.py gm
diff --git a/chromium/v8/tools/callstats.html b/chromium/v8/tools/callstats.html
index cc4260d2806..701e5bee874 100644
--- a/chromium/v8/tools/callstats.html
+++ b/chromium/v8/tools/callstats.html
@@ -7,12 +7,29 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
<head>
<meta charset="utf-8">
- <title>V8 Runtime Stats Komparator</title>
+ <title>V8 Runtime Call Stats Komparator</title>
+ <link rel="stylesheet" type="text/css" href="system-analyzer/index.css">
<style>
body {
font-family: arial;
}
+ .panel {
+ display: none;
+ }
+
+ .loaded .panel {
+ display: block;
+ }
+
+ .panel.alwaysVisible {
+ display: inherit !important;
+ }
+
+ .error #inputs {
+ background-color: var(--error-color);
+ }
+
table {
display: table;
border-spacing: 0px;
@@ -30,12 +47,8 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
.inline {
display: inline-block;
- vertical-align: top;
- }
-
- h2,
- h3 {
- margin-bottom: 0px;
+ vertical-align: middle;
+ margin-right: 10px;
}
.hidden {
@@ -46,6 +59,15 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
display: table;
}
+ .panel-group {
+ display: grid;
+ align-content: center;
+ grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
+ grid-auto-flow: row dense;
+ grid-gap: 10px;
+ margin-top: 10px;
+ }
+
.column {
display: table-cell;
border-right: 1px black dotted;
@@ -73,11 +95,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
.list tr:nth-child(even) {
- background-color: #EFEFEF;
- }
-
- .list tr:nth-child(even).selected {
- background-color: #DDD;
+ background-color: rgba(0.5, 0.5, 0.5, 0.1);
}
.list tr.child {
@@ -100,23 +118,17 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
font-weight: bold
}
- .list tr.parent {
- background-color: #FFF;
- }
-
- .list tr.parent.selected {
- background-color: #DDD;
- }
-
+ .list tr.parent.selected,
+ .list tr:nth-child(even).selected,
tr.selected {
- background-color: #DDD;
+ background-color: rgba(0.5, 0.5, 0.5, 0.1);
}
.codeSearch {
display: block-inline;
float: right;
border-radius: 5px;
- background-color: #EEE;
+ background-color: #333;
width: 1em;
text-align: center;
}
@@ -155,10 +167,6 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
width: auto;
}
- .compareSelector {
- padding-bottom: 20px;
- }
-
.pageDetailTable tbody {
cursor: pointer
}
@@ -173,7 +181,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
box-shadow: -2px 10px 44px -10px #000;
border-radius: 5px;
z-index: 1;
- background-color: #FFF;
+ background-color: var(--surface-color);
display: none;
white-space: nowrap;
}
@@ -184,13 +192,14 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
text-align: right;
margin: 10px;
}
+
#popover td {
padding: 3px 0px 3px 5px;
white-space: nowrap;
}
.popoverArrow {
- background-color: #FFF;
+ background-color: var(--surface-color);
position: absolute;
width: 30px;
height: 30px;
@@ -218,14 +227,11 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
#popover .compare .version {
padding-left: 10px;
}
- .graph,
- .graph .content {
- width: 100%;
- }
.diff .hideDiff {
display: none;
}
+
.noDiff .hideNoDiff {
display: none;
}
@@ -233,11 +239,13 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
<script src="https://www.gstatic.com/charts/loader.js"></script>
<script>
"use strict"
- google.charts.load('current', {packages: ['corechart']});
+ google.charts.load('current', {
+ packages: ['corechart']
+ });
// Did anybody say monkeypatching?
if (!NodeList.prototype.forEach) {
- NodeList.prototype.forEach = function(func) {
+ NodeList.prototype.forEach = function (func) {
for (let i = 0; i < this.length; i++) {
func(this[i]);
}
@@ -249,17 +257,18 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
let selectedPage;
let baselineVersion;
let selectedEntry;
+ let sortByLabel = false;
// Marker to programatically replace the defaultData.
- let defaultData = /*default-data-start*/undefined/*default-data-end*/;
+ let defaultData = /*default-data-start*/ undefined /*default-data-end*/;
function initialize() {
// Initialize the stats table and toggle lists.
let original = $("column");
- let view = document.createElement('div');
- view.id = 'view';
+ let viewBody = $("view").querySelector('.panelBody');
+ removeAllChildren(viewBody);
let i = 0;
- versions.forEach((version) => {
+ versions.forEach((version) => {
if (!version.enabled) return;
// add column
let column = original.cloneNode(true);
@@ -292,11 +301,9 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
});
select.appendChild(optgroup);
});
- view.appendChild(column);
+ viewBody.appendChild(column);
i++;
});
- let oldView = $('view');
- oldView.parentNode.replaceChild(view, oldView);
let select = $('baseline');
removeAllChildren(select);
@@ -310,7 +317,6 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
initializeToggleList(versions.versions, $('versionSelector'));
initializeToggleList(pages.values(), $('pageSelector'));
initializeToggleList(Group.groups.values(), $('groupSelector'));
- initializeToggleContentVisibility();
}
function initializeToggleList(items, node) {
@@ -329,25 +335,6 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
li.appendChild(document.createTextNode(item.name));
list.appendChild(li);
});
- $('results').querySelectorAll('#results > .hidden').forEach((node) => {
- toggleCssClass(node, 'hidden', false);
- })
- }
-
- function initializeToggleContentVisibility() {
- let nodes = document.querySelectorAll('.toggleContentVisibility');
- nodes.forEach((node) => {
- let content = node.querySelector('.content');
- let header = node.querySelector('h1,h2,h3');
- if (content === undefined || header === undefined) return;
- if (header.querySelector('input') != undefined) return;
- let checkbox = document.createElement('input');
- checkbox.type = 'checkbox';
- checkbox.checked = content.className.indexOf('hidden') == -1;
- checkbox.contentNode = content;
- checkbox.addEventListener('click', handleToggleContentVisibility);
- header.insertBefore(checkbox, header.childNodes[0]);
- });
}
window.addEventListener('popstate', (event) => {
@@ -382,8 +369,8 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
if (JSON.stringify(window.history.state) === JSON.stringify(state)) return;
let params = "?";
for (let pairs of Object.entries(state)) {
- params += encodeURIComponent(pairs[0]) + "="
- + encodeURIComponent(pairs[1]) + "&";
+ params += encodeURIComponent(pairs[0]) + "=" +
+ encodeURIComponent(pairs[1]) + "&";
}
window.history.pushState(state, selection.toString(), params);
}
@@ -396,8 +383,8 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
function showPage(firstPage) {
- let changeSelectedEntry = selectedEntry !== undefined
- && selectedEntry.page === selectedPage;
+ let changeSelectedEntry = selectedEntry !== undefined &&
+ selectedEntry.page === selectedPage;
selectedPage = firstPage;
selectedPage.sort();
showPageInColumn(firstPage, 0);
@@ -417,30 +404,42 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
pushHistoryState();
}
+ function clamp(value, min, max) {
+ if (value < min) return min;
+ if (value > max) return max;
+ return value;
+ }
+
+ function diffColorFromRatio(ratio) {
+ if (ratio > 1) {
+ // ratio > 1: #FFFFFF => #00FF00
+ const red = clamp(((ratio - 1) * 255 * 10) | 0, 0, 255);
+ const other = (255 - red).toString(16).padStart(2, '0');
+ return `#ff${other}${other}`;
+ }
+ // ratio < 1: #FF0000 => #FFFFFF
+ const green = clamp(((1 - ratio) * 255 * 10) | 0, 0, 255);
+ const other = (255 - green).toString(16).padStart(2, '0');
+ return `#${other}ff${other}`;
+ }
+
function showPageInColumn(page, columnIndex) {
page.sort();
- let showDiff = (baselineVersion === undefined && columnIndex !== 0) ||
- (baselineVersion !== undefined && page.version !== baselineVersion);
- let diffStatus = (td, a, b) => {};
+ let showDiff = columnIndex !== 0;
+ if (baselineVersion) showDiff = page.version !== baselineVersion;
+ let diffColor = (td, a, b) => { };
if (showDiff) {
- if (baselineVersion !== undefined) {
- diffStatus = (td, a, b) => {
- if (a == 0) return;
- td.style.color = a < 0 ? '#FF0000' : '#00BB00';
+ if (baselineVersion) {
+ diffColor = (td, diff, baseline) => {
+ if (diff == 0) return;
+ const ratio = (baseline + diff) / baseline;
+ td.style.color = diffColorFromRatio(ratio);
};
} else {
- diffStatus = (td, a, b) => {
- if (a == b) return;
- let color;
- let ratio = a / b;
- if (ratio > 1) {
- ratio = Math.min(Math.round((ratio - 1) * 255 * 10), 200);
- color = '#' + ratio.toString(16) + "0000";
- } else {
- ratio = Math.min(Math.round((1 - ratio) * 255 * 10), 200);
- color = '#00' + ratio.toString(16) + "00";
- }
- td.style.color = color;
+ diffColor = (td, value, reference) => {
+ if (value == reference) return;
+ const ratio = value / reference;
+ td.style.color = diffColorFromRatio(ratio);
}
}
}
@@ -476,31 +475,31 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
td(tr, entry.position == 0 ? '' : entry.position, 'position');
}
addCodeSearchButton(entry,
- td(tr, entry.name, 'name ' + entry.cssClass()));
+ td(tr, entry.name, 'name ' + entry.cssClass()));
- diffStatus(
+ diffColor(
td(tr, ms(entry.time), 'value time'),
entry.time, referenceEntry.time);
- diffStatus(
+ diffColor(
td(tr, percent(entry.timePercent), 'value time'),
entry.time, referenceEntry.time);
- diffStatus(
+ diffColor(
td(tr, count(entry.count), 'value count'),
entry.count, referenceEntry.count);
- } else if (baselineVersion !== undefined && referenceEntry
- && page.version !== baselineVersion) {
+ } else if (baselineVersion !== undefined && referenceEntry &&
+ page.version !== baselineVersion) {
// Show comparison of entry that does not exist on the current page.
tr.entry = new Entry(0, referenceEntry.name);
tr.entry.page = page;
td(tr, '-', 'position');
td(tr, referenceEntry.name, 'name');
- diffStatus(
+ diffColor(
td(tr, ms(referenceEntry.time), 'value time'),
referenceEntry.time, 0);
- diffStatus(
+ diffColor(
td(tr, percent(referenceEntry.timePercent), 'value time'),
referenceEntry.timePercent, 0);
- diffStatus(
+ diffColor(
td(tr, count(referenceEntry.count), 'value count'),
referenceEntry.count, 0);
} else {
@@ -549,7 +548,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
let childNodes = $('column_0').querySelector('.list tbody').childNodes;
for (let i = 0; i < childNodes.length; i++) {
if (childNodes[i].entry !== undefined &&
- childNodes[i].entry.name == entry.name) {
+ childNodes[i].entry.name == entry.name) {
rowIndex = i;
break;
}
@@ -588,10 +587,10 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
function showVersionDetails(entry) {
let table, tbody, entries;
- table = $('detailView').querySelector('.versionDetailTable');
+ table = $('versionDetails').querySelector('.versionDetailTable');
tbody = document.createElement('tbody');
if (entry !== undefined) {
- $('detailView').querySelector('.versionDetail h3 span').textContent =
+ $('versionDetails').querySelector('h2 span').textContent =
entry.name + ' in ' + entry.page.name;
entries = versions.getPageVersions(entry.page).map(
(page) => {
@@ -618,7 +617,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
function showPageDetails(entry) {
let table, tbody, entries;
- table = $('detailView').querySelector('.pageDetailTable');
+ table = $('pageDetail').querySelector('.pageDetailTable');
tbody = document.createElement('tbody');
if (entry === undefined) {
table.replaceChild(tbody, table.querySelector('tbody'));
@@ -626,12 +625,12 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
let version = entry.page.version;
let showDiff = version !== baselineVersion;
- $('detailView').querySelector('.pageDetail h3 span').textContent =
+ $('pageDetail').querySelector('h2 span').textContent =
version.name;
entries = version.pages.map((page) => {
- if (!page.enabled) return;
- return page.get(entry.name)
- });
+ if (!page.enabled) return;
+ return page.get(entry.name)
+ });
entries.sort((a, b) => {
let cmp = b.timePercent - a.timePercent;
if (cmp.toFixed(1) == 0) return b.time - a.time;
@@ -646,7 +645,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
td(tr, ms(pageEntry.time, showDiff), 'value time');
td(tr, percent(pageEntry.timePercent, showDiff), 'value time');
td(tr, percent(pageEntry.timePercentPerEntry, showDiff),
- 'value time hideNoDiff');
+ 'value time hideNoDiff');
td(tr, count(pageEntry.count, showDiff), 'value count');
tbody.appendChild(tr);
});
@@ -661,15 +660,15 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
function showImpactList(page) {
- let impactView = $('detailView').querySelector('.impactView');
- impactView.querySelector('h3 span').textContent = page.version.name;
+ let impactView = $('impactView');
+ impactView.querySelector('h2 span').textContent = page.version.name;
let table = impactView.querySelector('table');
let tbody = document.createElement('tbody');
let version = page.version;
let entries = version.allEntries();
if (selectedEntry !== undefined && selectedEntry.isGroup) {
- impactView.querySelector('h3 span').textContent += " " + selectedEntry.name;
+ impactView.querySelector('h2 span').textContent += " " + selectedEntry.name;
entries = entries.filter((entry) => {
return entry.name == selectedEntry.name ||
(entry.parent && entry.parent.name == selectedEntry.name)
@@ -723,10 +722,10 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
// Display graphs delayed for a snappier UI.
setTimeout(() => {
- showPageVersionGraph(groups, page);
- showPageGraph(groups, page);
- showVersionGraph(groups, page)
- }, 10);
+ showPageVersionGraph(groups, page);
+ showPageGraph(groups, page);
+ showVersionGraph(groups, page);
+ }, 10);
}
function getGraphDataTable(groups, page) {
@@ -735,12 +734,16 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
groups.forEach(group => {
let column = dataTable.addColumn('number', group.name.substring(6));
dataTable.setColumnProperty(column, 'group', group);
- column = dataTable.addColumn({role: "annotation"});
+ column = dataTable.addColumn({
+ role: "annotation"
+ });
dataTable.setColumnProperty(column, 'group', group);
});
let column = dataTable.addColumn('number', 'Chart Total');
dataTable.setColumnProperty(column, 'group', page.total);
- column = dataTable.addColumn({role: "annotation"});
+ column = dataTable.addColumn({
+ role: "annotation"
+ });
dataTable.setColumnProperty(column, 'group', page.total);
return dataTable;
}
@@ -749,17 +752,17 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
class ChartRow {
static kSortFirstValueRelative(chartRow) {
- if (selectedGroup?.isTotal) return chartRow.total
+ if (selectedGroup?.isTotal) return chartRow.total;
return chartRow.data[0] / chartRow.total;
}
static kSortByFirstValue(chartRow) {
- if (selectedGroup?.isTotal) return chartRow.total
+ if (selectedGroup?.isTotal) return chartRow.total;
return chartRow.data[0];
}
constructor(linkedPage, label, sortValue_fn, data,
- excludeFromAverage=false) {
+ excludeFromAverage = false) {
this.linkedPage = linkedPage;
this.label = label;
if (!Array.isArray(data)) {
@@ -783,7 +786,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
const value = this.data[i];
let label = '';
// Only show labels for entries that are large enough..
- if (Math.abs(value / maxRowsTotal) * chartWidth > kMinLabelWidth) {
+ if (Math.abs(value / maxRowsTotal) * chartWidth > kMinLabelWidth) {
label = ms(value);
}
rowData.push(value, label);
@@ -794,11 +797,16 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return rowData;
}
}
+ const collator = new Intl.Collator('en-UK');
function setDataTableRows(dataTable, rows) {
let skippedRows = 0;
// Always sort by the selected entry (first column after the label)
- rows.sort((a,b) => b.sortValue - a.sortValue);
+ if (sortByLabel) {
+ rows.sort((a, b) => collator.compare(a.label, b.label));
+ } else {
+ rows.sort((a, b) => b.sortValue - a.sortValue);
+ }
// Aggregate row data for Average/SUM chart entry:
const aggregateData = rows[0].data.slice().fill(0);
let maxTotal = 0;
@@ -820,7 +828,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
aggregateData[i] /= rows.length;
}
const averageRow = new ChartRow(undefined, 'Average',
- ChartRow.kSortByFirstValue, aggregateData);
+ ChartRow.kSortByFirstValue, aggregateData);
dataTable.addRow(averageRow.forDataTable());
rows.forEach(chartRow => {
@@ -834,11 +842,11 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
let vs = versions.getPageVersions(page);
// Calculate the entries for the versions
const rows = vs.map(page => new ChartRow(
- page, page.version.name, ChartRow.kSortByFirstValue,
- groups.map(group => page.getEntry(group).time),
- page.version === baselineVersion));
+ page, page.version.name, ChartRow.kSortByFirstValue,
+ groups.map(group => page.getEntry(group).time),
+ page.version === baselineVersion));
renderGraph(`Versions for ${page.name}`, groups, dataTable, rows,
- 'pageVersionGraph', true);
+ 'pageVersionGraph', true);
}
function showPageGraph(groups, page) {
@@ -849,12 +857,12 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
let pages = page.version.pages.filter(page => page.enabled);
// Calculate the entries for the pages
const rows = pages.map(page => new ChartRow(
- page, page.name,
- isDiffView ?
- ChartRow.kSortByFirstValue : ChartRow.kSortFirstValueRelative,
- groups.map(group => page.getEntry(group).time)));
+ page, page.name,
+ isDiffView ?
+ ChartRow.kSortByFirstValue : ChartRow.kSortFirstValueRelative,
+ groups.map(group => page.getEntry(group).time)));
renderGraph(`Pages for ${page.version.name}`, groups, dataTable, rows,
- 'pageGraph', isDiffView ? true : 'percent');
+ 'pageGraph', isDiffView ? true : 'percent');
}
function showVersionGraph(groups, page) {
@@ -862,11 +870,11 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
let vs = versions.versions.filter(version => version.enabled);
// Calculate the entries for the versions
const rows = vs.map((version) => new ChartRow(
- version.get(page), version.name, ChartRow.kSortByFirstValue,
- groups.map(group => version.getEntry(group).getTimeImpact()),
- version === baselineVersion));
+ version.get(page), version.name, ChartRow.kSortByFirstValue,
+ groups.map(group => version.getEntry(group).getTimeImpact()),
+ version === baselineVersion));
renderGraph('Versions Total Time over all Pages', groups, dataTable, rows,
- 'versionGraph', true);
+ 'versionGraph', true);
}
function renderGraph(title, groups, dataTable, rows, id, isStacked) {
@@ -886,24 +894,49 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
height: height,
hAxis: {
minValue: 0,
- textStyle: { fontSize: 14 }
+ textStyle: {
+ fontSize: 14
+ }
},
vAxis: {
- textStyle: { fontSize: 14 }
+ textStyle: {
+ fontSize: 14
+ }
+ },
+ tooltip: {
+ textStyle: {
+ fontSize: 14
+ }
+ },
+ annotations: {
+ textStyle: {
+ fontSize: 8
+ }
},
- tooltip: { textStyle: { fontSize: 14 }},
- annotations: { textStyle: { fontSize: 8 }},
explorer: {
actions: ['dragToZoom', 'rightClickToReset'],
maxZoomIn: 0.01
},
- legend: {position:'top', maxLines: 3, textStyle: { fontSize: 12 }},
- chartArea: {left:200, top:50 },
- colors: [...groups.map(each => each.color), /* Chart Total */ "#000000"]
+ legend: {
+ position: 'top',
+ maxLines: 3,
+ textStyle: {
+ fontSize: 12
+ }
+ },
+ chartArea: {
+ left: 200,
+ top: 50
+ },
+ colors: [
+ ...groups.map(each => each.color),
+ /* Chart Total */
+ "#000000",
+ ]
};
let parentNode = $(id);
parentNode.querySelector('h2>span, h3>span').textContent = title;
- let graphNode = parentNode.querySelector('.content');
+ let graphNode = parentNode.querySelector('.panelBody');
let chart = graphNode.chart;
if (chart === undefined) {
@@ -912,6 +945,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
google.visualization.events.removeAllListeners(chart);
}
google.visualization.events.addListener(chart, 'select', selectHandler);
+
function getChartEntry(selection) {
if (!selection) return undefined;
let column = selection.column;
@@ -923,16 +957,27 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
if (!page) return selectedGroup;
return page.getEntry(selectedGroup);
}
+
function selectHandler(e) {
- selectedGroup = getChartEntry(chart.getSelection()[0])
- if (!selectedGroup) return;
+ const newSelectedGroup = getChartEntry(chart.getSelection()[0]);
+ if (newSelectedGroup == selectedGroup) {
+ sortByLabel = !sortByLabel;
+ } else if (newSelectedGroup === undefined && selectedPage) {
+ sortByLabel = true;
+ return showGraphs(selectedPage);
+ } else {
+ sortByLabel = false;
+ }
+ selectedGroup = newSelectedGroup;
selectEntry(selectedGroup, true);
}
// Make our global tooltips work
google.visualization.events.addListener(chart, 'onmouseover', mouseOverHandler);
+
function mouseOverHandler(selection) {
- graphNode.entry = getChartEntry(selection);
+ const selectedGroup = getChartEntry(selection);
+ graphNode.entry = selectedGroup;
}
chart.draw(dataTable, options);
}
@@ -971,33 +1016,27 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
node('.timeVariance').textContent = '-';
node('.percent').textContent = '-';
node('.percentPerEntry').textContent = '-';
- node('.percentVariance').textContent = '-';
- node('.count').textContent = '-';
+ node('.percentVariance').textContent = '-';
+ node('.count').textContent = '-';
node('.countVariance').textContent = '-';
node('.timeImpact').textContent = '-';
node('.timePercentImpact').textContent = '-';
} else {
node('.version').textContent = entry.page.version.name;
node('.time').textContent = ms(entry._time, false);
- node('.timeVariance').textContent
- = percent(entry.timeVariancePercent, false);
+ node('.timeVariance').textContent = percent(entry.timeVariancePercent, false);
node('.percent').textContent = percent(entry.timePercent, false);
- node('.percentPerEntry').textContent
- = percent(entry.timePercentPerEntry, false);
- node('.percentVariance').textContent
- = percent(entry.timePercentVariancePercent, false);
+ node('.percentPerEntry').textContent = percent(entry.timePercentPerEntry, false);
+ node('.percentVariance').textContent = percent(entry.timePercentVariancePercent, false);
node('.count').textContent = count(entry._count, false);
- node('.countVariance').textContent
- = percent(entry.timeVariancePercent, false);
- node('.timeImpact').textContent
- = ms(entry.getTimeImpact(false), false);
- node('.timePercentImpact').textContent
- = percent(entry.getTimeImpactVariancePercent(false), false);
+ node('.countVariance').textContent = percent(entry.timeVariancePercent, false);
+ node('.timeImpact').textContent = ms(entry.getTimeImpact(false), false);
+ node('.timePercentImpact').textContent = percent(entry.getTimeImpactVariancePercent(false), false);
}
}
</script>
<script>
- "use strict"
+ "use strict"
// =========================================================================
// Helpers
function $(id) {
@@ -1053,7 +1092,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return -1;
}
- function toggleCssClass(node, cssClass, toggleState) {
+ function toggleCssClass(node, cssClass, toggleState = true) {
let index = -1;
let classes;
if (node.className != undefined) {
@@ -1095,28 +1134,45 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
function percent(value, showDiff) {
return diffSign(value, 1, '%', showDiff);
}
-
</script>
<script>
- "use strict"
+ "use strict"
// =========================================================================
// EventHandlers
- function handleBodyLoad() {
+ async function handleBodyLoad() {
$('uploadInput').focus();
- if (defaultData) return handleLoadJSON(defaultData);
- if (tryLoadFromURLParams()) return;
- if (window.location.protocol !== 'file:') return tryLoadDefaultResults();
+ if (tryLoadDefaultData() || await tryLoadFromURLParams() ||
+ await tryLoadDefaultResults()) {
+ displayResultsAfterLoading();
+ }
+ }
+
+ function tryLoadDefaultData() {
+ if (!defaultData) return false;
+ handleLoadJSON(defaultData);
+ return true;
+ }
+
+ async function tryLoadFromURLParams() {
+ let params = new URLSearchParams(document.location.search);
+ let hasFile = false;
+ params.forEach(async (value, key) => {
+ if (key !== 'file') return;
+ hasFile ||= await tryLoadFile(value, true);
+ });
+ return hasFile;
}
async function tryLoadDefaultResults() {
- // Try to load a results.json file adjacent to this day.
- // The markers on the following line can be used to replace the url easily
- // with scripts.
- const url = /*results-url-start*/'results.json'/*results-url-end*/;
- tryLoadFile(url);
+ if (window.location.protocol === 'file:') return false;
+ // Try to load a results.json file adjacent to this day.
+ // The markers on the following line can be used to replace the url easily
+ // with scripts.
+ const url = /*results-url-start*/ 'results.json' /*results-url-end*/;
+ return tryLoadFile(url);
}
- async function tryLoadFile(url, append=false) {
+ async function tryLoadFile(url, append = false) {
if (!url.startsWith('http')) {
// hack to get relative urls
let location = window.location;
@@ -1126,19 +1182,9 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
let response = await fetch(url);
if (!response.ok) return false;
let filename = url.split('/');
- filename = filename[filename.length-1];
+ filename = filename[filename.length - 1];
handleLoadText(await response.text(), append, filename);
- }
-
- async function tryLoadFromURLParams() {
- let params = new URLSearchParams(document.location.search);
- let hasFile = false;
- params.forEach((value, key) => {
- if (key !== 'file') return;
- hasFile = true;
- tryLoadFile(value, true);
- });
- return hasFile;
+ return true;
}
function handleAppendFiles() {
@@ -1146,7 +1192,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
loadFiles(files, true);
}
- function handleLoadFile() {
+ function handleLoadFiles() {
let files = document.getElementById("uploadInput").files;
loadFiles(files, false)
}
@@ -1161,20 +1207,24 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
reader.readAsText(file);
});
handleLoadText(text, append, file.name);
+ // Only the first file might clear existing data, all sequent files
+ // are always append.
+ append = true;
}
+ displayResultsAfterLoading();
+ toggleCssClass(document.body, "loaded");
}
function handleLoadText(text, append, fileName) {
if (fileName.endsWith('.json')) {
handleLoadJSON(JSON.parse(text), append, fileName);
} else if (fileName.endsWith('.csv') ||
- fileName.endsWith('.output') || fileName.endsWith('.output.txt')) {
+ fileName.endsWith('.output') || fileName.endsWith('.output.txt')) {
handleLoadCSV(text, append, fileName);
} else if (fileName.endsWith('.txt')) {
handleLoadTXT(text, append, fileName);
} else {
- alert(`Error parsing "${fileName}"`);
- console.error(e);
+ alert(`Unsupported file extension: "${fileName}"`);
}
}
@@ -1195,7 +1245,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
json = fixSingleVersionJSON(json, fileName);
let isFirstLoad = pages === undefined;
if (append && !isFirstLoad) {
- json = createUniqueVersions(json)
+ json = createUniqueVersions(json);
}
if (!append || isFirstLoad) {
pages = new Pages();
@@ -1203,7 +1253,6 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
} else {
Versions.fromJSON(json).forEach(e => versions.add(e))
}
- displayResultsAfterLoading(isFirstLoad)
}
function handleLoadCSV(csv, append, fileName) {
@@ -1219,25 +1268,23 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
fields.set(name, index);
});
if (fields.has('displayLabel') && fields.has('stories')) {
- handleLoadResultCSV(fields, lines, fileName)
+ handleLoadResultCSV(fields, lines);
} else if (fields.has('page_name')) {
- handleLoadClusterTelemetryCSV(fields, lines, fileName)
+ handleLoadClusterTelemetryCSV(fields, lines, fileName);
} else {
return alert("Unknown CSV format");
}
- displayResultsAfterLoading(isFirstLoad)
}
-
function csvSplit(line) {
let fields = [];
let index = 0;
while (index < line.length) {
let lastIndex = index;
if (line[lastIndex] == '"') {
- index = line.indexOf('"', lastIndex+1);
+ index = line.indexOf('"', lastIndex + 1);
if (index < 0) index = line.length;
- fields.push(line.substring(lastIndex+1, index));
+ fields.push(line.substring(lastIndex + 1, index));
// Consume ','
index++;
} else {
@@ -1251,16 +1298,25 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return fields;
}
+ // Ignore the following categories as they are aggregated values and are
+ // created by callstats.html on the fly.
+ const import_skip_categories = new Set([
+ 'V8-Only', 'V8-Only-Main-Thread', 'Total-Main-Thread', 'Blink_Total'
+ ])
+
function handleLoadClusterTelemetryCSV(fields, lines, fileName) {
const rscFields = Array.from(fields.keys())
- .filter(field => field.endsWith(':duration (ms)'))
+ .filter(field => {
+ return field.endsWith(':duration (ms)') &&
+ !import_skip_categories.has(field.split(':')[0])
+ })
.map(field => {
let name = field.split(':')[0];
return [name, fields.get(field), fields.get(`${name}:count`)];
})
const page_name_i = fields.get('page_name');
const version = versions.getOrCreate(fileName);
- for (let i=1; i<lines.length; i++) {
+ for (let i = 1; i < lines.length; i++) {
const line = csvSplit(lines[i]);
if (line.length == 0) continue;
let page_name = line[page_name_i];
@@ -1271,35 +1327,31 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
const duration = Number.parseFloat(line[duration_i]);
const count = Number.parseFloat(line[count_i]);
// Skip over entries without metrics (most likely crashes)
- if (Number.isNaN(count)|| Number.isNaN(duration)) {
+ if (Number.isNaN(count) || Number.isNaN(duration)) {
console.warn(`BROKEN ${page_name}`, lines[i])
break;
}
- pageVersion.add(new Entry(0, fieldName, duration, 0, 0, count, 0 ,0))
+ pageVersion.add(new Entry(0, fieldName, duration, 0, 0, count, 0, 0))
}
}
}
- function handleLoadResultCSV(fields, lines, fileName) {
+ function handleLoadResultCSV(fields, lines) {
const version_i = fields.get('displayLabel');
const page_i = fields.get('stories');
const category_i = fields.get('name');
const value_i = fields.get('avg');
- // Ignore the following categories as they are aggregated values and are
- // created by callstats.html on the fly.
- const skip_categories = new Set([
- 'V8-Only', 'V8-Only-Main-Thread', 'Total-Main-Thread', 'Blink_Total'])
const tempEntriesCache = new Map();
- for (let i=1; i<lines.length; i++) {
+ for (let i = 1; i < lines.length; i++) {
const line = csvSplit(lines[i]);
if (line.length == 0) continue;
const raw_category = line[category_i];
if (!raw_category.endsWith(':duration') &&
- !raw_category.endsWith(':count')) {
+ !raw_category.endsWith(':count')) {
continue;
}
let [category, type] = raw_category.split(':');
- if (skip_categories.has(category)) continue;
+ if (import_skip_categories.has(category)) continue;
const version = versions.getOrCreate(line[version_i]);
const pageVersion = version.getOrCreate(line[page_i]);
const value = Number.parseFloat(line[value_i]);
@@ -1331,7 +1383,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
tempEntries = new Map();
cache.set(pageVersion, tempEntries);
}
- let tempEntry = tempEntries.get(category);
+ let tempEntry = tempEntries.get(category);
if (tempEntry === undefined) {
tempEntry = new TempEntry(category);
tempEntries.set(category, tempEntry);
@@ -1343,7 +1395,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
const [duration, durationStddev] = this.stats(this.durations);
const [count, countStddev] = this.stats(this.durations);
return new Entry(0, this.category,
- duration, durationStddev, 0, count, countStddev, 0)
+ duration, durationStddev, 0, count, countStddev, 0)
}
stats(values) {
@@ -1363,6 +1415,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
function handleLoadTXT(txt, append, fileName) {
+ fileName = window.prompt('Version name:', fileName);
let isFirstLoad = pages === undefined;
// Load raw RCS output which contains a single page
if (!append || isFirstLoad) {
@@ -1370,11 +1423,11 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
versions = new Versions()
}
versions.add(Version.fromTXT(fileName, txt));
- displayResultsAfterLoading(isFirstLoad);
}
- function displayResultsAfterLoading(isFirstLoad=true) {
+ function displayResultsAfterLoading() {
+ const isFirstLoad = pages === undefined;
let state = getStateFromParams();
initialize()
if (isFirstLoad && !popHistoryState(state) && selectedPage) {
@@ -1382,7 +1435,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return;
}
const page = versions.versions[0].pages[0]
- if (page == undefined) return;
+ if (page == undefined) return;
showPage(page);
showEntry(page.total);
}
@@ -1405,7 +1458,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
let entries = [];
let file_data = json[file_name].pairs;
for (let name in file_data) {
- if(name != "Total" && groupNames.has(name)) continue;
+ if (name != "Total" && groupNames.has(name)) continue;
let entry = file_data[name];
let count = entry.count;
let time = entry.time;
@@ -1414,38 +1467,55 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
let domain = file_name.split("/").slice(-1)[0];
result[domain] = entries;
}
- return {__proto__:null, ClusterTelemetry: result};
+ return {
+ __proto__: null,
+ ClusterTelemetry: result
+ };
}
function fixTraceImportJSON(json) {
// Fix json file that was created by converting a trace json output
if (!('telemetry-results' in json)) return json;
// { telemetry-results: { PAGE:[ { METRIC: [ COUNT TIME ], ... }, ... ]}}
- let version_data = {__proto__:null};
+ let version_data = {
+ __proto__: null
+ };
json = json["telemetry-results"];
for (let page_name in json) {
if (page_name == "placeholder") continue;
let page_data = {
- __proto__:null,
- Total: {
- duration: {average: 0, stddev: 0},
- count: {average:0, stddev: 0}
- }
- };
+ __proto__: null,
+ Total: {
+ duration: {
+ average: 0,
+ stddev: 0
+ },
+ count: {
+ average: 0,
+ stddev: 0
+ }
+ }
+ };
let page = json[page_name];
- for (let slice of page ) {
+ for (let slice of page) {
for (let metric_name in slice) {
if (metric_name == "Blink_V8") continue;
// sum up entries
if (!(metric_name in page_data)) {
page_data[metric_name] = {
- duration: {average: 0, stddev: 0},
- count: {average:0, stddev: 0}
+ duration: {
+ average: 0,
+ stddev: 0
+ },
+ count: {
+ average: 0,
+ stddev: 0
+ }
}
}
let [metric_count, metric_duration] = slice[metric_name]
let metric = page_data[metric_name];
- const kMicroToMilli = 1/1000;
+ const kMicroToMilli = 1 / 1000;
metric.duration.average += metric_duration * kMicroToMilli;
metric.count.average += metric_count;
@@ -1463,7 +1533,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
function fixSingleVersionJSON(json, name) {
// Try to detect the single-version case, where we're missing the toplevel
// version object. The incoming JSON is of the form:
- // { PAGE: ... , PAGE_2: }
+ // { PAGE: ... , PAGE_2: }
// Instead of the default multi-page JSON:
// {"Version 1": { "Page 1": ..., ...}, "Version 2": {...}, ...}
// In this case insert a single "Default" version as top-level entry.
@@ -1475,48 +1545,55 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
let tempName = name ? name : new Date().toISOString();
tempName = window.prompt('Enter a name for the loaded file:', tempName);
if ('count' in maybeMetrics && 'duration' in maybeMetrics) {
- return {[tempName]: json}
+ return {
+ [tempName]: json
+ }
}
// Legacy fallback where the metrics are encoded as arrays:
// { PAGE: [[metric_name, ...], [...], ]}
if (Array.isArray(maybeMetrics)) {
- return {[tempName]: json}
+ return {
+ [tempName]: json
+ }
}
return json
}
let appendIndex = 0;
+
function createUniqueVersions(json) {
// Make sure all toplevel entries are unique names and added properly
appendIndex++;
- let result = {__proto__:null}
+ let result = {
+ __proto__: null
+ }
for (let key in json) {
- result[key+"_"+appendIndex] = json[key];
+ result[key + "_" + appendIndex] = json[key];
}
return result
}
function handleCopyToClipboard(event) {
- const names =[ "Group", ...versions.versions.map(e=>e.name)];
- let result = [ names.join("\t") ];
+ const names = ["Group", ...versions.versions.map(e => e.name)];
+ let result = [names.join("\t")];
let groups = Array.from(Group.groups.values());
// Move the total group to the end.
groups.push(groups.shift())
groups.forEach(group => {
let row = [group.name];
versions.forEach(v => {
- const time = v.pages[0].get("Group-"+group.name)?._time ?? 0;
- row.push(time)
+ const time = v.pages[0].get("Group-" + group.name)?._time ?? 0;
+ row.push(time);
})
result.push(row.join("\t"));
});
result = result.join("\n");
- navigator.clipboard.writeText(result)
+ navigator.clipboard.writeText(result);
}
function handleToggleGroup(event) {
let group = event.target.parentNode.parentNode.entry;
- toggleGroup(selectedPage.get(group.name));
+ toggleGroup(selectedPage.get(group.name), 'toggle');
}
function handleSelectPage(select, event) {
@@ -1593,9 +1670,9 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
function handleToggleVersionOrPageEnable(event) {
- let item = this.item ;
- if (item === undefined) return;
- item .enabled = this.checked;
+ let item = this.item;
+ if (item === undefined) return;
+ item.enabled = this.checked;
initialize();
let page = selectedPage;
if (page === undefined || !page.version.enabled) {
@@ -1607,11 +1684,6 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
showPage(page);
}
- function handleToggleContentVisibility(event) {
- let content = event.target.contentNode;
- toggleCssClass(content, 'hidden');
- }
-
function handleCodeSearch(event) {
let entry = findEntry(event);
if (entry === undefined) return;
@@ -1621,11 +1693,11 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
name = name.substring(4);
}
url += encodeURIComponent(name) + "+file:src/v8/src";
- window.open(url,'_blank');
+ window.open(url, '_blank');
}
</script>
<script>
- "use strict"
+ "use strict"
// =========================================================================
class Versions {
constructor() {
@@ -1640,7 +1712,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
this.versions.forEach((version) => {
if (!version.enabled) return;
let versionPage = version.get(page.name);
- if (versionPage !== undefined) result.push(versionPage);
+ if (versionPage !== undefined) result.push(versionPage);
});
return result;
}
@@ -1654,7 +1726,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return this.versions.find((each) => each.name == name);
}
getOrCreate(name) {
- return this.getByName(name) ?? this.add(new Version(name))
+ return this.getByName(name) ?? this.add(new Version(name));
}
forEach(f) {
this.versions.forEach(f);
@@ -1704,14 +1776,14 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
get(name) {
let index = this.indexOf(name);
if (0 <= index) return this.pages[index];
- return undefined
+ return undefined;
}
getOrCreate(name) {
return this.get(name) ??
this.add(new PageVersion(this, pages.getOrCreate(name)));
}
get length() {
- return this.pages.length
+ return this.pages.length;
}
getEntry(entry) {
if (entry === undefined) return undefined;
@@ -1758,7 +1830,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
// Otherwise return the difference to the sum of the baseline version.
let baselineValue = baselineVersion.getTotalTime(name, false);
let total = this.getTotalValue(name, '_time');
- return (total / baselineValue - 1) * 100;
+ return (total / baselineValue - 1) * 100;
}
getTotalTimeVariance(name, showDiff) {
// Calculate the overall error for a given entry name
@@ -1805,8 +1877,9 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
static fromTXT(name, txt) {
let version = new Version(name);
- let pageName = "RAW DATA";
- version.add(PageVersion.fromTXT(version, pageName, txt));
+ let defaultName = "RAW DATA";
+ PageVersion.fromTXT(version, defaultName, txt)
+ .forEach(each => version.add(each));
return version;
}
}
@@ -1875,23 +1948,27 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return this.version.name + ": " + this.name;
}
urlParams() {
- return { version: this.version.name, page: this.name};
+ return {
+ version: this.version.name,
+ page: this.name
+ };
}
add(entry) {
- // Ignore accidentally added Group entries.
- if (entry.name.startsWith(GroupedEntry.prefix)) {
- console.warn("Skipping accidentally added Group entry:", entry, this);
- return;
- }
let existingEntry = this.entryDict.get(entry.name);
if (existingEntry !== undefined) {
// Duplicate entries happen when multiple runs are combined into a
// single file.
existingEntry.add(entry);
- for (let group of this.groups) {
+ for (let i = 0; i < this.groups.length; i++) {
+ const group = this.groups[i];
if (group.addTimeAndCount(entry)) return;
}
} else {
+ // Ignore accidentally added Group entries.
+ if (entry.name.startsWith(GroupedEntry.prefix)) {
+ console.warn("Skipping accidentally added Group entry:", entry, this);
+ return;
+ }
entry.page = this;
this.entryDict.set(entry.name, entry);
for (let group of this.groups) {
@@ -1910,8 +1987,12 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
get length() {
return this.versions.length
}
- get name() { return this.page.name }
- get enabled() { return this.page.enabled }
+ get name() {
+ return this.page.name
+ }
+ get enabled() {
+ return this.page.enabled
+ }
forEachSorted(referencePage, func) {
// Iterate over all the entries in the order they appear on the
// reference page.
@@ -1946,7 +2027,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
this.groups.forEach(group => {
if (group == this.total) return;
let value = group.getTimePercentImpact() -
- this.getEntry(group).timePercent;
+ this.getEntry(group).timePercent;
sum += value * value;
});
return sum;
@@ -1974,28 +2055,43 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return page
}
- static fromTXT(version, name, txt) {
- let pageVersion = new PageVersion(version, pages.get(name));
- let lines = txt.split('\n');
- let split = / +/g
- // Skip the first two lines (HEADER and SEPARATOR)
- for (let i = 2; i < lines.length; i++) {
- let line = lines[i].trim().split(split)
- // Skip header lines
- if (lines[i].startsWith("======")) continue;
- if (lines[i+1]?.startsWith("======")) continue;
- if (line.length != 5) continue;
- let position = i-2;
- pageVersion.add(Entry.fromTXT(position, line));
+ static fromTXT(version, defaultName, txt) {
+ const kPageNameIdentifier = "== Page:";
+ const kCommentStart = "=="
+ const lines = txt.split('\n');
+ const split = / +/g
+ const result = [];
+ let pageVersion = undefined;
+ for (let i = 0; i < lines.length; i++) {
+ const line = lines[i];
+ // Skip header separators
+ if (line.startsWith(kCommentStart)) {
+ // Check for page names
+ if (line.startsWith(kPageNameIdentifier)) {
+ const name = line.split(kPageNameIdentifier)[1];
+ pageVersion = new PageVersion(version, pages.get(name));
+ result.push(pageVersion);
+ }
+ }
+ // Skip header lines.
+ if (lines[i + 1]?.startsWith(kCommentStart)) continue;
+ const split_line = line.trim().split(split)
+ if (split_line.length != 5) continue;
+ if (pageVersion === undefined) {
+ pageVersion = new PageVersion(version, pages.get(defaultName));
+ result.push(pageVersion);
+ }
+ const position = i - 2;
+ pageVersion.add(Entry.fromTXT(position, split_line));
}
- return pageVersion;
+ return result;
}
}
class Entry {
constructor(position, name, time, timeVariance, timeVariancePercent,
- count, countVariance, countVariancePercent) {
+ count, countVariance, countVariancePercent) {
this.position = position;
this.name = name;
this._time = time;
@@ -2017,7 +2113,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
add(entry) {
- if (this.name != entry.name) {
+ if (this.name !== entry.name) {
console.error("Should not combine entries with different names");
return;
}
@@ -2085,13 +2181,13 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return this.page.version.getPagesByPercentImpact(this.name);
}
get isGroup() {
- return false
+ return false;
}
get timeVariance() {
- return this._timeVariance
+ return this._timeVariance;
}
get timeVariancePercent() {
- return this._timeVariancePercent
+ return this._timeVariancePercent;
}
static fromLegacyJSON(position, data) {
@@ -2102,14 +2198,21 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
let time = data.duration;
let count = data.count;
return new Entry(position, name, time.average, time.stddev, 0,
- count.average, count.stddev, 0);
+ count.average, count.stddev, 0);
}
static fromTXT(position, splitLine) {
- let [name, time, timePercent, count, countPercent] = splitLine;
- time = time.split('ms')
- let timeDeviation = 0, countDeviation = 0;
- let timeDeviationPercent = 0, countDeviationPercent = 0
+ const name = splitLine[0];
+ let time = splitLine[1];
+ const msIndex = time.indexOf('m');
+ if (msIndex > 0) time = time.substring(0, msIndex);
+ const timePercent = splitLine[2];
+ const count = splitLine[3];
+ const countPercent = splitLine[4];
+ const timeDeviation = 0;
+ const countDeviation = 0;
+ const timeDeviationPercent = 0;
+ const countDeviationPercent = 0
return new Entry(position, name,
Number.parseFloat(time), timeDeviation, timeDeviationPercent,
Number.parseInt(count), countDeviation, countDeviationPercent)
@@ -2117,47 +2220,49 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
class Group {
- constructor(name, regexp, color, enabled=true, addsToTotal=true) {
+ constructor(name, regexp, color, enabled = true, addsToTotal = true) {
this.name = name;
this.regexp = regexp;
this.color = color;
this.enabled = enabled;
this.addsToTotal = addsToTotal;
}
- entry() { return new GroupedEntry(this) };
+ entry() {
+ return new GroupedEntry(this);
+ }
}
Group.groups = new Map();
- Group.add = function(name, group) {
+ Group.add = function (name, group) {
this.groups.set(name, group);
return group;
}
Group.add('total', new Group('Total', /.*Total.*/, '#BBB', true, false));
Group.add('ic', new Group('IC', /(.*IC_.*)|IC/, "#3366CC"));
Group.add('optimize-background', new Group('Optimize-Background',
- /(.*Optimize-?Background.*)/, "#702000"));
+ /.*Optimize(d?-?)(Background|Concurrent).*/, "#702000"));
Group.add('optimize', new Group('Optimize',
- /StackGuard|.*Optimize.*|.*Deoptimize.*|Recompile.*/, "#DC3912"));
+ /(StackGuard|Optimize|Deoptimize|Recompile).*/, "#DC3912"));
Group.add('compile-background', new Group('Compile-Background',
- /(.*Compile-?Background.*)/, "#b08000"));
+ /(.*Compile-?Background.*)/, "#b08000"));
Group.add('compile', new Group('Compile',
- /(^Compile.*)|(.*_Compile.*)/, "#FFAA00"));
+ /(^Compile.*)|(.*_Compile.*)/, "#FFAA00"));
Group.add('parse-background',
- new Group('Parse-Background', /.*Parse-?Background.*/, "#c05000"));
+ new Group('Parse-Background', /.*Parse-?Background.*/, "#c05000"));
Group.add('parse', new Group('Parse', /.*Parse.*/, "#FF6600"));
Group.add('callback',
- new Group('Blink C++', /.*(Callback)|(Blink C\+\+).*/, "#109618"));
+ new Group('Blink C++', /.*(Callback)|(Blink C\+\+).*/, "#109618"));
Group.add('api', new Group('API', /.*API.*/, "#990099"));
Group.add('gc-custom', new Group('GC-Custom', /GC_Custom_.*/, "#0099C6"));
Group.add('gc-background',
- new Group(
- 'GC-Background', /.*GC.*(BACKGROUND|Background).*/, "#00597c"));
+ new Group(
+ 'GC-Background', /.*GC.*(BACKGROUND|Background).*/, "#00597c"));
Group.add('gc',
- new Group('GC', /GC_.*|AllocateInTargetSpace|GC/, "#00799c"));
+ new Group('GC', /GC_.*|AllocateInTargetSpace|GC/, "#00799c"));
Group.add('javascript',
- new Group('JavaScript', /JS_Execution|JavaScript/, "#DD4477"));
+ new Group('JavaScript', /JS_Execution|JavaScript/, "#DD4477"));
Group.add('runtime', new Group('V8 C++', /.*/, "#88BB00"));
Group.add('blink',
- new Group('Blink RCS', /.*Blink_.*/, "#006600", false, false));
+ new Group('Blink RCS', /.*Blink_.*/, "#006600", false, false));
Group.add('unclassified', new Group('Unclassified', /.*/, "#000", false));
class GroupedEntry extends Entry {
@@ -2168,9 +2273,15 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
this.missingEntries = null;
this.addsToTotal = group.addsToTotal;
}
- get regexp() { return this.group.regexp }
- get color() { return this.group.color }
- get enabled() { return this.group.enabled }
+ get regexp() {
+ return this.group.regexp;
+ }
+ get color() {
+ return this.group.color;
+ }
+ get enabled() {
+ return this.group.enabled;
+ }
add(entry) {
if (!this.addTimeAndCount(entry)) return;
// TODO: sum up variance
@@ -2197,7 +2308,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
}
});
- this.missingEntries = [];
+ this.missingEntries = [];
for (let name of dummyEntryNames) {
let tmpEntry = new Entry(0, name, 0, 0, 0, 0, 0, 0);
tmpEntry.page = this.page;
@@ -2241,7 +2352,7 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
}
get timeVariancePercent() {
if (this._time == 0) return 0;
- return this.getVarianceForProperty('time') / this._time * 100
+ return this.getVarianceForProperty('time') / this._time * 100
}
get timeVariance() {
return this.getVarianceForProperty('time')
@@ -2294,199 +2405,235 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
<body id="body" onmousemove="handleUpdatePopover(event)" onload="handleBodyLoad()" class="noDiff">
<h1>Runtime Stats Komparator</h1>
- <div id="results">
- <div class="inline">
- <h2>Data</h2>
- <form name="fileForm">
- <p>
- <label for="uploadInput">Load File:</label>
- <input id="uploadInput" type="file" name="files" onchange="handleLoadFile();" accept=".json,.txt,.csv,.output">
+ <section id="inputs" class="panel alwaysVisible">
+ <input type="checkbox" id="inputsCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="inputsCheckbox">â–¼</label>
+ <h2>Input/Output</h2>
+ <div class="panelBody">
+ <form name="fileForm" class="inline">
+ <p class="inline">
+ <label for="uploadInput">Load Files:</label>
+ <input id="uploadInput" type="file" name="files" onchange="handleLoadFiles();" multiple
+ accept=".json,.txt,.csv,.output">
</p>
- <p>
+ <p class="inline">
<label for="appendInput">Append Files:</label>
- <input id="appendInput" type="file" name="files" onchange="handleAppendFiles();" multiple accept=".json,.txt,.csv,.output">
+ <input id="appendInput" type="file" name="files" onchange="handleAppendFiles();" multiple
+ accept=".json,.txt,.csv,.output">
</p>
</form>
- <p>
+ <p class="inline">
<button onclick="handleCopyToClipboard()">Copy Table to Clipboard</button>
</p>
</div>
-
- <div class="inline hidden">
- <h2>Result</h2>
- <div class="compareSelector inline">
- Compare against:&nbsp;<select id="baseline" onchange="handleSelectBaseline(this, event)"></select><br/>
- <span style="color: #060">Green</span> the selected version above performs
- better on this measurement.
- </div>
+ </section>
+
+ <section class="panel">
+ <h2>Baseline Selector</h2>
+ <div class="panel-body">
+ Compare against baseline:&nbsp;<select id="baseline" onchange="handleSelectBaseline(this, event)"></select><br />
+ <span style="color: #060">Green</span> a selected version performs
+ better than the baseline.
</div>
-
- <div id="versionSelector" class="inline toggleContentVisibility">
- <h2>Versions</h2>
- <div class="content hidden">
+ </section>
+
+ <section class="panel-group">
+ <div id="versionSelector" class="panel">
+ <input type="checkbox" checked id="versionSelectorCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="versionSelectorCheckbox">â–¼</label>
+ <h2>Selected Versions</h2>
+ <div class="panelBody">
<ul></ul>
</div>
</div>
- <div id="pageSelector" class="inline toggleContentVisibility">
- <h2>Pages</h2>
- <div class="content hidden">
+ <div id="pageSelector" class="panel">
+ <input type="checkbox" checked id="pageSelectorCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="pageSelectorCheckbox">â–¼</label>
+ <h2>Selected Pages</h2>
+ <div class="panelBody">
<ul></ul>
</div>
</div>
- <div id="groupSelector" class="inline toggleContentVisibility">
- <h2>Groups</h2>
- <div class="content hidden">
+ <div id="groupSelector" class="panel">
+ <input type="checkbox" checked id="groupSelectorCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="groupSelectorCheckbox">â–¼</label>
+ <h2>Selected RCS Groups</h2>
+ <div class="panelBody">
<ul></ul>
</div>
</div>
-
- <div id="view">
+ </section>
+
+ <section id="view" class="panel">
+ <input type="checkbox" id="tableViewCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="tableViewCheckbox">â–¼</label>
+ <h2>RCS Table</h2>
+ <div class="panelBody"></div>
+ </section>
+
+ <section class="panel-group">
+ <div id="versionDetails" class="panel">
+ <input type="checkbox" checked id="versionDetailCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="versionDetailCheckbox">â–¼</label>
+ <h2><span>Compare Page Versions</span></h2>
+ <div class="conten panelBody">
+ <table class="versionDetailTable" onclick="handleSelectDetailRow(this, event);">
+ <thead>
+ <tr>
+ <th class="version">Version&nbsp;</th>
+ <th class="position">Pos.&nbsp;</th>
+ <th class="value time">Timeâ–´&nbsp;</th>
+ <th class="value time">Percent&nbsp;</th>
+ <th class="value count">Count&nbsp;</th>
+ </tr>
+ </thead>
+ <tbody></tbody>
+ </table>
+ </div>
</div>
- <div id="detailView" class="hidden">
- <div class="versionDetail inline toggleContentVisibility">
- <h3><span></span></h3>
- <div class="content">
- <table class="versionDetailTable" onclick="handleSelectDetailRow(this, event);">
- <thead>
- <tr>
- <th class="version">Version&nbsp;</th>
- <th class="position">Pos.&nbsp;</th>
- <th class="value time">Timeâ–´&nbsp;</th>
- <th class="value time">Percent&nbsp;</th>
- <th class="value count">Count&nbsp;</th>
- </tr>
- </thead>
- <tbody></tbody>
- </table>
- </div>
- </div>
- <div class="pageDetail inline toggleContentVisibility">
- <h3>Page Comparison for <span></span></h3>
- <div class="content">
- <table class="pageDetailTable" onclick="handleSelectDetailRow(this, event);">
- <thead>
- <tr>
- <th class="page">Page&nbsp;</th>
- <th class="value time">Time&nbsp;</th>
- <th class="value time">Percentâ–¾&nbsp;</th>
- <th class="value time hideNoDiff">%/Entry&nbsp;</th>
- <th class="value count">Count&nbsp;</th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <td class="page">Total:</td>
- <td class="value time"></td>
- <td class="value time"></td>
- <td class="value time hideNoDiff"></td>
- <td class="value count"></td>
- </tr>
- </tfoot>
- <tbody></tbody>
- </table>
- </div>
- </div>
- <div class="impactView inline toggleContentVisibility">
- <h3>Impact list for <span></span></h3>
- <div class="content">
- <table class="pageDetailTable" onclick="handleSelectDetailRow(this, event);">
- <thead>
- <tr>
- <th class="page">Name&nbsp;</th>
- <th class="value time">Time&nbsp;</th>
- <th class="value time">Percentâ–¾&nbsp;</th>
- <th class="">Top Pages</th>
- </tr>
- </thead>
- <tbody></tbody>
- </table>
- </div>
+ <div id="pageDetail" class="panel">
+ <input type="checkbox" checked id="pageDetailCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="pageDetailCheckbox">â–¼</label>
+ <h2>Page Comparison for <span></span></h2>
+ <div class="panelBody">
+ <table class="pageDetailTable" onclick="handleSelectDetailRow(this, event);">
+ <thead>
+ <tr>
+ <th class="page">Page&nbsp;</th>
+ <th class="value time">Time&nbsp;</th>
+ <th class="value time">Percentâ–¾&nbsp;</th>
+ <th class="value time hideNoDiff">%/Entry&nbsp;</th>
+ <th class="value count">Count&nbsp;</th>
+ </tr>
+ </thead>
+ <tfoot>
+ <tr>
+ <td class="page">Total:</td>
+ <td class="value time"></td>
+ <td class="value time"></td>
+ <td class="value time hideNoDiff"></td>
+ <td class="value count"></td>
+ </tr>
+ </tfoot>
+ <tbody></tbody>
+ </table>
</div>
</div>
- <div id="pageVersionGraph" class="graph hidden toggleContentVisibility">
- <h3><span></span></h3>
- <div class="content"></div>
- </div>
- <div id="pageGraph" class="graph hidden toggleContentVisibility">
- <h3><span></span></h3>
- <div class="content"></div>
- </div>
- <div id="versionGraph" class="graph hidden toggleContentVisibility">
- <h3><span></span></h3>
- <div class="content"></div>
- </div>
- <div id="column" class="column">
- <div class="header">
- <select class="version" onchange="handleSelectVersion(this, event);"></select>
- <select class="pageVersion" onchange="handleSelectPage(this, event);"></select>
+ <div id="impactView" class="panel">
+ <input type="checkbox" checked id="impactViewCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="impactViewCheckbox">â–¼</label>
+ <h2>Impact list for <span></span></h2>
+ <div class="panelBody">
+ <table class="pageDetailTable" onclick="handleSelectDetailRow(this, event);">
+ <thead>
+ <tr>
+ <th class="page">Name&nbsp;</th>
+ <th class="value time">Time&nbsp;</th>
+ <th class="value time">Percentâ–¾&nbsp;</th>
+ <th class="">Top Pages</th>
+ </tr>
+ </thead>
+ <tbody></tbody>
+ </table>
</div>
- <table class="list" onclick="handleSelectRow(this, event);">
- <thead>
- <tr>
- <th class="position">Pos.&nbsp;</th>
- <th class="name">Name&nbsp;</th>
- <th class="value time">Time&nbsp;</th>
- <th class="value time">Percent&nbsp;</th>
- <th class="value count">Count&nbsp;</th>
- </tr>
- </thead>
- <tbody></tbody>
- </table>
</div>
+ </section>
+
+ <section id="pageVersionGraph" class="panel">
+ <input type="checkbox" id="pageVersionGraphCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="pageVersionGraphCheckbox">â–¼</label>
+ <h2><span></span></h2>
+ <div class="panelBody"></div>
+ </section>
+
+ <section id="pageGraph" class="panel">
+ <input type="checkbox" id="pageGraphCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="pageGraphCheckbox">â–¼</label>
+ <h2><span></span></h2>
+ <div class="panelBody"></div>
+ </section>
+
+ <section id="versionGraph" class="panel">
+ <input type="checkbox" id="versionGraphCheckbox" class="panelCloserInput">
+ <label class="panelCloserLabel" for="versionGraphCheckbox">â–¼</label>
+ <h2><span></span></h2>
+ <div class="panelBody"></div>
+ </section>
+
+ <div id="column" class="column">
+ <div class="header">
+ <select class="version" onchange="handleSelectVersion(this, event);"></select>
+ <select class="pageVersion" onchange="handleSelectPage(this, event);"></select>
+ </div>
+ <table class="list" onclick="handleSelectRow(this, event);">
+ <thead>
+ <tr>
+ <th class="position">Pos.&nbsp;</th>
+ <th class="name">Name&nbsp;</th>
+ <th class="value time">Time&nbsp;</th>
+ <th class="value time">Percent&nbsp;</th>
+ <th class="value count">Count&nbsp;</th>
+ </tr>
+ </thead>
+ <tbody></tbody>
+ </table>
</div>
- <div class="inline">
- <h2>Usage</h2>
- <ol>
- <li>Build chrome.</li>
- </ol>
- <h3>Telemetry benchmark</h3>
- <ol>
- <li>Run <code>v8.browsing</code> benchmarks:
- <pre>$CHROMIUM_DIR/tools/perf/run_benchmark run v8.browsing_desktop \
- --browser=exact --browser-executable=$CHROMIUM_DIR/out/release/chrome \
- --story-filter='.*2020 ' \
- --also-run-disabled-tests
- </pre>
- </li>
- <li>Install <a href="https://stedolan.github.io/jq/">jq</a>.</li>
- <li>Convert the telemetry JSON files to callstats JSON file:
- <pre>
- $V8_DIR/tools/callstats-from-telemetry.sh $CHROMIUM_DIR/tools/perf/artifacts/run_XXXX
- </pre>
- </li>
- <li>Load the generated <code>out.json</code></li>
- </ol>
- <h3>Merged CSV from results.html</h3>
- <ol>
- <li>Open a results.html page for RCS-enabled benchmarks</li>
- <li>Select "Export merged CSV" in the toolbar</li>
- <li>Load the downloading .csv file normally in callstats.html</li>
- </ol>
- <h3>Aggregated raw txt output</h3>
- <ol>
- <li>Install scipy, e.g. <code>sudo aptitude install python-scipy</code>
- <li>Check out a known working version of webpagereply:
- <pre>git -C $CHROME_DIR/third_party/webpagereplay checkout 7dbd94752d1cde5536ffc623a9e10a51721eff1d</pre>
- </li>
- <li>Run <code>callstats.py</code> with a web-page-replay archive:
- <pre>$V8_DIR/tools/callstats.py run \
- --replay-bin=$CHROME_SRC/third_party/webpagereplay/replay.py \
- --replay-wpr=$INPUT_DIR/top25.wpr \
- --js-flags="" \
- --with-chrome=$CHROME_SRC/out/Release/chrome \
- --sites-file=$INPUT_DIR/top25.json</pre>
- </li>
- <li>Move results file to a subdirectory: <code>mkdir $VERSION_DIR; mv *.txt $VERSION_DIR</code></li>
- <li>Repeat from step 1 with a different configuration (e.g. <code>--js-flags="--nolazy"</code>).</li>
- <li>Create the final results file: <code>./callstats.py json $VERSION_DIR1 $VERSION_DIR2 > result.json</code></li>
- <li>Use <code>results.json</code> on this site.</code>
- </ol>
- </div>
+ <section class="panel alwaysVisible">
+ <h2>Instructions</h2>
+ <div class="panelBody">
+ <ol>
+ <li>Build chrome.</li>
+ </ol>
+ <h3>Telemetry benchmark</h3>
+ <ol>
+ <li>Run <code>v8.browsing</code> benchmarks:
+ <pre>$CHROMIUM_DIR/tools/perf/run_benchmark run v8.browsing_desktop \
+ --browser=exact --browser-executable=$CHROMIUM_DIR/out/release/chrome \
+ --story-filter='.*2020 ' \
+ --also-run-disabled-tests
+ </pre>
+ </li>
+ <li>Install <a href="https://stedolan.github.io/jq/">jq</a>.</li>
+ <li>Convert the telemetry JSON files to callstats JSON file:
+ <pre>
+ $V8_DIR/tools/callstats-from-telemetry.sh $CHROMIUM_DIR/tools/perf/artifacts/run_XXXX
+ </pre>
+ </li>
+ <li>Load the generated <code>out.json</code></li>
+ </ol>
+ <h3>Merged CSV from results.html</h3>
+ <ol>
+ <li>Open a results.html page for RCS-enabled benchmarks</li>
+ <li>Select "Export merged CSV" in the toolbar</li>
+ <li>Load the downloading .csv file normally in callstats.html</li>
+ </ol>
+ <h3>Aggregated raw txt output</h3>
+ <ol>
+ <li>Install scipy, e.g. <code>sudo aptitude install python-scipy</code>
+ <li>Check out a known working version of webpagereply:
+ <pre>git -C $CHROME_DIR/third_party/webpagereplay checkout 7dbd94752d1cde5536ffc623a9e10a51721eff1d</pre>
+ </li>
+ <li>Run <code>callstats.py</code> with a web-page-replay archive:
+ <pre>$V8_DIR/tools/callstats.py run \
+ --replay-bin=$CHROME_SRC/third_party/webpagereplay/replay.py \
+ --replay-wpr=$INPUT_DIR/top25.wpr \
+ --js-flags="" \
+ --with-chrome=$CHROME_SRC/out/Release/chrome \
+ --sites-file=$INPUT_DIR/top25.json</pre>
+ </li>
+ <li>Move results file to a subdirectory: <code>mkdir $VERSION_DIR; mv *.txt $VERSION_DIR</code></li>
+ <li>Repeat from step 1 with a different configuration (e.g. <code>--js-flags="--nolazy"</code>).</li>
+ <li>Create the final results file: <code>./callstats.py json $VERSION_DIR1 $VERSION_DIR2 > result.json</code>
+ </li>
+ <li>Use <code>results.json</code> on this site.</code>
+ </ol>
+ </div>
+ </section>
<div id="popover">
<div class="popoverArrow"></div>
@@ -2505,30 +2652,49 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
</tr>
<tr>
<td>Time:</td>
- <td class="time"></td><td>±</td><td class="timeVariance"></td>
- <td class="compare time"></td><td class="compare"> ± </td><td class="compare timeVariance"></td>
+ <td class="time"></td>
+ <td>±</td>
+ <td class="timeVariance"></td>
+ <td class="compare time"></td>
+ <td class="compare"> ± </td>
+ <td class="compare timeVariance"></td>
</tr>
<tr>
<td>Percent:</td>
- <td class="percent"></td><td>±</td><td class="percentVariance"></td>
- <td class="compare percent"></td><td class="compare"> ± </td><td class="compare percentVariance"></td>
+ <td class="percent"></td>
+ <td>±</td>
+ <td class="percentVariance"></td>
+ <td class="compare percent"></td>
+ <td class="compare"> ± </td>
+ <td class="compare percentVariance"></td>
</tr>
<tr>
<td>Percent per Entry:</td>
- <td class="percentPerEntry"></td><td colspan=2></td>
- <td class="compare percentPerEntry"></td><td colspan=2></td>
+ <td class="percentPerEntry"></td>
+ <td colspan=2></td>
+ <td class="compare percentPerEntry"></td>
+ <td colspan=2></td>
</tr>
<tr>
<td>Count:</td>
- <td class="count"></td><td>±</td><td class="countVariance"></td>
- <td class="compare count"></td><td class="compare"> ± </td><td class="compare countVariance"></td>
+ <td class="count"></td>
+ <td>±</td>
+ <td class="countVariance"></td>
+ <td class="compare count"></td>
+ <td class="compare"> ± </td>
+ <td class="compare countVariance"></td>
</tr>
<tr>
<td>Overall Impact:</td>
- <td class="timeImpact"></td><td>±</td><td class="timePercentImpact"></td>
- <td class="compare timeImpact"></td><td class="compare"> ± </td><td class="compare timePercentImpact"></td>
+ <td class="timeImpact"></td>
+ <td>±</td>
+ <td class="timePercentImpact"></td>
+ <td class="compare timeImpact"></td>
+ <td class="compare"> ± </td>
+ <td class="compare timePercentImpact"></td>
</tr>
</table>
</div>
</body>
-</html>
+
+</html> \ No newline at end of file
diff --git a/chromium/v8/tools/clusterfuzz/js_fuzzer/exceptions.js b/chromium/v8/tools/clusterfuzz/js_fuzzer/exceptions.js
index f981b82efce..efb1a8a6499 100644
--- a/chromium/v8/tools/clusterfuzz/js_fuzzer/exceptions.js
+++ b/chromium/v8/tools/clusterfuzz/js_fuzzer/exceptions.js
@@ -147,6 +147,7 @@ const DISALLOWED_DIFFERENTIAL_FUZZ_FLAGS = [
const ALLOWED_RUNTIME_FUNCTIONS = new Set([
// List of allowed runtime functions. Others will be replaced with no-ops.
'ArrayBufferDetach',
+ 'CompileBaseline',
'DeoptimizeFunction',
'DeoptimizeNow',
'EnableCodeLoggingForTesting',
diff --git a/chromium/v8/tools/clusterfuzz/js_fuzzer/mutators/function_call_mutator.js b/chromium/v8/tools/clusterfuzz/js_fuzzer/mutators/function_call_mutator.js
index 4f34e15c06e..00272fcd55c 100644
--- a/chromium/v8/tools/clusterfuzz/js_fuzzer/mutators/function_call_mutator.js
+++ b/chromium/v8/tools/clusterfuzz/js_fuzzer/mutators/function_call_mutator.js
@@ -49,7 +49,7 @@ class FunctionCallMutator extends mutator.Mutator {
}
const probability = random.random();
- if (probability < 0.5) {
+ if (probability < 0.4) {
const randFunc = common.randomFunction(path);
if (randFunc) {
thisMutator.annotate(
@@ -58,7 +58,7 @@ class FunctionCallMutator extends mutator.Mutator {
path.node.callee = randFunc;
}
- } else if (probability < 0.7 && thisMutator.settings.engine == 'V8') {
+ } else if (probability < 0.6 && thisMutator.settings.engine == 'V8') {
const prepareTemplate = babelTemplate(
'__V8BuiltinPrepareFunctionForOptimization(ID)');
const optimizeTemplate = babelTemplate(
@@ -86,6 +86,28 @@ class FunctionCallMutator extends mutator.Mutator {
thisMutator.insertBeforeSkip(
path, _liftExpressionsToStatements(path, nodes));
}
+ } else if (probability < 0.75 && thisMutator.settings.engine == 'V8') {
+ const template = babelTemplate(
+ '__V8BuiltinCompileBaseline(ID)');
+
+ const nodes = [
+ template({
+ ID: babelTypes.cloneDeep(path.node.callee),
+ }).expression,
+ ];
+
+ thisMutator.annotate(
+ nodes[0],
+ `Compiling baseline ${path.node.callee.name}`);
+
+ if (!babelTypes.isExpressionStatement(path.parent)) {
+ nodes.push(path.node);
+ thisMutator.replaceWithSkip(
+ path, babelTypes.sequenceExpression(nodes));
+ } else {
+ thisMutator.insertBeforeSkip(
+ path, _liftExpressionsToStatements(path, nodes));
+ }
} else if (probability < 0.85 &&
thisMutator.settings.engine == 'V8') {
const template = babelTemplate(
diff --git a/chromium/v8/tools/clusterfuzz/js_fuzzer/resources/differential_fuzz_v8.js b/chromium/v8/tools/clusterfuzz/js_fuzzer/resources/differential_fuzz_v8.js
index 042f1cec57e..f87641326e4 100644
--- a/chromium/v8/tools/clusterfuzz/js_fuzzer/resources/differential_fuzz_v8.js
+++ b/chromium/v8/tools/clusterfuzz/js_fuzzer/resources/differential_fuzz_v8.js
@@ -23,5 +23,7 @@ assertOptimized = () => {};
isNeverOptimize = () => {};
isAlwaysOptimize = () => {};
isInterpreted = () => {};
+isBaseline = () => {};
+isUnoptimized = () => {};
isOptimized = () => {};
isTurboFanned = () => {};
diff --git a/chromium/v8/tools/clusterfuzz/js_fuzzer/test_data/mutate_function_call_baseline_expected.js b/chromium/v8/tools/clusterfuzz/js_fuzzer/test_data/mutate_function_call_baseline_expected.js
new file mode 100644
index 00000000000..1c02041cc5a
--- /dev/null
+++ b/chromium/v8/tools/clusterfuzz/js_fuzzer/test_data/mutate_function_call_baseline_expected.js
@@ -0,0 +1,16 @@
+// Copyright 2020 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/* FunctionCallMutator: Compiling baseline __f_0 */
+%CompileBaseline(__f_0);
+
+// Original: mutate_function_call.js
+__f_0(1);
+
+a = (
+/* FunctionCallMutator: Compiling baseline __f_0 */
+%CompileBaseline(__f_0), __f_0(1));
+foo(1, (
+/* FunctionCallMutator: Compiling baseline __f_0 */
+%CompileBaseline(__f_0), __f_0()));
diff --git a/chromium/v8/tools/clusterfuzz/v8_foozzie_harness_adjust.js b/chromium/v8/tools/clusterfuzz/v8_foozzie_harness_adjust.js
index 4a8ed35cc26..b81f8dd952a 100644
--- a/chromium/v8/tools/clusterfuzz/v8_foozzie_harness_adjust.js
+++ b/chromium/v8/tools/clusterfuzz/v8_foozzie_harness_adjust.js
@@ -89,6 +89,10 @@ try {
isInterpreted = function isInterpreted() {}
+ isBaseline = function isBaseline() {}
+
+ isUnoptimized = function isUnoptimized() {}
+
isOptimized = function isOptimized() {}
isTurboFanned = function isTurboFanned() {}
diff --git a/chromium/v8/tools/clusterfuzz/v8_fuzz_flags.json b/chromium/v8/tools/clusterfuzz/v8_fuzz_flags.json
index 8d52aeb2fe3..851694b89ad 100644
--- a/chromium/v8/tools/clusterfuzz/v8_fuzz_flags.json
+++ b/chromium/v8/tools/clusterfuzz/v8_fuzz_flags.json
@@ -28,5 +28,6 @@
[0.25, "--no-lazy-feedback-allocation"],
[0.1, "--no-lazy-feedback-allocation --interrupt-budget=100"],
[0.05, "--budget-for-feedback-vector-allocation=0"],
+ [0.1, "--no-wasm-generic-wrapper"],
[0.0001, "--simulate-errors"]
-] \ No newline at end of file
+]
diff --git a/chromium/v8/tools/debug_helper/BUILD.gn b/chromium/v8/tools/debug_helper/BUILD.gn
index 54cd3b7a4cc..2256df1f553 100644
--- a/chromium/v8/tools/debug_helper/BUILD.gn
+++ b/chromium/v8/tools/debug_helper/BUILD.gn
@@ -96,6 +96,7 @@ v8_component("v8_debug_helper") {
"../..:generate_bytecode_builtins_list",
"../..:run_torque",
"../..:v8_headers",
+ "../..:v8_internal_headers",
"../..:v8_libbase",
"../..:v8_shared_internal_headers",
"../..:v8_tracing",
diff --git a/chromium/v8/tools/debug_helper/debug-helper-internal.cc b/chromium/v8/tools/debug_helper/debug-helper-internal.cc
index 29af7ebdd76..51c8da6f278 100644
--- a/chromium/v8/tools/debug_helper/debug-helper-internal.cc
+++ b/chromium/v8/tools/debug_helper/debug-helper-internal.cc
@@ -14,7 +14,7 @@ namespace debug_helper_internal {
bool IsPointerCompressed(uintptr_t address) {
#if COMPRESS_POINTERS_BOOL
- return address < i::kPtrComprHeapReservationSize;
+ return address < i::kPtrComprCageReservationSize;
#else
return false;
#endif
diff --git a/chromium/v8/tools/debug_helper/get-object-properties.cc b/chromium/v8/tools/debug_helper/get-object-properties.cc
index a6ebcc0761a..7199bc51d22 100644
--- a/chromium/v8/tools/debug_helper/get-object-properties.cc
+++ b/chromium/v8/tools/debug_helper/get-object-properties.cc
@@ -14,6 +14,7 @@
#include "src/objects/string-inl.h"
#include "src/strings/unicode-inl.h"
#include "torque-generated/class-debug-readers.h"
+#include "torque-generated/debug-macros.h"
namespace i = v8::internal;
@@ -133,6 +134,23 @@ TypedObject GetTypedObjectByInstanceType(uintptr_t address,
}
}
+bool IsTypedHeapObjectInstanceTypeOf(uintptr_t address,
+ d::MemoryAccessor accessor,
+ i::InstanceType instance_type) {
+ auto heap_object = std::make_unique<TqHeapObject>(address);
+ Value<uintptr_t> map_ptr = heap_object->GetMapValue(accessor);
+
+ if (map_ptr.validity == d::MemoryAccessResult::kOk) {
+ Value<i::InstanceType> type =
+ TqMap(map_ptr.value).GetInstanceTypeValue(accessor);
+ if (type.validity == d::MemoryAccessResult::kOk) {
+ return instance_type == type.value;
+ }
+ }
+
+ return false;
+}
+
TypedObject GetTypedHeapObject(uintptr_t address, d::MemoryAccessor accessor,
const char* type_hint,
const d::HeapAddresses& heap_addresses) {
@@ -330,7 +348,7 @@ class ReadStringVisitor : public TqObjectVisitor {
GetOrFinish(object->GetResourceDataValue(accessor_));
#ifdef V8_COMPRESS_POINTERS
uintptr_t data_address = static_cast<uintptr_t>(
- DecodeExternalPointer(GetIsolateForPtrComprFromOnHeapAddress(
+ DecodeExternalPointer(GetPtrComprCageBaseFromOnHeapAddress(
heap_addresses_.any_heap_pointer),
resource_data, kExternalStringResourceDataTag));
#else
@@ -654,6 +672,90 @@ std::unique_ptr<StackFrameResult> GetStackFrame(
sizeof(v8::internal::JSFunction),
std::vector<std::unique_ptr<StructProperty>>(),
d::PropertyKind::kSingle));
+ // Add more items in the Locals pane representing the JS function name,
+ // source file name, and line & column numbers within the source file, so
+ // that the user doesn’t need to dig through the shared_function_info to
+ // find them.
+ intptr_t js_function_ptr = 0;
+ validity = memory_accessor(
+ frame_pointer + StandardFrameConstants::kFunctionOffset,
+ reinterpret_cast<void*>(&js_function_ptr), sizeof(intptr_t));
+ if (validity == d::MemoryAccessResult::kOk) {
+ TqJSFunction js_function(js_function_ptr);
+ auto shared_function_info_ptr =
+ js_function.GetSharedFunctionInfoValue(memory_accessor);
+ if (shared_function_info_ptr.validity == d::MemoryAccessResult::kOk) {
+ TqSharedFunctionInfo shared_function_info(
+ shared_function_info_ptr.value);
+ auto script_or_debug_info_ptr =
+ shared_function_info.GetScriptOrDebugInfoValue(memory_accessor);
+ if (script_or_debug_info_ptr.validity == d::MemoryAccessResult::kOk) {
+ // Make sure script_or_debug_info_ptr is script.
+ auto address = script_or_debug_info_ptr.value;
+ if (IsTypedHeapObjectInstanceTypeOf(address, memory_accessor,
+ i::InstanceType::SCRIPT_TYPE)) {
+ TqScript script(script_or_debug_info_ptr.value);
+ props.push_back(std::make_unique<ObjectProperty>(
+ "script_name", kObjectAsStoredInHeap, kObject,
+ script.GetNameAddress(), 1, i::kTaggedSize,
+ std::vector<std::unique_ptr<StructProperty>>(),
+ d::PropertyKind::kSingle));
+ props.push_back(std::make_unique<ObjectProperty>(
+ "script_source", kObjectAsStoredInHeap, kObject,
+ script.GetSourceAddress(), 1, i::kTaggedSize,
+ std::vector<std::unique_ptr<StructProperty>>(),
+ d::PropertyKind::kSingle));
+ }
+ }
+ auto name_or_scope_info_ptr =
+ shared_function_info.GetNameOrScopeInfoValue(memory_accessor);
+ if (name_or_scope_info_ptr.validity == d::MemoryAccessResult::kOk) {
+ auto scope_info_address = name_or_scope_info_ptr.value;
+ // Make sure name_or_scope_info_ptr is scope info.
+ if (IsTypedHeapObjectInstanceTypeOf(
+ scope_info_address, memory_accessor,
+ i::InstanceType::SCOPE_INFO_TYPE)) {
+ auto indexed_field_slice_function_variable_info =
+ TqDebugFieldSliceScopeInfoFunctionVariableInfo(
+ memory_accessor, scope_info_address);
+ if (indexed_field_slice_function_variable_info.validity ==
+ d::MemoryAccessResult::kOk) {
+ props.push_back(std::make_unique<ObjectProperty>(
+ "function_name", kObjectAsStoredInHeap, kObject,
+ scope_info_address - i::kHeapObjectTag +
+ std::get<1>(
+ indexed_field_slice_function_variable_info.value),
+ std::get<2>(
+ indexed_field_slice_function_variable_info.value),
+ i::kTaggedSize,
+ std::vector<std::unique_ptr<StructProperty>>(),
+ d::PropertyKind::kSingle));
+ }
+ std::vector<std::unique_ptr<StructProperty>>
+ position_info_struct_field_list;
+ position_info_struct_field_list.push_back(
+ std::make_unique<StructProperty>(
+ "start", kObjectAsStoredInHeap, kObject, 0, 0, 0));
+ position_info_struct_field_list.push_back(
+ std::make_unique<StructProperty>("end", kObjectAsStoredInHeap,
+ kObject, 4, 0, 0));
+ auto indexed_field_slice_position_info =
+ TqDebugFieldSliceScopeInfoPositionInfo(memory_accessor,
+ scope_info_address);
+ if (indexed_field_slice_position_info.validity ==
+ d::MemoryAccessResult::kOk) {
+ props.push_back(std::make_unique<ObjectProperty>(
+ "function_character_offset", "", "",
+ scope_info_address - i::kHeapObjectTag +
+ std::get<1>(indexed_field_slice_position_info.value),
+ std::get<2>(indexed_field_slice_position_info.value),
+ i::kTaggedSize, std::move(position_info_struct_field_list),
+ d::PropertyKind::kSingle));
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/chromium/v8/tools/dev/gm.py b/chromium/v8/tools/dev/gm.py
index c5ae178c18b..4e318f2f32e 100755
--- a/chromium/v8/tools/dev/gm.py
+++ b/chromium/v8/tools/dev/gm.py
@@ -98,15 +98,26 @@ TESTSUITES_TARGETS = {"benchmarks": "d8",
OUTDIR = "out"
+def _Which(cmd):
+ for path in os.environ["PATH"].split(os.pathsep):
+ if os.path.exists(os.path.join(path, cmd)):
+ return os.path.join(path, cmd)
+ return None
+
def DetectGoma():
- home_goma = os.path.expanduser("~/goma")
- if os.path.exists(home_goma):
- return home_goma
if os.environ.get("GOMA_DIR"):
return os.environ.get("GOMA_DIR")
if os.environ.get("GOMADIR"):
return os.environ.get("GOMADIR")
- return None
+ # There is a copy of goma in depot_tools, but it might not be in use on
+ # this machine.
+ goma = _Which("goma_ctl")
+ if goma is None: return None
+ cipd_bin = os.path.join(os.path.dirname(goma), ".cipd_bin")
+ if not os.path.exists(cipd_bin): return None
+ goma_auth = os.path.expanduser("~/.goma_client_oauth2_config")
+ if not os.path.exists(goma_auth): return None
+ return cipd_bin
GOMADIR = DetectGoma()
IS_GOMA_MACHINE = GOMADIR is not None
@@ -118,12 +129,11 @@ is_component_build = false
is_debug = false
%s
use_goma = {GOMA}
-goma_dir = \"{GOMA_DIR}\"
v8_enable_backtrace = true
v8_enable_disassembler = true
v8_enable_object_print = true
v8_enable_verify_heap = true
-""".replace("{GOMA}", USE_GOMA).replace("{GOMA_DIR}", str(GOMADIR))
+""".replace("{GOMA}", USE_GOMA)
DEBUG_ARGS_TEMPLATE = """\
is_component_build = true
@@ -131,12 +141,11 @@ is_debug = true
symbol_level = 2
%s
use_goma = {GOMA}
-goma_dir = \"{GOMA_DIR}\"
v8_enable_backtrace = true
v8_enable_fast_mksnapshot = true
v8_enable_slow_dchecks = true
v8_optimized_debug = false
-""".replace("{GOMA}", USE_GOMA).replace("{GOMA_DIR}", str(GOMADIR))
+""".replace("{GOMA}", USE_GOMA)
OPTDEBUG_ARGS_TEMPLATE = """\
is_component_build = true
@@ -144,12 +153,11 @@ is_debug = true
symbol_level = 1
%s
use_goma = {GOMA}
-goma_dir = \"{GOMA_DIR}\"
v8_enable_backtrace = true
v8_enable_fast_mksnapshot = true
v8_enable_verify_heap = true
v8_optimized_debug = true
-""".replace("{GOMA}", USE_GOMA).replace("{GOMA_DIR}", str(GOMADIR))
+""".replace("{GOMA}", USE_GOMA)
ARGS_TEMPLATES = {
"release": RELEASE_ARGS_TEMPLATE,
@@ -162,6 +170,17 @@ def PrintHelpAndExit():
print(HELP)
sys.exit(0)
+def PrintCompletionsAndExit():
+ for a in ARCHES:
+ print("%s" % a)
+ for m in MODES:
+ print("%s" % m)
+ print("%s.%s" % (a, m))
+ for t in TARGETS:
+ print("%s" % t)
+ print("%s.%s.%s" % (a, m, t))
+ sys.exit(0)
+
def _Call(cmd, silent=False):
if not silent: print("# %s" % cmd)
return subprocess.call(cmd, shell=True)
@@ -195,12 +214,6 @@ def _CallWithOutput(cmd):
p.wait()
return p.returncode, "".join(output)
-def _Which(cmd):
- for path in os.environ["PATH"].split(os.pathsep):
- if os.path.exists(os.path.join(path, cmd)):
- return os.path.join(path, cmd)
- return None
-
def _Write(filename, content):
print("# echo > %s << EOF\n%sEOF" % (filename, content))
with open(filename, "w") as f:
@@ -212,6 +225,11 @@ def _Notify(summary, body):
else:
print("{} - {}".format(summary, body))
+def _GetMachine():
+ # Once we migrate to Python3, this can use os.uname().machine.
+ # The index-based access is compatible with all Python versions.
+ return os.uname()[4]
+
def GetPath(arch, mode):
subdir = "%s.%s" % (arch, mode)
return os.path.join(OUTDIR, subdir)
@@ -239,33 +257,51 @@ class Config(object):
self.tests.update(tests)
def GetTargetCpu(self):
- if self.arch == "android_arm": return "target_cpu = \"arm\""
- if self.arch == "android_arm64": return "target_cpu = \"arm64\""
cpu = "x86"
- if "64" in self.arch or self.arch == "s390x":
+ if self.arch == "android_arm":
+ cpu = "arm"
+ elif self.arch == "android_arm64":
+ cpu = "arm64"
+ elif self.arch == "arm64" and _GetMachine() == "aarch64":
+ # arm64 build host:
+ cpu = "arm64"
+ elif self.arch == "arm" and _GetMachine() == "aarch64":
+ cpu = "arm"
+ elif "64" in self.arch or self.arch == "s390x":
+ # Native x64 or simulator build.
cpu = "x64"
- return "target_cpu = \"%s\"" % cpu
+ return ["target_cpu = \"%s\"" % cpu]
def GetV8TargetCpu(self):
- if self.arch == "android_arm": return "\nv8_target_cpu = \"arm\""
- if self.arch == "android_arm64": return "\nv8_target_cpu = \"arm64\""
- if self.arch in ("arm", "arm64", "mipsel", "mips64el", "ppc", "ppc64",
- "riscv64", "s390", "s390x"):
- return "\nv8_target_cpu = \"%s\"" % self.arch
- return ""
+ if self.arch == "android_arm":
+ v8_cpu = "arm"
+ elif self.arch == "android_arm64":
+ v8_cpu = "arm64"
+ elif self.arch in ("arm", "arm64", "mipsel", "mips64el", "ppc", "ppc64",
+ "riscv64", "s390", "s390x"):
+ v8_cpu = self.arch
+ else:
+ return []
+ return ["v8_target_cpu = \"%s\"" % v8_cpu]
def GetTargetOS(self):
if self.arch in ("android_arm", "android_arm64"):
- return "\ntarget_os = \"android\""
- return ""
+ return ["target_os = \"android\""]
+ return []
+
+ def GetSpecialCompiler(self):
+ if _GetMachine() == "aarch64":
+ # We have no prebuilt Clang for arm64. Use the system Clang instead.
+ return ["clang_base_path = \"/usr\"", "clang_use_chrome_plugins = false"]
+ return []
def GetGnArgs(self):
# Use only substring before first '-' as the actual mode
mode = re.match("([^-]+)", self.mode).group(1)
template = ARGS_TEMPLATES[mode]
arch_specific = (self.GetTargetCpu() + self.GetV8TargetCpu() +
- self.GetTargetOS())
- return template % arch_specific
+ self.GetTargetOS() + self.GetSpecialCompiler())
+ return template % "\n".join(arch_specific)
def Build(self):
path = GetPath(self.arch, self.mode)
@@ -352,6 +388,8 @@ class ArgumentParser(object):
def ParseArg(self, argstring):
if argstring in ("-h", "--help", "help"):
PrintHelpAndExit()
+ if argstring == "--print-completions":
+ PrintCompletionsAndExit()
arches = []
modes = []
targets = []
@@ -426,7 +464,7 @@ def Main(argv):
configs = parser.ParseArguments(argv[1:])
return_code = 0
# If we have Goma but it is not running, start it.
- if (GOMADIR is not None and
+ if (IS_GOMA_MACHINE and
_Call("ps -e | grep compiler_proxy > /dev/null", silent=True) != 0):
_Call("%s/goma_ctl.py ensure_start" % GOMADIR)
for c in configs:
diff --git a/chromium/v8/tools/dumpcpp.mjs b/chromium/v8/tools/dumpcpp.mjs
index 9deab5d2aae..316c48f65bf 100644
--- a/chromium/v8/tools/dumpcpp.mjs
+++ b/chromium/v8/tools/dumpcpp.mjs
@@ -27,7 +27,7 @@ export class CppProcessor extends LogReader {
* @override
*/
printError(str) {
- print(str);
+ console.log(str);
}
processLogFile(fileName) {
@@ -61,7 +61,7 @@ export class CppProcessor extends LogReader {
const entry = staticEntries[i];
const printValues = ['cpp', `0x${entry[0].toString(16)}`, entry[1].size,
`"${entry[1].name}"`];
- print(printValues.join(','));
+ console.log(printValues.join(','));
}
}
}
diff --git a/chromium/v8/tools/find-builtin b/chromium/v8/tools/find-builtin
new file mode 100755
index 00000000000..29cb0f4c4b7
--- /dev/null
+++ b/chromium/v8/tools/find-builtin
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+set -euo pipefail
+
+BUILTIN_NAME="$1"
+
+if ! which rg >/dev/null ; then
+ echo >&2 "This tool requires 'rg', install it with 'sudo apt install ripgrep'"
+ exit 1
+fi
+
+TOOLS_DIRNAME="$(dirname "$0")"
+V8_DIRNAME="$(dirname "$TOOLS_DIRNAME")"
+
+if rg --type-add 'tq:*.tq' --type tq --with-filename --line-number "\bbuiltin $BUILTIN_NAME\b" "$V8_DIRNAME" | rg -v '\bextern builtin\b' | cut -f1-2 -d: ; then
+ exit 0
+fi
+
+if rg --type cpp --with-filename --line-number "\b(TF_BUILTIN\(|::Generate_?)$BUILTIN_NAME\b" "$V8_DIRNAME" | cut -f1-2 -d: ; then
+ exit 0
+fi
+
+echo >&2 "Builtin '$BUILTIN_NAME' not found"
+exit 1 \ No newline at end of file
diff --git a/chromium/v8/tools/gcmole/gcmole.py b/chromium/v8/tools/gcmole/gcmole.py
index 978cd315981..3df0788adef 100644
--- a/chromium/v8/tools/gcmole/gcmole.py
+++ b/chromium/v8/tools/gcmole/gcmole.py
@@ -99,6 +99,7 @@ def MakeClangCommandLine(plugin, plugin_args, arch_cfg, clang_bin_dir,
arch_cfg.arch_define,
"-DENABLE_DEBUGGER_SUPPORT",
"-DV8_INTL_SUPPORT",
+ "-DV8_ENABLE_WEBASSEMBLY",
"-I./",
"-Iinclude/",
"-Iout/build/gen",
@@ -306,7 +307,7 @@ ALLOWLIST = [
]
GC_PATTERN = ",.*Collect.*Garbage"
-SAFEPOINT_PATTERN = ",EnterSafepoint"
+SAFEPOINT_PATTERN = ",SafepointSlowPath"
ALLOWLIST_PATTERN = "|".join("(?:%s)" % p for p in ALLOWLIST)
diff --git a/chromium/v8/tools/ic-processor-driver.mjs b/chromium/v8/tools/ic-processor-driver.mjs
index c8042736b03..2087ef80564 100644
--- a/chromium/v8/tools/ic-processor-driver.mjs
+++ b/chromium/v8/tools/ic-processor-driver.mjs
@@ -22,7 +22,7 @@ export function readFile(fileName) {
try {
return read(fileName);
} catch (e) {
- print(fileName + ': ' + (e.message || e));
+ console.log(fileName + ': ' + (e.message || e));
throw e;
}
}
@@ -78,13 +78,13 @@ const accumulator = {
StoreInArrayLiteralIC: 0,
}
for (const ic of processor.icTimeline.all) {
- print(Object.values(ic));
+ console.log(Object.values(ic));
accumulator[ic.type]++;
}
-print("========================================");
+console.log("========================================");
for (const key of Object.keys(accumulator)) {
- print(key + ": " + accumulator[key]);
+ console.log(key + ": " + accumulator[key]);
}
diff --git a/chromium/v8/tools/index.html b/chromium/v8/tools/index.html
index 93155dfbdfd..53b22f170d5 100644
--- a/chromium/v8/tools/index.html
+++ b/chromium/v8/tools/index.html
@@ -30,6 +30,7 @@ a:link, a:visited {
text-align: center;
text-decoration: none;
display: inline-block;
+ border-radius: 2px;
}
a:hover, a:active {
background-color: white;
@@ -42,12 +43,16 @@ a:hover, a:active {
background-color: #000000;
grid-gap: 15px;
}
+.grid-2{
+ grid-template-columns: auto auto;
+}
.card {
text-align: center;
padding: 10px 50px 10px 50px ;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
background-color: #121212;
width: auto;
+ border-radius: 10px;
}
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
@@ -95,13 +100,15 @@ dd, dt {
<dt><a href="./zone-stats/index.html">Zone Stats</a></dt>
<dd>Analyse zone memory usage.</dd>
</div>
+ </dl>
+ <dl class="grid-container grid-2">
<div class="card">
- <dt><a href="https://v8.dev/tools">Other V8 Versions</a></dt>
- <dd>Check out the V8 website for available tool versions.</dd>
+ <dt><a href="https://v8.dev/tools/versions">Other V8 Versions</a></dt>
+ <dd>Archived versions of V8 tools</dd>
</div>
<div class="card">
<dt><a href="https://v8.dev">V8.Dev</a></dt>
- <dd>Check out the V8 website for more information.</dd>
+ <dd>The main V8 website.</dd>
</div>
</dl>
</div>
diff --git a/chromium/v8/tools/ninja/ninja_output.py b/chromium/v8/tools/ninja/ninja_output.py
deleted file mode 100644
index ec4d27e097f..00000000000
--- a/chromium/v8/tools/ninja/ninja_output.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2015 the V8 project authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-import os
-import os.path
-
-
-def GetNinjaOutputDirectory(v8_root, configuration=None):
- """Returns <v8_root>/<output_dir>/(Release|Debug).
-
- The configuration chosen is the one most recently generated/built, but can be
- overriden via the <configuration> parameter. Detects a custom output_dir
- specified by GYP_GENERATOR_FLAGS."""
-
- output_dir = 'out'
- generator_flags = os.getenv('GYP_GENERATOR_FLAGS', '').split(' ')
- for flag in generator_flags:
- name_value = flag.split('=', 1)
- if len(name_value) == 2 and name_value[0] == 'output_dir':
- output_dir = name_value[1]
-
- root = os.path.join(v8_root, output_dir)
- if configuration:
- return os.path.join(root, configuration)
-
- debug_path = os.path.join(root, 'Debug')
- release_path = os.path.join(root, 'Release')
-
- def is_release_newer(test_path):
- try:
- debug_mtime = os.path.getmtime(os.path.join(debug_path, test_path))
- except os.error:
- debug_mtime = 0
- try:
- rel_mtime = os.path.getmtime(os.path.join(release_path, test_path))
- except os.error:
- rel_mtime = 0
- return rel_mtime >= debug_mtime
-
- if is_release_newer('.ninja_log') or is_release_newer('.ninja_deps'):
- return release_path
- return debug_path
diff --git a/chromium/v8/tools/profview/profile-utils.js b/chromium/v8/tools/profview/profile-utils.js
index 9007855ea9b..35fe3d7cb25 100644
--- a/chromium/v8/tools/profview/profile-utils.js
+++ b/chromium/v8/tools/profview/profile-utils.js
@@ -21,7 +21,8 @@ let codeKinds = [
"JSOPT",
"JSUNOPT",
"JSNCI",
- "JSTURBOPROP"
+ "JSTURBOPROP",
+ "JSBASELINE",
];
function resolveCodeKind(code) {
@@ -59,6 +60,8 @@ function resolveCodeKind(code) {
return "JSUNOPT";
} else if (code.kind === "NCI") {
return "JSNCI";
+ } else if (code.kind === "Baseline") {
+ return "JSBASELINE";
} else if (code.kind === "Turboprop") {
return "JSTURBOPROP";
}
@@ -272,6 +275,7 @@ function buildCategoryTreeAndLookup() {
addCategory("JS Optimized", [ "JSOPT" ]);
addCategory("JS NCI", [ "JSNCI" ]);
addCategory("JS Turboprop", [ "JSTURBOPROP" ]);
+ addCategory("JS Baseline", [ "JSBASELINE" ]);
addCategory("JS Unoptimized", [ "JSUNOPT", "BC" ]);
addCategory("IC", [ "IC" ]);
addCategory("RegExp", [ "REGEXP" ]);
diff --git a/chromium/v8/tools/profview/profview.js b/chromium/v8/tools/profview/profview.js
index 248146f99f8..15a74f72405 100644
--- a/chromium/v8/tools/profview/profview.js
+++ b/chromium/v8/tools/profview/profview.js
@@ -224,6 +224,10 @@ const bucketDescriptors =
color : "#693eb8",
backgroundColor : "#a6c452",
text : "JS Turboprop" },
+ { kinds : [ "JSBASELINE" ],
+ color : "#b3005b",
+ backgroundColor : "#ff9e80",
+ text : "JS Baseline" },
{ kinds : [ "JSUNOPT", "BC" ],
color : "#dd2c00",
backgroundColor : "#ff9e80",
diff --git a/chromium/v8/tools/release/auto_roll.py b/chromium/v8/tools/release/auto_roll.py
index 27ba3e42168..ffba545c8f2 100755
--- a/chromium/v8/tools/release/auto_roll.py
+++ b/chromium/v8/tools/release/auto_roll.py
@@ -155,13 +155,14 @@ class UploadCL(Step):
message.append(ISSUE_MSG)
- message.append("TBR=%s" % self._options.reviewer)
+ message.append("R=%s" % self._options.reviewer)
self.GitCommit("\n\n".join(message), author=self._options.author, cwd=cwd)
if not self._options.dry_run:
self.GitUpload(force=True,
bypass_hooks=True,
cq=self._options.use_commit_queue,
cq_dry_run=self._options.use_dry_run,
+ set_bot_commit=True,
cwd=cwd)
print("CL uploaded.")
else:
diff --git a/chromium/v8/tools/release/git_recipes.py b/chromium/v8/tools/release/git_recipes.py
index 716d1461364..a90266aa714 100644
--- a/chromium/v8/tools/release/git_recipes.py
+++ b/chromium/v8/tools/release/git_recipes.py
@@ -206,8 +206,9 @@ class GitRecipesMixin(object):
self.Git(MakeArgs(args), **kwargs)
def GitUpload(self, reviewer="", force=False, cq=False,
- cq_dry_run=False, bypass_hooks=False, cc="", tbr_reviewer="",
- no_autocc=False, message_file=None, **kwargs):
+ cq_dry_run=False, set_bot_commit=False, bypass_hooks=False,
+ cc="", tbr_reviewer="", no_autocc=False, message_file=None,
+ **kwargs):
args = ["cl upload --send-mail"]
if reviewer:
args += ["-r", Quoted(reviewer)]
@@ -219,6 +220,8 @@ class GitRecipesMixin(object):
args.append("--use-commit-queue")
if cq_dry_run:
args.append("--cq-dry-run")
+ if set_bot_commit:
+ args.append("--set-bot-commit")
if bypass_hooks:
args.append("--bypass-hooks")
if no_autocc:
diff --git a/chromium/v8/tools/release/test_scripts.py b/chromium/v8/tools/release/test_scripts.py
index cf86efb3cad..bfac9a4a34a 100755
--- a/chromium/v8/tools/release/test_scripts.py
+++ b/chromium/v8/tools/release/test_scripts.py
@@ -540,7 +540,7 @@ CQ_INCLUDE_TRYBOTS=luci.chromium.try:mac_optional_gpu_tests_rel
CQ_INCLUDE_TRYBOTS=luci.chromium.try:win_optional_gpu_tests_rel
CQ_INCLUDE_TRYBOTS=luci.chromium.try:android_optional_gpu_tests_rel
-TBR=reviewer@chromium.org"""
+R=reviewer@chromium.org"""
# Snippet from the original DEPS file.
FAKE_DEPS = """
@@ -624,7 +624,7 @@ deps = {
self.ROLL_COMMIT_MSG),
"", cwd=chrome_dir),
Cmd("git cl upload --send-mail -f "
- "--cq-dry-run --bypass-hooks", "",
+ "--cq-dry-run --set-bot-commit --bypass-hooks", "",
cwd=chrome_dir),
Cmd("git checkout -f master", "", cwd=chrome_dir),
Cmd("git branch -D work-branch", "", cwd=chrome_dir),
diff --git a/chromium/v8/tools/system-analyzer/index.css b/chromium/v8/tools/system-analyzer/index.css
index 27b07531bf6..ad3f24d27ba 100644
--- a/chromium/v8/tools/system-analyzer/index.css
+++ b/chromium/v8/tools/system-analyzer/index.css
@@ -132,7 +132,7 @@ dd {
font-weight: 400;
}
-.panel > select{
+.panel > select {
width: calc(100% + 20px);
margin: 0 -10px 10px -10px;
}
diff --git a/chromium/v8/tools/testrunner/base_runner.py b/chromium/v8/tools/testrunner/base_runner.py
index df0c71428cf..fdaf0370a17 100644
--- a/chromium/v8/tools/testrunner/base_runner.py
+++ b/chromium/v8/tools/testrunner/base_runner.py
@@ -647,9 +647,6 @@ class BaseTestRunner(object):
'--no-enable-sse4_1'])
# Set no_simd_sse on architectures without Simd enabled.
- if self.build_config.arch == 'ppc64':
- no_simd_sse = True
-
if self.build_config.arch == 'mips64el' or \
self.build_config.arch == 'mipsel':
no_simd_sse = not simd_mips
diff --git a/chromium/v8/tools/testrunner/local/variants.py b/chromium/v8/tools/testrunner/local/variants.py
index 595f7e27f45..0af6d3ab0e6 100644
--- a/chromium/v8/tools/testrunner/local/variants.py
+++ b/chromium/v8/tools/testrunner/local/variants.py
@@ -13,8 +13,10 @@ ALL_VARIANT_FLAGS = {
"infra_staging": [[]],
"interpreted_regexp": [["--regexp-interpret-all"]],
"experimental_regexp": [["--default-to-experimental-regexp-engine"]],
+ "concurrent_inlining": [["--concurrent-inlining"]],
"jitless": [["--jitless"]],
"sparkplug": [["--sparkplug"]],
+ "always_sparkplug": [[ "--always-sparkplug" ]],
"minor_mc": [["--minor-mc"]],
"no_lfa": [["--no-lazy-feedback-allocation"]],
# No optimization means disable all optimizations. OptimizeFunctionOnNextCall
@@ -23,14 +25,13 @@ ALL_VARIANT_FLAGS = {
# For WebAssembly, we test "Liftoff-only" in the nooptimization variant and
# "TurboFan-only" in the stress variant. The WebAssembly configuration is
# independent of JS optimizations, so we can combine those configs.
- "nooptimization": [["--no-opt", "--liftoff", "--no-wasm-tier-up",
- "--wasm-generic-wrapper"]],
+ "nooptimization": [["--no-opt", "--liftoff", "--no-wasm-tier-up"]],
"slow_path": [["--force-slow-path"]],
- "stress": [["--stress-opt", "--no-liftoff", "--stress-lazy-source-positions"]],
+ "stress": [["--stress-opt", "--no-liftoff", "--stress-lazy-source-positions",
+ "--no-wasm-generic-wrapper"]],
"stress_concurrent_allocation": [["--stress-concurrent-allocation"]],
"stress_concurrent_inlining": [["--stress-concurrent-inlining"]],
"stress_js_bg_compile_wasm_code_gc": [["--stress-background-compile",
- "--finalize-streaming-on-background",
"--stress-wasm-code-gc"]],
"stress_incremental_marking": [["--stress-incremental-marking"]],
"stress_snapshot": [["--stress-snapshot"]],
@@ -50,23 +51,34 @@ ALL_VARIANT_FLAGS = {
# implications defined in flag-definitions.h.
INCOMPATIBLE_FLAGS_PER_VARIANT = {
"assert_types": ["--no-assert-types"],
- "jitless": ["--opt", "--always-opt", "--liftoff", "--track-field-types", "--validate-asm", "--sparkplug", "--always-sparkplug"],
+ "jitless": ["--opt", "--always-opt", "--liftoff", "--track-field-types",
+ "--validate-asm", "--sparkplug", "--always-sparkplug"],
"no_wasm_traps": ["--wasm-trap-handler"],
- "nooptimization": ["--opt", "--always-opt", "--no-liftoff", "--wasm-tier-up"],
+ "nooptimization": ["--opt", "--always-opt", "--no-liftoff",
+ "--wasm-tier-up"],
"slow_path": ["--no-force-slow-path"],
"stress_concurrent_allocation": ["--single-threaded-gc", "--predictable"],
- "stress_concurrent_inlining": ["--single-threaded", "--predictable", "--no-turbo-direct-heap-access"],
+ "stress_concurrent_inlining": ["--single-threaded", "--predictable",
+ "--no-turbo-direct-heap-access"],
"stress_incremental_marking": ["--no-stress-incremental-marking"],
- "future": ["--parallel-compile-tasks", "--no-turbo-direct-heap-access"],
- "stress_js_bg_compile_wasm_code_gc": ["--no-stress-background-compile", "--parallel-compile-tasks"],
- "stress": ["--no-stress-opt", "--always-opt", "--no-always-opt", "--liftoff", "--max-inlined-bytecode-size=*",
- "--max-inlined-bytecode-size-cumulative=*", "--stress-inline"],
- "sparkplug": ["--jitless"],
- "turboprop": ["--interrupt-budget=*", "--no-turbo-direct-heap-access", "--no-turboprop"],
- "turboprop_as_toptier": ["--interrupt-budget=*", "--no-turbo-direct-heap-access", "--no-turboprop", "--no-turboprop-as-toptier"],
- "code_serializer": ["--cache=after-execute", "--cache=full-code-cache", "--cache=none"],
+ "future": ["--no-turbo-direct-heap-access"],
+ "stress_js_bg_compile_wasm_code_gc": ["--no-stress-background-compile"],
+ "stress": ["--no-stress-opt", "--always-opt", "--no-always-opt", "--liftoff",
+ "--max-inlined-bytecode-size=*",
+ "--max-inlined-bytecode-size-cumulative=*", "--stress-inline",
+ "--wasm-generic-wrapper"],
+ "sparkplug": ["--jitless", "--no-sparkplug" ],
+ "always_sparkplug": ["--jitless", "--no-sparkplug", "--no-always-sparkplug"],
+ "turboprop": ["--interrupt-budget=*", "--no-turbo-direct-heap-access",
+ "--no-turboprop"],
+ "turboprop_as_toptier": ["--interrupt-budget=*",
+ "--no-turbo-direct-heap-access", "--no-turboprop",
+ "--no-turboprop-as-toptier"],
+ "code_serializer": ["--cache=after-execute", "--cache=full-code-cache",
+ "--cache=none"],
"no_local_heaps": ["--concurrent-inlining", "--turboprop"],
- "experimental_regexp": ["--no-enable-experimental-regexp-engine", "--no-default-to-experimental-regexp-engine"],
+ "experimental_regexp": ["--no-enable-experimental-regexp-engine",
+ "--no-default-to-experimental-regexp-engine"],
}
# Flags that lead to a contradiction under certain build variables.
@@ -93,12 +105,13 @@ INCOMPATIBLE_FLAGS_PER_EXTRA_FLAG = {
"--enable-armv8": ["--no-enable-armv8"],
"--gc-interval=*": ["--gc-interval=*"],
"--no-enable-sse3": ["--enable-sse3"],
+ "--no-enable-ssse3": ["--enable-ssse3"],
"--no-enable-sse4-1": ["--enable-sse4-1"],
"--optimize-for-size": ["--max-semi-space-size=*"],
"--stress_concurrent_allocation": ["--single-threaded-gc", "--predictable"],
"--stress_concurrent_inlining": ["--single-threaded", "--predictable"],
"--stress-flush-bytecode": ["--no-stress-flush-bytecode"],
- "--future": ["--parallel-compile-tasks", "--no-turbo-direct-heap-access"],
+ "--future": ["--no-turbo-direct-heap-access"],
"--stress-incremental-marking": INCOMPATIBLE_FLAGS_PER_VARIANT["stress_incremental_marking"],
}
diff --git a/chromium/v8/tools/tickprocessor.mjs b/chromium/v8/tools/tickprocessor.mjs
index 3041a0cddda..1ad67e22c0d 100644
--- a/chromium/v8/tools/tickprocessor.mjs
+++ b/chromium/v8/tools/tickprocessor.mjs
@@ -293,7 +293,7 @@ export class TickProcessor extends LogReader {
}
processCodeCreation(type, kind, timestamp, start, size, name, maybe_func) {
- if (maybe_func.length) {
+ if (type != 'RegExp' && maybe_func.length) {
const funcAddr = parseInt(maybe_func[0]);
const state = Profile.parseState(maybe_func[1]);
this.profile_.addFuncCode(type, name, timestamp, start, size, funcAddr, state);
diff --git a/chromium/v8/tools/v8heapconst.py b/chromium/v8/tools/v8heapconst.py
index dba01c88390..f0cc6481a88 100644
--- a/chromium/v8/tools/v8heapconst.py
+++ b/chromium/v8/tools/v8heapconst.py
@@ -95,48 +95,48 @@ INSTANCE_TYPES = {
131: "BYTECODE_ARRAY_TYPE",
132: "FIXED_DOUBLE_ARRAY_TYPE",
133: "INTERNAL_CLASS_WITH_SMI_ELEMENTS_TYPE",
- 134: "SCOPE_INFO_TYPE",
- 135: "SLOPPY_ARGUMENTS_ELEMENTS_TYPE",
- 136: "AWAIT_CONTEXT_TYPE",
- 137: "BLOCK_CONTEXT_TYPE",
- 138: "CATCH_CONTEXT_TYPE",
- 139: "DEBUG_EVALUATE_CONTEXT_TYPE",
- 140: "EVAL_CONTEXT_TYPE",
- 141: "FUNCTION_CONTEXT_TYPE",
- 142: "MODULE_CONTEXT_TYPE",
- 143: "NATIVE_CONTEXT_TYPE",
- 144: "SCRIPT_CONTEXT_TYPE",
- 145: "WITH_CONTEXT_TYPE",
- 146: "EXPORTED_SUB_CLASS_BASE_TYPE",
- 147: "EXPORTED_SUB_CLASS_TYPE",
- 148: "EXPORTED_SUB_CLASS2_TYPE",
- 149: "SMALL_ORDERED_HASH_MAP_TYPE",
- 150: "SMALL_ORDERED_HASH_SET_TYPE",
- 151: "SMALL_ORDERED_NAME_DICTIONARY_TYPE",
- 152: "DESCRIPTOR_ARRAY_TYPE",
- 153: "STRONG_DESCRIPTOR_ARRAY_TYPE",
- 154: "SOURCE_TEXT_MODULE_TYPE",
- 155: "SYNTHETIC_MODULE_TYPE",
- 156: "UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE",
- 157: "UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE",
- 158: "WEAK_FIXED_ARRAY_TYPE",
- 159: "TRANSITION_ARRAY_TYPE",
- 160: "CELL_TYPE",
- 161: "CODE_TYPE",
- 162: "CODE_DATA_CONTAINER_TYPE",
- 163: "COVERAGE_INFO_TYPE",
- 164: "EMBEDDER_DATA_ARRAY_TYPE",
- 165: "FEEDBACK_METADATA_TYPE",
- 166: "FEEDBACK_VECTOR_TYPE",
- 167: "FILLER_TYPE",
- 168: "FREE_SPACE_TYPE",
- 169: "INTERNAL_CLASS_TYPE",
- 170: "INTERNAL_CLASS_WITH_STRUCT_ELEMENTS_TYPE",
- 171: "MAP_TYPE",
- 172: "ON_HEAP_BASIC_BLOCK_PROFILER_DATA_TYPE",
- 173: "PREPARSE_DATA_TYPE",
- 174: "PROPERTY_ARRAY_TYPE",
- 175: "PROPERTY_CELL_TYPE",
+ 134: "SLOPPY_ARGUMENTS_ELEMENTS_TYPE",
+ 135: "AWAIT_CONTEXT_TYPE",
+ 136: "BLOCK_CONTEXT_TYPE",
+ 137: "CATCH_CONTEXT_TYPE",
+ 138: "DEBUG_EVALUATE_CONTEXT_TYPE",
+ 139: "EVAL_CONTEXT_TYPE",
+ 140: "FUNCTION_CONTEXT_TYPE",
+ 141: "MODULE_CONTEXT_TYPE",
+ 142: "NATIVE_CONTEXT_TYPE",
+ 143: "SCRIPT_CONTEXT_TYPE",
+ 144: "WITH_CONTEXT_TYPE",
+ 145: "EXPORTED_SUB_CLASS_BASE_TYPE",
+ 146: "EXPORTED_SUB_CLASS_TYPE",
+ 147: "EXPORTED_SUB_CLASS2_TYPE",
+ 148: "SMALL_ORDERED_HASH_MAP_TYPE",
+ 149: "SMALL_ORDERED_HASH_SET_TYPE",
+ 150: "SMALL_ORDERED_NAME_DICTIONARY_TYPE",
+ 151: "DESCRIPTOR_ARRAY_TYPE",
+ 152: "STRONG_DESCRIPTOR_ARRAY_TYPE",
+ 153: "SOURCE_TEXT_MODULE_TYPE",
+ 154: "SYNTHETIC_MODULE_TYPE",
+ 155: "UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE",
+ 156: "UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE",
+ 157: "WEAK_FIXED_ARRAY_TYPE",
+ 158: "TRANSITION_ARRAY_TYPE",
+ 159: "CELL_TYPE",
+ 160: "CODE_TYPE",
+ 161: "CODE_DATA_CONTAINER_TYPE",
+ 162: "COVERAGE_INFO_TYPE",
+ 163: "EMBEDDER_DATA_ARRAY_TYPE",
+ 164: "FEEDBACK_METADATA_TYPE",
+ 165: "FEEDBACK_VECTOR_TYPE",
+ 166: "FILLER_TYPE",
+ 167: "FREE_SPACE_TYPE",
+ 168: "INTERNAL_CLASS_TYPE",
+ 169: "INTERNAL_CLASS_WITH_STRUCT_ELEMENTS_TYPE",
+ 170: "MAP_TYPE",
+ 171: "ON_HEAP_BASIC_BLOCK_PROFILER_DATA_TYPE",
+ 172: "PREPARSE_DATA_TYPE",
+ 173: "PROPERTY_ARRAY_TYPE",
+ 174: "PROPERTY_CELL_TYPE",
+ 175: "SCOPE_INFO_TYPE",
176: "SHARED_FUNCTION_INFO_TYPE",
177: "SMI_BOX_TYPE",
178: "SMI_PAIR_TYPE",
@@ -233,16 +233,16 @@ INSTANCE_TYPES = {
# List of known V8 maps.
KNOWN_MAPS = {
- ("read_only_space", 0x02119): (171, "MetaMap"),
+ ("read_only_space", 0x02119): (170, "MetaMap"),
("read_only_space", 0x02141): (67, "NullMap"),
- ("read_only_space", 0x02169): (153, "StrongDescriptorArrayMap"),
- ("read_only_space", 0x02191): (158, "WeakFixedArrayMap"),
+ ("read_only_space", 0x02169): (152, "StrongDescriptorArrayMap"),
+ ("read_only_space", 0x02191): (157, "WeakFixedArrayMap"),
("read_only_space", 0x021d1): (97, "EnumCacheMap"),
("read_only_space", 0x02205): (117, "FixedArrayMap"),
("read_only_space", 0x02251): (8, "OneByteInternalizedStringMap"),
- ("read_only_space", 0x0229d): (168, "FreeSpaceMap"),
- ("read_only_space", 0x022c5): (167, "OnePointerFillerMap"),
- ("read_only_space", 0x022ed): (167, "TwoPointerFillerMap"),
+ ("read_only_space", 0x0229d): (167, "FreeSpaceMap"),
+ ("read_only_space", 0x022c5): (166, "OnePointerFillerMap"),
+ ("read_only_space", 0x022ed): (166, "TwoPointerFillerMap"),
("read_only_space", 0x02315): (67, "UninitializedMap"),
("read_only_space", 0x0238d): (67, "UndefinedMap"),
("read_only_space", 0x023d1): (66, "HeapNumberMap"),
@@ -253,139 +253,139 @@ KNOWN_MAPS = {
("read_only_space", 0x02559): (118, "HashTableMap"),
("read_only_space", 0x02581): (64, "SymbolMap"),
("read_only_space", 0x025a9): (40, "OneByteStringMap"),
- ("read_only_space", 0x025d1): (134, "ScopeInfoMap"),
+ ("read_only_space", 0x025d1): (175, "ScopeInfoMap"),
("read_only_space", 0x025f9): (176, "SharedFunctionInfoMap"),
- ("read_only_space", 0x02621): (161, "CodeMap"),
- ("read_only_space", 0x02649): (160, "CellMap"),
- ("read_only_space", 0x02671): (175, "GlobalPropertyCellMap"),
+ ("read_only_space", 0x02621): (160, "CodeMap"),
+ ("read_only_space", 0x02649): (159, "CellMap"),
+ ("read_only_space", 0x02671): (174, "GlobalPropertyCellMap"),
("read_only_space", 0x02699): (70, "ForeignMap"),
- ("read_only_space", 0x026c1): (159, "TransitionArrayMap"),
+ ("read_only_space", 0x026c1): (158, "TransitionArrayMap"),
("read_only_space", 0x026e9): (45, "ThinOneByteStringMap"),
- ("read_only_space", 0x02711): (166, "FeedbackVectorMap"),
- ("read_only_space", 0x0274d): (67, "ArgumentsMarkerMap"),
- ("read_only_space", 0x027ad): (67, "ExceptionMap"),
- ("read_only_space", 0x02809): (67, "TerminationExceptionMap"),
- ("read_only_space", 0x02871): (67, "OptimizedOutMap"),
- ("read_only_space", 0x028d1): (67, "StaleRegisterMap"),
- ("read_only_space", 0x02931): (129, "ScriptContextTableMap"),
- ("read_only_space", 0x02959): (127, "ClosureFeedbackCellArrayMap"),
- ("read_only_space", 0x02981): (165, "FeedbackMetadataArrayMap"),
- ("read_only_space", 0x029a9): (117, "ArrayListMap"),
- ("read_only_space", 0x029d1): (65, "BigIntMap"),
- ("read_only_space", 0x029f9): (128, "ObjectBoilerplateDescriptionMap"),
- ("read_only_space", 0x02a21): (131, "BytecodeArrayMap"),
- ("read_only_space", 0x02a49): (162, "CodeDataContainerMap"),
- ("read_only_space", 0x02a71): (163, "CoverageInfoMap"),
- ("read_only_space", 0x02a99): (132, "FixedDoubleArrayMap"),
- ("read_only_space", 0x02ac1): (120, "GlobalDictionaryMap"),
- ("read_only_space", 0x02ae9): (98, "ManyClosuresCellMap"),
- ("read_only_space", 0x02b11): (117, "ModuleInfoMap"),
- ("read_only_space", 0x02b39): (121, "NameDictionaryMap"),
- ("read_only_space", 0x02b61): (98, "NoClosuresCellMap"),
- ("read_only_space", 0x02b89): (122, "NumberDictionaryMap"),
- ("read_only_space", 0x02bb1): (98, "OneClosureCellMap"),
- ("read_only_space", 0x02bd9): (123, "OrderedHashMapMap"),
- ("read_only_space", 0x02c01): (124, "OrderedHashSetMap"),
- ("read_only_space", 0x02c29): (125, "OrderedNameDictionaryMap"),
- ("read_only_space", 0x02c51): (173, "PreparseDataMap"),
- ("read_only_space", 0x02c79): (174, "PropertyArrayMap"),
- ("read_only_space", 0x02ca1): (94, "SideEffectCallHandlerInfoMap"),
- ("read_only_space", 0x02cc9): (94, "SideEffectFreeCallHandlerInfoMap"),
- ("read_only_space", 0x02cf1): (94, "NextCallSideEffectFreeCallHandlerInfoMap"),
- ("read_only_space", 0x02d19): (126, "SimpleNumberDictionaryMap"),
- ("read_only_space", 0x02d41): (149, "SmallOrderedHashMapMap"),
- ("read_only_space", 0x02d69): (150, "SmallOrderedHashSetMap"),
- ("read_only_space", 0x02d91): (151, "SmallOrderedNameDictionaryMap"),
- ("read_only_space", 0x02db9): (154, "SourceTextModuleMap"),
- ("read_only_space", 0x02de1): (180, "SwissNameDictionaryMap"),
- ("read_only_space", 0x02e09): (155, "SyntheticModuleMap"),
- ("read_only_space", 0x02e31): (71, "WasmTypeInfoMap"),
- ("read_only_space", 0x02e59): (184, "WeakArrayListMap"),
- ("read_only_space", 0x02e81): (119, "EphemeronHashTableMap"),
- ("read_only_space", 0x02ea9): (164, "EmbedderDataArrayMap"),
- ("read_only_space", 0x02ed1): (185, "WeakCellMap"),
- ("read_only_space", 0x02ef9): (32, "StringMap"),
- ("read_only_space", 0x02f21): (41, "ConsOneByteStringMap"),
- ("read_only_space", 0x02f49): (33, "ConsStringMap"),
- ("read_only_space", 0x02f71): (37, "ThinStringMap"),
- ("read_only_space", 0x02f99): (35, "SlicedStringMap"),
- ("read_only_space", 0x02fc1): (43, "SlicedOneByteStringMap"),
- ("read_only_space", 0x02fe9): (34, "ExternalStringMap"),
- ("read_only_space", 0x03011): (42, "ExternalOneByteStringMap"),
- ("read_only_space", 0x03039): (50, "UncachedExternalStringMap"),
- ("read_only_space", 0x03061): (0, "InternalizedStringMap"),
- ("read_only_space", 0x03089): (2, "ExternalInternalizedStringMap"),
- ("read_only_space", 0x030b1): (10, "ExternalOneByteInternalizedStringMap"),
- ("read_only_space", 0x030d9): (18, "UncachedExternalInternalizedStringMap"),
- ("read_only_space", 0x03101): (26, "UncachedExternalOneByteInternalizedStringMap"),
- ("read_only_space", 0x03129): (58, "UncachedExternalOneByteStringMap"),
- ("read_only_space", 0x03151): (67, "SelfReferenceMarkerMap"),
- ("read_only_space", 0x03179): (67, "BasicBlockCountersMarkerMap"),
- ("read_only_space", 0x031bd): (87, "ArrayBoilerplateDescriptionMap"),
- ("read_only_space", 0x032bd): (100, "InterceptorInfoMap"),
- ("read_only_space", 0x05411): (72, "PromiseFulfillReactionJobTaskMap"),
- ("read_only_space", 0x05439): (73, "PromiseRejectReactionJobTaskMap"),
- ("read_only_space", 0x05461): (74, "CallableTaskMap"),
- ("read_only_space", 0x05489): (75, "CallbackTaskMap"),
- ("read_only_space", 0x054b1): (76, "PromiseResolveThenableJobTaskMap"),
- ("read_only_space", 0x054d9): (79, "FunctionTemplateInfoMap"),
- ("read_only_space", 0x05501): (80, "ObjectTemplateInfoMap"),
- ("read_only_space", 0x05529): (81, "AccessCheckInfoMap"),
- ("read_only_space", 0x05551): (82, "AccessorInfoMap"),
- ("read_only_space", 0x05579): (83, "AccessorPairMap"),
- ("read_only_space", 0x055a1): (84, "AliasedArgumentsEntryMap"),
- ("read_only_space", 0x055c9): (85, "AllocationMementoMap"),
- ("read_only_space", 0x055f1): (88, "AsmWasmDataMap"),
- ("read_only_space", 0x05619): (89, "AsyncGeneratorRequestMap"),
- ("read_only_space", 0x05641): (90, "BaselineDataMap"),
- ("read_only_space", 0x05669): (91, "BreakPointMap"),
- ("read_only_space", 0x05691): (92, "BreakPointInfoMap"),
- ("read_only_space", 0x056b9): (93, "CachedTemplateObjectMap"),
- ("read_only_space", 0x056e1): (95, "ClassPositionsMap"),
- ("read_only_space", 0x05709): (96, "DebugInfoMap"),
- ("read_only_space", 0x05731): (99, "FunctionTemplateRareDataMap"),
- ("read_only_space", 0x05759): (101, "InterpreterDataMap"),
- ("read_only_space", 0x05781): (102, "ModuleRequestMap"),
- ("read_only_space", 0x057a9): (103, "PromiseCapabilityMap"),
- ("read_only_space", 0x057d1): (104, "PromiseReactionMap"),
- ("read_only_space", 0x057f9): (105, "PropertyDescriptorObjectMap"),
- ("read_only_space", 0x05821): (106, "PrototypeInfoMap"),
- ("read_only_space", 0x05849): (107, "RegExpBoilerplateDescriptionMap"),
- ("read_only_space", 0x05871): (108, "ScriptMap"),
- ("read_only_space", 0x05899): (109, "SourceTextModuleInfoEntryMap"),
- ("read_only_space", 0x058c1): (110, "StackFrameInfoMap"),
- ("read_only_space", 0x058e9): (111, "TemplateObjectDescriptionMap"),
- ("read_only_space", 0x05911): (112, "Tuple2Map"),
- ("read_only_space", 0x05939): (113, "WasmExceptionTagMap"),
- ("read_only_space", 0x05961): (114, "WasmExportedFunctionDataMap"),
- ("read_only_space", 0x05989): (115, "WasmIndirectFunctionTableMap"),
- ("read_only_space", 0x059b1): (116, "WasmJSFunctionDataMap"),
- ("read_only_space", 0x059d9): (135, "SloppyArgumentsElementsMap"),
- ("read_only_space", 0x05a01): (152, "DescriptorArrayMap"),
- ("read_only_space", 0x05a29): (157, "UncompiledDataWithoutPreparseDataMap"),
- ("read_only_space", 0x05a51): (156, "UncompiledDataWithPreparseDataMap"),
- ("read_only_space", 0x05a79): (172, "OnHeapBasicBlockProfilerDataMap"),
- ("read_only_space", 0x05aa1): (182, "WasmCapiFunctionDataMap"),
- ("read_only_space", 0x05ac9): (169, "InternalClassMap"),
- ("read_only_space", 0x05af1): (178, "SmiPairMap"),
- ("read_only_space", 0x05b19): (177, "SmiBoxMap"),
- ("read_only_space", 0x05b41): (146, "ExportedSubClassBaseMap"),
- ("read_only_space", 0x05b69): (147, "ExportedSubClassMap"),
- ("read_only_space", 0x05b91): (68, "AbstractInternalClassSubclass1Map"),
- ("read_only_space", 0x05bb9): (69, "AbstractInternalClassSubclass2Map"),
- ("read_only_space", 0x05be1): (133, "InternalClassWithSmiElementsMap"),
- ("read_only_space", 0x05c09): (170, "InternalClassWithStructElementsMap"),
- ("read_only_space", 0x05c31): (148, "ExportedSubClass2Map"),
- ("read_only_space", 0x05c59): (179, "SortStateMap"),
- ("read_only_space", 0x05c81): (86, "AllocationSiteWithWeakNextMap"),
- ("read_only_space", 0x05ca9): (86, "AllocationSiteWithoutWeakNextMap"),
- ("read_only_space", 0x05cd1): (77, "LoadHandler1Map"),
- ("read_only_space", 0x05cf9): (77, "LoadHandler2Map"),
- ("read_only_space", 0x05d21): (77, "LoadHandler3Map"),
- ("read_only_space", 0x05d49): (78, "StoreHandler0Map"),
- ("read_only_space", 0x05d71): (78, "StoreHandler1Map"),
- ("read_only_space", 0x05d99): (78, "StoreHandler2Map"),
- ("read_only_space", 0x05dc1): (78, "StoreHandler3Map"),
+ ("read_only_space", 0x02711): (165, "FeedbackVectorMap"),
+ ("read_only_space", 0x02749): (67, "ArgumentsMarkerMap"),
+ ("read_only_space", 0x027a9): (67, "ExceptionMap"),
+ ("read_only_space", 0x02805): (67, "TerminationExceptionMap"),
+ ("read_only_space", 0x0286d): (67, "OptimizedOutMap"),
+ ("read_only_space", 0x028cd): (67, "StaleRegisterMap"),
+ ("read_only_space", 0x0292d): (129, "ScriptContextTableMap"),
+ ("read_only_space", 0x02955): (127, "ClosureFeedbackCellArrayMap"),
+ ("read_only_space", 0x0297d): (164, "FeedbackMetadataArrayMap"),
+ ("read_only_space", 0x029a5): (117, "ArrayListMap"),
+ ("read_only_space", 0x029cd): (65, "BigIntMap"),
+ ("read_only_space", 0x029f5): (128, "ObjectBoilerplateDescriptionMap"),
+ ("read_only_space", 0x02a1d): (131, "BytecodeArrayMap"),
+ ("read_only_space", 0x02a45): (161, "CodeDataContainerMap"),
+ ("read_only_space", 0x02a6d): (162, "CoverageInfoMap"),
+ ("read_only_space", 0x02a95): (132, "FixedDoubleArrayMap"),
+ ("read_only_space", 0x02abd): (120, "GlobalDictionaryMap"),
+ ("read_only_space", 0x02ae5): (98, "ManyClosuresCellMap"),
+ ("read_only_space", 0x02b0d): (117, "ModuleInfoMap"),
+ ("read_only_space", 0x02b35): (121, "NameDictionaryMap"),
+ ("read_only_space", 0x02b5d): (98, "NoClosuresCellMap"),
+ ("read_only_space", 0x02b85): (122, "NumberDictionaryMap"),
+ ("read_only_space", 0x02bad): (98, "OneClosureCellMap"),
+ ("read_only_space", 0x02bd5): (123, "OrderedHashMapMap"),
+ ("read_only_space", 0x02bfd): (124, "OrderedHashSetMap"),
+ ("read_only_space", 0x02c25): (125, "OrderedNameDictionaryMap"),
+ ("read_only_space", 0x02c4d): (172, "PreparseDataMap"),
+ ("read_only_space", 0x02c75): (173, "PropertyArrayMap"),
+ ("read_only_space", 0x02c9d): (94, "SideEffectCallHandlerInfoMap"),
+ ("read_only_space", 0x02cc5): (94, "SideEffectFreeCallHandlerInfoMap"),
+ ("read_only_space", 0x02ced): (94, "NextCallSideEffectFreeCallHandlerInfoMap"),
+ ("read_only_space", 0x02d15): (126, "SimpleNumberDictionaryMap"),
+ ("read_only_space", 0x02d3d): (148, "SmallOrderedHashMapMap"),
+ ("read_only_space", 0x02d65): (149, "SmallOrderedHashSetMap"),
+ ("read_only_space", 0x02d8d): (150, "SmallOrderedNameDictionaryMap"),
+ ("read_only_space", 0x02db5): (153, "SourceTextModuleMap"),
+ ("read_only_space", 0x02ddd): (180, "SwissNameDictionaryMap"),
+ ("read_only_space", 0x02e05): (154, "SyntheticModuleMap"),
+ ("read_only_space", 0x02e2d): (71, "WasmTypeInfoMap"),
+ ("read_only_space", 0x02e55): (184, "WeakArrayListMap"),
+ ("read_only_space", 0x02e7d): (119, "EphemeronHashTableMap"),
+ ("read_only_space", 0x02ea5): (163, "EmbedderDataArrayMap"),
+ ("read_only_space", 0x02ecd): (185, "WeakCellMap"),
+ ("read_only_space", 0x02ef5): (32, "StringMap"),
+ ("read_only_space", 0x02f1d): (41, "ConsOneByteStringMap"),
+ ("read_only_space", 0x02f45): (33, "ConsStringMap"),
+ ("read_only_space", 0x02f6d): (37, "ThinStringMap"),
+ ("read_only_space", 0x02f95): (35, "SlicedStringMap"),
+ ("read_only_space", 0x02fbd): (43, "SlicedOneByteStringMap"),
+ ("read_only_space", 0x02fe5): (34, "ExternalStringMap"),
+ ("read_only_space", 0x0300d): (42, "ExternalOneByteStringMap"),
+ ("read_only_space", 0x03035): (50, "UncachedExternalStringMap"),
+ ("read_only_space", 0x0305d): (0, "InternalizedStringMap"),
+ ("read_only_space", 0x03085): (2, "ExternalInternalizedStringMap"),
+ ("read_only_space", 0x030ad): (10, "ExternalOneByteInternalizedStringMap"),
+ ("read_only_space", 0x030d5): (18, "UncachedExternalInternalizedStringMap"),
+ ("read_only_space", 0x030fd): (26, "UncachedExternalOneByteInternalizedStringMap"),
+ ("read_only_space", 0x03125): (58, "UncachedExternalOneByteStringMap"),
+ ("read_only_space", 0x0314d): (67, "SelfReferenceMarkerMap"),
+ ("read_only_space", 0x03175): (67, "BasicBlockCountersMarkerMap"),
+ ("read_only_space", 0x031b9): (87, "ArrayBoilerplateDescriptionMap"),
+ ("read_only_space", 0x032b9): (100, "InterceptorInfoMap"),
+ ("read_only_space", 0x05401): (72, "PromiseFulfillReactionJobTaskMap"),
+ ("read_only_space", 0x05429): (73, "PromiseRejectReactionJobTaskMap"),
+ ("read_only_space", 0x05451): (74, "CallableTaskMap"),
+ ("read_only_space", 0x05479): (75, "CallbackTaskMap"),
+ ("read_only_space", 0x054a1): (76, "PromiseResolveThenableJobTaskMap"),
+ ("read_only_space", 0x054c9): (79, "FunctionTemplateInfoMap"),
+ ("read_only_space", 0x054f1): (80, "ObjectTemplateInfoMap"),
+ ("read_only_space", 0x05519): (81, "AccessCheckInfoMap"),
+ ("read_only_space", 0x05541): (82, "AccessorInfoMap"),
+ ("read_only_space", 0x05569): (83, "AccessorPairMap"),
+ ("read_only_space", 0x05591): (84, "AliasedArgumentsEntryMap"),
+ ("read_only_space", 0x055b9): (85, "AllocationMementoMap"),
+ ("read_only_space", 0x055e1): (88, "AsmWasmDataMap"),
+ ("read_only_space", 0x05609): (89, "AsyncGeneratorRequestMap"),
+ ("read_only_space", 0x05631): (90, "BaselineDataMap"),
+ ("read_only_space", 0x05659): (91, "BreakPointMap"),
+ ("read_only_space", 0x05681): (92, "BreakPointInfoMap"),
+ ("read_only_space", 0x056a9): (93, "CachedTemplateObjectMap"),
+ ("read_only_space", 0x056d1): (95, "ClassPositionsMap"),
+ ("read_only_space", 0x056f9): (96, "DebugInfoMap"),
+ ("read_only_space", 0x05721): (99, "FunctionTemplateRareDataMap"),
+ ("read_only_space", 0x05749): (101, "InterpreterDataMap"),
+ ("read_only_space", 0x05771): (102, "ModuleRequestMap"),
+ ("read_only_space", 0x05799): (103, "PromiseCapabilityMap"),
+ ("read_only_space", 0x057c1): (104, "PromiseReactionMap"),
+ ("read_only_space", 0x057e9): (105, "PropertyDescriptorObjectMap"),
+ ("read_only_space", 0x05811): (106, "PrototypeInfoMap"),
+ ("read_only_space", 0x05839): (107, "RegExpBoilerplateDescriptionMap"),
+ ("read_only_space", 0x05861): (108, "ScriptMap"),
+ ("read_only_space", 0x05889): (109, "SourceTextModuleInfoEntryMap"),
+ ("read_only_space", 0x058b1): (110, "StackFrameInfoMap"),
+ ("read_only_space", 0x058d9): (111, "TemplateObjectDescriptionMap"),
+ ("read_only_space", 0x05901): (112, "Tuple2Map"),
+ ("read_only_space", 0x05929): (113, "WasmExceptionTagMap"),
+ ("read_only_space", 0x05951): (114, "WasmExportedFunctionDataMap"),
+ ("read_only_space", 0x05979): (115, "WasmIndirectFunctionTableMap"),
+ ("read_only_space", 0x059a1): (116, "WasmJSFunctionDataMap"),
+ ("read_only_space", 0x059c9): (134, "SloppyArgumentsElementsMap"),
+ ("read_only_space", 0x059f1): (151, "DescriptorArrayMap"),
+ ("read_only_space", 0x05a19): (156, "UncompiledDataWithoutPreparseDataMap"),
+ ("read_only_space", 0x05a41): (155, "UncompiledDataWithPreparseDataMap"),
+ ("read_only_space", 0x05a69): (171, "OnHeapBasicBlockProfilerDataMap"),
+ ("read_only_space", 0x05a91): (168, "InternalClassMap"),
+ ("read_only_space", 0x05ab9): (178, "SmiPairMap"),
+ ("read_only_space", 0x05ae1): (177, "SmiBoxMap"),
+ ("read_only_space", 0x05b09): (145, "ExportedSubClassBaseMap"),
+ ("read_only_space", 0x05b31): (146, "ExportedSubClassMap"),
+ ("read_only_space", 0x05b59): (68, "AbstractInternalClassSubclass1Map"),
+ ("read_only_space", 0x05b81): (69, "AbstractInternalClassSubclass2Map"),
+ ("read_only_space", 0x05ba9): (133, "InternalClassWithSmiElementsMap"),
+ ("read_only_space", 0x05bd1): (169, "InternalClassWithStructElementsMap"),
+ ("read_only_space", 0x05bf9): (147, "ExportedSubClass2Map"),
+ ("read_only_space", 0x05c21): (179, "SortStateMap"),
+ ("read_only_space", 0x05c49): (182, "WasmCapiFunctionDataMap"),
+ ("read_only_space", 0x05c71): (86, "AllocationSiteWithWeakNextMap"),
+ ("read_only_space", 0x05c99): (86, "AllocationSiteWithoutWeakNextMap"),
+ ("read_only_space", 0x05cc1): (77, "LoadHandler1Map"),
+ ("read_only_space", 0x05ce9): (77, "LoadHandler2Map"),
+ ("read_only_space", 0x05d11): (77, "LoadHandler3Map"),
+ ("read_only_space", 0x05d39): (78, "StoreHandler0Map"),
+ ("read_only_space", 0x05d61): (78, "StoreHandler1Map"),
+ ("read_only_space", 0x05d89): (78, "StoreHandler2Map"),
+ ("read_only_space", 0x05db1): (78, "StoreHandler3Map"),
("map_space", 0x02119): (1057, "ExternalMap"),
("map_space", 0x02141): (1098, "JSMessageObjectMap"),
}
@@ -406,37 +406,37 @@ KNOWN_OBJECTS = {
("read_only_space", 0x024cd): "FalseValue",
("read_only_space", 0x024fd): "empty_string",
("read_only_space", 0x02739): "EmptyScopeInfo",
- ("read_only_space", 0x02775): "ArgumentsMarker",
- ("read_only_space", 0x027d5): "Exception",
- ("read_only_space", 0x02831): "TerminationException",
- ("read_only_space", 0x02899): "OptimizedOut",
- ("read_only_space", 0x028f9): "StaleRegister",
- ("read_only_space", 0x031a1): "EmptyPropertyArray",
- ("read_only_space", 0x031a9): "EmptyByteArray",
- ("read_only_space", 0x031b1): "EmptyObjectBoilerplateDescription",
- ("read_only_space", 0x031e5): "EmptyArrayBoilerplateDescription",
- ("read_only_space", 0x031f1): "EmptyClosureFeedbackCellArray",
- ("read_only_space", 0x031f9): "EmptySlowElementDictionary",
- ("read_only_space", 0x0321d): "EmptyOrderedHashMap",
- ("read_only_space", 0x03231): "EmptyOrderedHashSet",
- ("read_only_space", 0x03245): "EmptyFeedbackMetadata",
- ("read_only_space", 0x03251): "EmptyPropertyDictionary",
- ("read_only_space", 0x03279): "EmptyOrderedPropertyDictionary",
- ("read_only_space", 0x03291): "EmptySwissPropertyDictionary",
- ("read_only_space", 0x032e5): "NoOpInterceptorInfo",
- ("read_only_space", 0x0330d): "EmptyWeakArrayList",
- ("read_only_space", 0x03319): "InfinityValue",
- ("read_only_space", 0x03325): "MinusZeroValue",
- ("read_only_space", 0x03331): "MinusInfinityValue",
- ("read_only_space", 0x0333d): "SelfReferenceMarker",
- ("read_only_space", 0x0337d): "BasicBlockCountersMarker",
- ("read_only_space", 0x033c1): "OffHeapTrampolineRelocationInfo",
- ("read_only_space", 0x033cd): "TrampolineTrivialCodeDataContainer",
- ("read_only_space", 0x033d9): "TrampolinePromiseRejectionCodeDataContainer",
- ("read_only_space", 0x033e5): "GlobalThisBindingScopeInfo",
- ("read_only_space", 0x0341d): "EmptyFunctionScopeInfo",
- ("read_only_space", 0x03445): "NativeScopeInfo",
- ("read_only_space", 0x03461): "HashSeed",
+ ("read_only_space", 0x02771): "ArgumentsMarker",
+ ("read_only_space", 0x027d1): "Exception",
+ ("read_only_space", 0x0282d): "TerminationException",
+ ("read_only_space", 0x02895): "OptimizedOut",
+ ("read_only_space", 0x028f5): "StaleRegister",
+ ("read_only_space", 0x0319d): "EmptyPropertyArray",
+ ("read_only_space", 0x031a5): "EmptyByteArray",
+ ("read_only_space", 0x031ad): "EmptyObjectBoilerplateDescription",
+ ("read_only_space", 0x031e1): "EmptyArrayBoilerplateDescription",
+ ("read_only_space", 0x031ed): "EmptyClosureFeedbackCellArray",
+ ("read_only_space", 0x031f5): "EmptySlowElementDictionary",
+ ("read_only_space", 0x03219): "EmptyOrderedHashMap",
+ ("read_only_space", 0x0322d): "EmptyOrderedHashSet",
+ ("read_only_space", 0x03241): "EmptyFeedbackMetadata",
+ ("read_only_space", 0x0324d): "EmptyPropertyDictionary",
+ ("read_only_space", 0x03275): "EmptyOrderedPropertyDictionary",
+ ("read_only_space", 0x0328d): "EmptySwissPropertyDictionary",
+ ("read_only_space", 0x032e1): "NoOpInterceptorInfo",
+ ("read_only_space", 0x03309): "EmptyWeakArrayList",
+ ("read_only_space", 0x03315): "InfinityValue",
+ ("read_only_space", 0x03321): "MinusZeroValue",
+ ("read_only_space", 0x0332d): "MinusInfinityValue",
+ ("read_only_space", 0x03339): "SelfReferenceMarker",
+ ("read_only_space", 0x03379): "BasicBlockCountersMarker",
+ ("read_only_space", 0x033bd): "OffHeapTrampolineRelocationInfo",
+ ("read_only_space", 0x033c9): "TrampolineTrivialCodeDataContainer",
+ ("read_only_space", 0x033d5): "TrampolinePromiseRejectionCodeDataContainer",
+ ("read_only_space", 0x033e1): "GlobalThisBindingScopeInfo",
+ ("read_only_space", 0x03415): "EmptyFunctionScopeInfo",
+ ("read_only_space", 0x03439): "NativeScopeInfo",
+ ("read_only_space", 0x03451): "HashSeed",
("old_space", 0x02119): "ArgumentsIteratorAccessor",
("old_space", 0x0215d): "ArrayLengthAccessor",
("old_space", 0x021a1): "BoundFunctionLengthAccessor",
diff --git a/chromium/v8/tools/v8windbg/BUILD.gn b/chromium/v8/tools/v8windbg/BUILD.gn
index 10d06a127f0..5618d2d9455 100644
--- a/chromium/v8/tools/v8windbg/BUILD.gn
+++ b/chromium/v8/tools/v8windbg/BUILD.gn
@@ -40,6 +40,8 @@ v8_shared_library("v8windbg") {
"base/dbgext.def",
"src/cur-isolate.cc",
"src/cur-isolate.h",
+ "src/js-stack.cc",
+ "src/js-stack.h",
"src/list-chunks.cc",
"src/list-chunks.h",
"src/local-variables.cc",
diff --git a/chromium/v8/tools/v8windbg/README.md b/chromium/v8/tools/v8windbg/README.md
index dc0c4e10407..de6638e4d43 100644
--- a/chromium/v8/tools/v8windbg/README.md
+++ b/chromium/v8/tools/v8windbg/README.md
@@ -43,6 +43,8 @@ functions that can be called from within `dx` commands:
current thread has a JavaScript Isolate associated.
- `@$listchunks()` returns a list of the memory chunks in the Heap for the
current Isolate.
+- `@$jsstack()` returns a list of the JS stack frames, including information
+about script and function.
*Tip:*: to see what objects are present in a chunk of heap memory, you can cast
it to an array of `TaggedValue`, like this:
@@ -67,6 +69,8 @@ functions declared in `dbgext.h` to create and destroy the extension instance.
- `cur-isolate.{cc,h}` implements the `IModelMethod` for `@$curisolate()`.
- `list-chunks.{cc,h}` implements the `IModelMethod` for `@$listchunks()`. Its
result is a custom object that supports iteration and indexing.
+- `js-stack.{cc,h}` implements the `IModelMethod` for `@$jsstack()`. Its
+ result is a custom object that supports iteration and indexing.
- `local-variables.{cc,h}` implements the `IModelPropertyAccessor` that provides
content to show in the Locals pane for stack frames corresponding to builtins
or runtime-generated code.
diff --git a/chromium/v8/tools/v8windbg/src/cur-isolate.h b/chromium/v8/tools/v8windbg/src/cur-isolate.h
index 2be24ce7fd8..ad6b01a9467 100644
--- a/chromium/v8/tools/v8windbg/src/cur-isolate.h
+++ b/chromium/v8/tools/v8windbg/src/cur-isolate.h
@@ -17,7 +17,7 @@
HRESULT GetCurrentIsolate(WRL::ComPtr<IModelObject>& sp_result);
-constexpr wchar_t kIsolateKey[] = L"isolate_key_";
+constexpr wchar_t kIsolateKey[] = L"v8::internal::Isolate::isolate_key_";
constexpr wchar_t kIsolate[] = L"v8::internal::Isolate";
class CurrIsolateAlias
diff --git a/chromium/v8/tools/v8windbg/src/js-stack.cc b/chromium/v8/tools/v8windbg/src/js-stack.cc
new file mode 100644
index 00000000000..c309fe4aa31
--- /dev/null
+++ b/chromium/v8/tools/v8windbg/src/js-stack.cc
@@ -0,0 +1,229 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tools/v8windbg/src/js-stack.h"
+
+HRESULT GetJSStackFrames(WRL::ComPtr<IModelObject>& sp_result) {
+ sp_result = nullptr;
+
+ // Get the current context
+ WRL::ComPtr<IDebugHostContext> sp_host_context;
+ RETURN_IF_FAIL(sp_debug_host->GetCurrentContext(&sp_host_context));
+
+ WRL::ComPtr<IModelObject> sp_curr_thread;
+ RETURN_IF_FAIL(GetCurrentThread(sp_host_context, &sp_curr_thread));
+
+ WRL::ComPtr<IModelObject> sp_stack;
+ RETURN_IF_FAIL(sp_curr_thread->GetKeyValue(L"Stack", &sp_stack, nullptr));
+
+ RETURN_IF_FAIL(sp_stack->GetKeyValue(L"Frames", &sp_result, nullptr));
+
+ return S_OK;
+}
+
+// v8windbg!JSStackAlias::Call
+IFACEMETHODIMP JSStackAlias::Call(IModelObject* p_context_object,
+ ULONG64 arg_count,
+ _In_reads_(arg_count)
+ IModelObject** pp_arguments,
+ IModelObject** pp_result,
+ IKeyStore** pp_metadata) noexcept {
+ WRL::ComPtr<IDebugHostContext> sp_ctx;
+ RETURN_IF_FAIL(sp_debug_host->GetCurrentContext(&sp_ctx));
+
+ WRL::ComPtr<IModelObject> result;
+ RETURN_IF_FAIL(
+ sp_data_model_manager->CreateSyntheticObject(sp_ctx.Get(), &result));
+
+ auto sp_iterator{WRL::Make<StackFrames>()};
+
+ RETURN_IF_FAIL(result->SetConcept(
+ __uuidof(IIndexableConcept),
+ static_cast<IIndexableConcept*>(sp_iterator.Get()), nullptr));
+ RETURN_IF_FAIL(result->SetConcept(
+ __uuidof(IIterableConcept),
+ static_cast<IIterableConcept*>(sp_iterator.Get()), nullptr));
+
+ *pp_result = result.Detach();
+ if (pp_metadata) {
+ *pp_metadata = nullptr;
+ }
+ return S_OK;
+}
+
+FrameData::FrameData() = default;
+FrameData::~FrameData() = default;
+FrameData::FrameData(const FrameData&) = default;
+FrameData::FrameData(FrameData&&) = default;
+FrameData& FrameData::operator=(const FrameData&) = default;
+FrameData& FrameData::operator=(FrameData&&) = default;
+
+StackFrameIterator::StackFrameIterator(
+ WRL::ComPtr<IDebugHostContext>& host_context)
+ : sp_ctx_(host_context) {}
+StackFrameIterator::~StackFrameIterator() = default;
+
+HRESULT StackFrameIterator::PopulateFrameData() {
+ frames_.clear();
+ WRL::ComPtr<IModelObject> sp_frames;
+
+ RETURN_IF_FAIL(GetJSStackFrames(sp_frames));
+
+ // Iterate over the array of frames.
+ WRL::ComPtr<IIterableConcept> sp_iterable;
+ RETURN_IF_FAIL(
+ sp_frames->GetConcept(__uuidof(IIterableConcept), &sp_iterable, nullptr));
+
+ WRL::ComPtr<IModelIterator> sp_frame_iterator;
+ RETURN_IF_FAIL(sp_iterable->GetIterator(sp_frames.Get(), &sp_frame_iterator));
+
+ // Loop through all the frames in the array.
+ WRL::ComPtr<IModelObject> sp_frame;
+ while (sp_frame_iterator->GetNext(&sp_frame, 0, nullptr, nullptr) !=
+ E_BOUNDS) {
+ // Skip non-JS frame (frame that doesn't have a function_name).
+ WRL::ComPtr<IModelObject> sp_local_variables;
+ HRESULT hr =
+ sp_frame->GetKeyValue(L"LocalVariables", &sp_local_variables, nullptr);
+ if (FAILED(hr)) continue;
+
+ WRL::ComPtr<IModelObject> sp_currently_executing_jsfunction;
+ hr = sp_local_variables->GetKeyValue(L"currently_executing_jsfunction",
+ &sp_currently_executing_jsfunction,
+ nullptr);
+ if (FAILED(hr)) continue;
+
+ WRL::ComPtr<IModelObject> sp_function_name, sp_script_name,
+ sp_script_source, sp_function_character_offset;
+ RETURN_IF_FAIL(sp_local_variables->GetKeyValue(L"script_name",
+ &sp_script_name, nullptr));
+ RETURN_IF_FAIL(sp_local_variables->GetKeyValue(L"script_source",
+ &sp_script_source, nullptr));
+ RETURN_IF_FAIL(sp_local_variables->GetKeyValue(L"function_name",
+ &sp_function_name, nullptr));
+ RETURN_IF_FAIL(sp_local_variables->GetKeyValue(
+ L"function_character_offset", &sp_function_character_offset, nullptr));
+
+ FrameData frame_entry;
+ frame_entry.script_name = sp_script_name;
+ frame_entry.script_source = sp_script_source;
+ frame_entry.function_name = sp_function_name;
+ frame_entry.function_character_offset = sp_function_character_offset;
+ frames_.push_back(frame_entry);
+ }
+
+ return S_OK;
+}
+
+IFACEMETHODIMP StackFrameIterator::Reset() noexcept {
+ position_ = 0;
+ return S_OK;
+}
+
+IFACEMETHODIMP StackFrameIterator::GetNext(IModelObject** object,
+ ULONG64 dimensions,
+ IModelObject** indexers,
+ IKeyStore** metadata) noexcept {
+ if (dimensions > 1) return E_INVALIDARG;
+
+ if (position_ == 0) {
+ RETURN_IF_FAIL(PopulateFrameData());
+ }
+
+ if (metadata != nullptr) *metadata = nullptr;
+
+ WRL::ComPtr<IModelObject> sp_index, sp_value;
+
+ if (dimensions == 1) {
+ RETURN_IF_FAIL(CreateULong64(position_, &sp_index));
+ }
+
+ RETURN_IF_FAIL(GetAt(position_, &sp_value));
+
+ // Now update counter and transfer ownership of results, because nothing can
+ // fail from this point onward.
+ ++position_;
+ if (dimensions == 1) {
+ *indexers = sp_index.Detach();
+ }
+ *object = sp_value.Detach();
+ return S_OK;
+}
+
+HRESULT StackFrameIterator::GetAt(uint64_t index, IModelObject** result) const {
+ if (index >= frames_.size()) return E_BOUNDS;
+
+ // Create the synthetic object representing the frame here.
+ const FrameData& curr_frame = frames_.at(index);
+ WRL::ComPtr<IModelObject> sp_value;
+ RETURN_IF_FAIL(
+ sp_data_model_manager->CreateSyntheticObject(sp_ctx_.Get(), &sp_value));
+ RETURN_IF_FAIL(
+ sp_value->SetKey(L"script_name", curr_frame.script_name.Get(), nullptr));
+ RETURN_IF_FAIL(sp_value->SetKey(L"script_source",
+ curr_frame.script_source.Get(), nullptr));
+ RETURN_IF_FAIL(sp_value->SetKey(L"function_name",
+ curr_frame.function_name.Get(), nullptr));
+ RETURN_IF_FAIL(sp_value->SetKey(L"function_character_offset",
+ curr_frame.function_character_offset.Get(),
+ nullptr));
+
+ *result = sp_value.Detach();
+ return S_OK;
+}
+
+StackFrames::StackFrames() = default;
+StackFrames::~StackFrames() = default;
+
+IFACEMETHODIMP StackFrames::GetDimensionality(
+ IModelObject* context_object, ULONG64* dimensionality) noexcept {
+ *dimensionality = 1;
+ return S_OK;
+}
+
+IFACEMETHODIMP StackFrames::GetAt(IModelObject* context_object,
+ ULONG64 indexer_count,
+ IModelObject** indexers,
+ IModelObject** object,
+ IKeyStore** metadata) noexcept {
+ if (indexer_count != 1) return E_INVALIDARG;
+ if (metadata != nullptr) *metadata = nullptr;
+ WRL::ComPtr<IDebugHostContext> sp_ctx;
+ RETURN_IF_FAIL(context_object->GetContext(&sp_ctx));
+
+ // This should be instantiated once for each synthetic object returned,
+ // so should be able to cache/reuse an iterator.
+ if (opt_frames_ == nullptr) {
+ opt_frames_ = WRL::Make<StackFrameIterator>(sp_ctx);
+ _ASSERT(opt_frames_ != nullptr);
+ RETURN_IF_FAIL(opt_frames_->PopulateFrameData());
+ }
+
+ uint64_t index;
+ RETURN_IF_FAIL(UnboxULong64(indexers[0], &index, true /*convert*/));
+
+ return opt_frames_->GetAt(index, object);
+}
+
+IFACEMETHODIMP StackFrames::SetAt(IModelObject* context_object,
+ ULONG64 indexer_count,
+ IModelObject** indexers,
+ IModelObject* value) noexcept {
+ return E_NOTIMPL;
+}
+
+IFACEMETHODIMP StackFrames::GetDefaultIndexDimensionality(
+ IModelObject* context_object, ULONG64* dimensionality) noexcept {
+ *dimensionality = 1;
+ return S_OK;
+}
+
+IFACEMETHODIMP StackFrames::GetIterator(IModelObject* context_object,
+ IModelIterator** iterator) noexcept {
+ WRL::ComPtr<IDebugHostContext> sp_ctx;
+ RETURN_IF_FAIL(context_object->GetContext(&sp_ctx));
+ auto sp_memory_iterator{WRL::Make<StackFrameIterator>(sp_ctx)};
+ *iterator = sp_memory_iterator.Detach();
+ return S_OK;
+}
diff --git a/chromium/v8/tools/v8windbg/src/js-stack.h b/chromium/v8/tools/v8windbg/src/js-stack.h
new file mode 100644
index 00000000000..cc6b11b34b3
--- /dev/null
+++ b/chromium/v8/tools/v8windbg/src/js-stack.h
@@ -0,0 +1,98 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_TOOLS_V8WINDBG_SRC_JS_STACK_H_
+#define V8_TOOLS_V8WINDBG_SRC_JS_STACK_H_
+
+#include <crtdbg.h>
+#include <wrl/implements.h>
+
+#include <string>
+#include <vector>
+
+#include "src/base/optional.h"
+#include "tools/v8windbg/base/utilities.h"
+#include "tools/v8windbg/src/v8-debug-helper-interop.h"
+#include "tools/v8windbg/src/v8windbg-extension.h"
+
+class JSStackAlias
+ : public WRL::RuntimeClass<
+ WRL::RuntimeClassFlags<WRL::RuntimeClassType::ClassicCom>,
+ IModelMethod> {
+ public:
+ IFACEMETHOD(Call)
+ (IModelObject* p_context_object, ULONG64 arg_count,
+ _In_reads_(arg_count) IModelObject** pp_arguments, IModelObject** pp_result,
+ IKeyStore** pp_metadata);
+};
+
+struct FrameData {
+ FrameData();
+ ~FrameData();
+ FrameData(const FrameData&);
+ FrameData(FrameData&&);
+ FrameData& operator=(const FrameData&);
+ FrameData& operator=(FrameData&&);
+ WRL::ComPtr<IModelObject> script_name;
+ WRL::ComPtr<IModelObject> script_source;
+ WRL::ComPtr<IModelObject> function_name;
+ WRL::ComPtr<IModelObject> function_character_offset;
+};
+
+class StackFrameIterator
+ : public WRL::RuntimeClass<
+ WRL::RuntimeClassFlags<WRL::RuntimeClassType::ClassicCom>,
+ IModelIterator> {
+ public:
+ StackFrameIterator(WRL::ComPtr<IDebugHostContext>& host_context);
+ ~StackFrameIterator() override;
+
+ HRESULT PopulateFrameData();
+
+ IFACEMETHOD(Reset)();
+
+ IFACEMETHOD(GetNext)
+ (IModelObject** object, ULONG64 dimensions, IModelObject** indexers,
+ IKeyStore** metadata);
+
+ HRESULT GetAt(uint64_t index, IModelObject** result) const;
+
+ private:
+ ULONG position_ = 0;
+ std::vector<FrameData> frames_;
+ WRL::ComPtr<IDebugHostContext> sp_ctx_;
+};
+
+class StackFrames
+ : public WRL::RuntimeClass<
+ WRL::RuntimeClassFlags<WRL::RuntimeClassType::ClassicCom>,
+ IIndexableConcept, IIterableConcept> {
+ public:
+ StackFrames();
+ ~StackFrames() override;
+
+ // IIndexableConcept members
+ IFACEMETHOD(GetDimensionality)
+ (IModelObject* context_object, ULONG64* dimensionality);
+
+ IFACEMETHOD(GetAt)
+ (IModelObject* context_object, ULONG64 indexer_count, IModelObject** indexers,
+ IModelObject** object, IKeyStore** metadata);
+
+ IFACEMETHOD(SetAt)
+ (IModelObject* context_object, ULONG64 indexer_count, IModelObject** indexers,
+ IModelObject* value);
+
+ // IIterableConcept
+ IFACEMETHOD(GetDefaultIndexDimensionality)
+ (IModelObject* context_object, ULONG64* dimensionality);
+
+ IFACEMETHOD(GetIterator)
+ (IModelObject* context_object, IModelIterator** iterator);
+
+ private:
+ WRL::ComPtr<StackFrameIterator> opt_frames_;
+};
+
+#endif // V8_TOOLS_V8WINDBG_SRC_JS_STACK_H_
diff --git a/chromium/v8/tools/v8windbg/src/v8windbg-extension.cc b/chromium/v8/tools/v8windbg/src/v8windbg-extension.cc
index 58a520cff1f..7fbe39d1920 100644
--- a/chromium/v8/tools/v8windbg/src/v8windbg-extension.cc
+++ b/chromium/v8/tools/v8windbg/src/v8windbg-extension.cc
@@ -8,12 +8,14 @@
#include "tools/v8windbg/base/utilities.h"
#include "tools/v8windbg/src/cur-isolate.h"
+#include "tools/v8windbg/src/js-stack.h"
#include "tools/v8windbg/src/list-chunks.h"
#include "tools/v8windbg/src/local-variables.h"
#include "tools/v8windbg/src/object-inspection.h"
std::unique_ptr<Extension> Extension::current_extension_ = nullptr;
const wchar_t* pcur_isolate = L"curisolate";
+const wchar_t* pjs_stack = L"jsstack";
const wchar_t* plist_chunks = L"listchunks";
const wchar_t* pv8_object = L"v8object";
@@ -260,6 +262,7 @@ HRESULT Extension::Initialize() {
// Register all function aliases.
std::vector<std::pair<const wchar_t*, WRL::ComPtr<IModelMethod>>> functions =
{{pcur_isolate, WRL::Make<CurrIsolateAlias>()},
+ {pjs_stack, WRL::Make<JSStackAlias>()},
{plist_chunks, WRL::Make<ListChunksAlias>()},
{pv8_object, WRL::Make<InspectV8ObjectMethod>()}};
for (const auto& function : functions) {
@@ -371,6 +374,7 @@ Extension::RegistrationType& Extension::RegistrationType::operator=(
Extension::~Extension() {
sp_debug_host_extensibility->DestroyFunctionAlias(pcur_isolate);
+ sp_debug_host_extensibility->DestroyFunctionAlias(pjs_stack);
sp_debug_host_extensibility->DestroyFunctionAlias(plist_chunks);
sp_debug_host_extensibility->DestroyFunctionAlias(pv8_object);
diff --git a/chromium/v8/tools/vim/ninja-build.vim b/chromium/v8/tools/vim/ninja-build.vim
index 7c885255ce9..e10da37759e 100644
--- a/chromium/v8/tools/vim/ninja-build.vim
+++ b/chromium/v8/tools/vim/ninja-build.vim
@@ -19,7 +19,7 @@
" Add the following to your .vimrc file:
" so /path/to/src/tools/vim/ninja-build.vim
-python << endpython
+pythonx << endpython
import os
import vim
@@ -47,7 +47,7 @@ def path_to_build_dir(configuration):
"""Returns <v8_root>/<output_dir>/(Release|Debug)."""
v8_root = path_to_source_root()
- sys.path.append(os.path.join(v8_root, 'tools', 'ninja'))
+ sys.path.append(os.path.join(v8_root, 'tools', 'vim'))
from ninja_output import GetNinjaOutputDirectory
return GetNinjaOutputDirectory(v8_root, configuration)
@@ -75,7 +75,11 @@ endpython
fun! s:MakeWithCustomCommand(build_cmd)
let l:oldmakepgr = &makeprg
let &makeprg=a:build_cmd
- silent make | cwindow
+ if exists(':Make') == 2
+ Make
+ else
+ silent make | cwindow
+ endif
if !has('gui_running')
redraw!
endif
@@ -83,11 +87,11 @@ fun! s:MakeWithCustomCommand(build_cmd)
endfun
fun! s:NinjaCommandForCurrentBuffer()
- python compute_ninja_command_for_current_buffer()
+ pythonx compute_ninja_command_for_current_buffer()
endfun
fun! s:NinjaCommandForTargets(targets)
- python compute_ninja_command_for_targets(vim.eval('a:targets'))
+ pythonx compute_ninja_command_for_targets(vim.eval('a:targets'))
endfun
fun! CrCompileFile()
diff --git a/chromium/v8/tools/vim/ninja_output.py b/chromium/v8/tools/vim/ninja_output.py
new file mode 100644
index 00000000000..09f1d7871d7
--- /dev/null
+++ b/chromium/v8/tools/vim/ninja_output.py
@@ -0,0 +1,72 @@
+# Copyright 2015 the V8 project authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from __future__ import print_function
+
+import sys
+import os
+import itertools
+import re
+
+try:
+ from exceptions import RuntimeError
+except ImportError:
+ pass
+
+
+def GetNinjaOutputDirectory(v8_root, configuration=None):
+ """Returns <v8_root>/<output_dir>/(Release|Debug|<other>).
+
+ The configuration chosen is the one most recently generated/built, but can be
+ overriden via the <configuration> parameter. Detects a custom output_dir
+ specified by GYP_GENERATOR_FLAGS."""
+
+ output_dirs = []
+
+ generator_flags = os.getenv('GYP_GENERATOR_FLAGS', '').split(' ')
+ for flag in generator_flags:
+ name_value = flag.split('=', 1)
+ if (len(name_value) == 2 and name_value[0] == 'output_dir' and
+ os.path.isdir(os.path.join(v8_root, name_value[1]))):
+ output_dirs = [name_value[1]]
+
+ if configuration:
+ output_dir = 'out' if len(output_dirs) == 0 else output_dirs[-1]
+ return os.path.join(os.path.join(v8_root, output_dir), configuration)
+
+ if not output_dirs:
+ for f in os.listdir(v8_root):
+ if re.match(r'out(\b|_)', f):
+ if os.path.isdir(os.path.join(v8_root, f)):
+ output_dirs.append(f)
+
+ def generate_paths():
+ for out_dir in output_dirs:
+ out_path = os.path.join(v8_root, out_dir)
+ for config in os.listdir(out_path):
+ path = os.path.join(out_path, config)
+ if os.path.exists(os.path.join(path, 'build.ninja')):
+ yield path
+
+ def approx_directory_mtime(path):
+ # This is a heuristic; don't recurse into subdirectories.
+ paths = [path] + [os.path.join(path, f) for f in os.listdir(path)]
+ return max(filter(None, [safe_mtime(p) for p in paths]))
+
+ def safe_mtime(path):
+ try:
+ return os.path.getmtime(path)
+ except OSError:
+ return None
+
+ try:
+ return max(generate_paths(), key=approx_directory_mtime)
+ except ValueError:
+ raise RuntimeError('Unable to find a valid ninja output directory.')
+
+
+if __name__ == '__main__':
+ if len(sys.argv) != 2:
+ raise RuntimeError('Expected a single path argument.')
+ print(GetNinjaOutputDirectory(sys.argv[1]))
diff --git a/chromium/v8/tools/wasm/update-wasm-spec-tests.sh b/chromium/v8/tools/wasm/update-wasm-spec-tests.sh
index 4d352754b73..df5348eb787 100755
--- a/chromium/v8/tools/wasm/update-wasm-spec-tests.sh
+++ b/chromium/v8/tools/wasm/update-wasm-spec-tests.sh
@@ -71,7 +71,7 @@ log_and_run cp -r ${TMP_DIR}/spec/test/js-api/* ${JS_API_TEST_DIR}/tests
# Generate the proposal tests.
###############################################################################
-repos='bulk-memory-operations reference-types js-types tail-call simd memory64'
+repos='js-types tail-call simd memory64'
for repo in ${repos}; do
echo "Process ${repo}"
diff --git a/chromium/v8/tools/whitespace.txt b/chromium/v8/tools/whitespace.txt
index 3332f7805be..61fd2e94864 100644
--- a/chromium/v8/tools/whitespace.txt
+++ b/chromium/v8/tools/whitespace.txt
@@ -7,11 +7,11 @@ A Smi balks into a war and says:
The doubles heard this and started to unbox.
The Smi looked at them when a crazy v8-autoroll account showed up...
The autoroller bought a round of Himbeerbrause. Suddenly.....
-The bartender starts to shake the bottles..........................
+The bartender starts to shake the bottles...........................
I can't add trailing whitespaces, so I'm adding this line...........
I'm starting to think that just adding trailing whitespaces might not be bad.
-Because whitespaces are not that funny.....
+Because whitespaces are not that funny......
Today's answer to life the universe and everything is 12950!
Today's answer to life the universe and everything is 6728!
Today's answer to life the universe and everything is 6728!!