diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-05-12 15:59:20 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-05-25 06:57:22 +0000 |
commit | f7eaed5286974984ba5f9e3189d8f49d03e99f81 (patch) | |
tree | caed19b2af2024f35449fb0b781d0a25e09d4f8f /chromium/v8/tools | |
parent | 9729c4479fe23554eae6e6dd1f30ff488f470c84 (diff) | |
download | qtwebengine-chromium-f7eaed5286974984ba5f9e3189d8f49d03e99f81.tar.gz |
BASELINE: Update Chromium to 100.0.4896.167
Change-Id: I98cbeb5d7543d966ffe04d8cefded0c493a11333
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/tools')
72 files changed, 2130 insertions, 1007 deletions
diff --git a/chromium/v8/tools/clusterfuzz/PRESUBMIT.py b/chromium/v8/tools/clusterfuzz/PRESUBMIT.py deleted file mode 100644 index a98bb244136..00000000000 --- a/chromium/v8/tools/clusterfuzz/PRESUBMIT.py +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright 2018 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. - -def CheckChangeOnCommit(input_api, output_api): - tests = input_api.canned_checks.GetUnitTestsInDirectory( - input_api, output_api, '.', files_to_check=['v8_foozzie_test.py$']) - return input_api.RunTests(tests) diff --git a/chromium/v8/tools/clusterfuzz/BUILD.gn b/chromium/v8/tools/clusterfuzz/foozzie/BUILD.gn index 54e4fded96f..90113e5aa4f 100644 --- a/chromium/v8/tools/clusterfuzz/BUILD.gn +++ b/chromium/v8/tools/clusterfuzz/foozzie/BUILD.gn @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("../../gni/v8.gni") +import("../../../gni/v8.gni") if (v8_correctness_fuzzer) { copy("v8_correctness_fuzzer_resources") { diff --git a/chromium/v8/tools/clusterfuzz/foozzie/PRESUBMIT.py b/chromium/v8/tools/clusterfuzz/foozzie/PRESUBMIT.py new file mode 100644 index 00000000000..6d4cab3de4c --- /dev/null +++ b/chromium/v8/tools/clusterfuzz/foozzie/PRESUBMIT.py @@ -0,0 +1,24 @@ +# Copyright 2018 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 json + + +def _RunTests(input_api, output_api): + return input_api.RunTests(input_api.canned_checks.GetUnitTestsInDirectory( + input_api, output_api, '.', files_to_check=['v8_foozzie_test.py$'])) + +def _CommonChecks(input_api, output_api): + """Checks common to both upload and commit.""" + checks = [ + _RunTests, + ] + + return sum([check(input_api, output_api) for check in checks], []) + +def CheckChangeOnCommit(input_api, output_api): + return _CommonChecks(input_api, output_api) + +def CheckChangeOnUpload(input_api, output_api): + return _CommonChecks(input_api, output_api) diff --git a/chromium/v8/tools/clusterfuzz/toolchain/BUILD.gn b/chromium/v8/tools/clusterfuzz/foozzie/toolchain/BUILD.gn index ddcb4e1ad2c..ddcb4e1ad2c 100644 --- a/chromium/v8/tools/clusterfuzz/toolchain/BUILD.gn +++ b/chromium/v8/tools/clusterfuzz/foozzie/toolchain/BUILD.gn diff --git a/chromium/v8/tools/clusterfuzz/v8_commands.py b/chromium/v8/tools/clusterfuzz/foozzie/v8_commands.py index f03161c2c48..f03161c2c48 100644 --- a/chromium/v8/tools/clusterfuzz/v8_commands.py +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_commands.py diff --git a/chromium/v8/tools/clusterfuzz/v8_foozzie.py b/chromium/v8/tools/clusterfuzz/foozzie/v8_foozzie.py index 656bc89ed34..656bc89ed34 100755 --- a/chromium/v8/tools/clusterfuzz/v8_foozzie.py +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_foozzie.py diff --git a/chromium/v8/tools/clusterfuzz/v8_foozzie_harness_adjust.js b/chromium/v8/tools/clusterfuzz/foozzie/v8_foozzie_harness_adjust.js index b81f8dd952a..b81f8dd952a 100644 --- a/chromium/v8/tools/clusterfuzz/v8_foozzie_harness_adjust.js +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_foozzie_harness_adjust.js diff --git a/chromium/v8/tools/clusterfuzz/v8_foozzie_test.py b/chromium/v8/tools/clusterfuzz/foozzie/v8_foozzie_test.py index a8ba74364bc..a8ba74364bc 100755 --- a/chromium/v8/tools/clusterfuzz/v8_foozzie_test.py +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_foozzie_test.py diff --git a/chromium/v8/tools/clusterfuzz/v8_fuzz_config.py b/chromium/v8/tools/clusterfuzz/foozzie/v8_fuzz_config.py index 99439a9d667..99439a9d667 100644 --- a/chromium/v8/tools/clusterfuzz/v8_fuzz_config.py +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_fuzz_config.py diff --git a/chromium/v8/tools/clusterfuzz/v8_fuzz_experiments.json b/chromium/v8/tools/clusterfuzz/foozzie/v8_fuzz_experiments.json index 8c6baa24968..8c6baa24968 100644 --- a/chromium/v8/tools/clusterfuzz/v8_fuzz_experiments.json +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_fuzz_experiments.json diff --git a/chromium/v8/tools/clusterfuzz/v8_fuzz_flags.json b/chromium/v8/tools/clusterfuzz/foozzie/v8_fuzz_flags.json index 7aefe692672..077473b1dd4 100644 --- a/chromium/v8/tools/clusterfuzz/v8_fuzz_flags.json +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_fuzz_flags.json @@ -27,8 +27,9 @@ [0.1, "--no-enable-popcnt"], [0.25, "--no-lazy-feedback-allocation"], [0.1, "--no-lazy-feedback-allocation --interrupt-budget=100"], - [0.05, "--budget-for-feedback-vector-allocation=0"], + [0.05, "--interrupt-budget-for-feedback-allocation=0"], [0.1, "--no-wasm-generic-wrapper"], [0.1, "--turbo-force-mid-tier-regalloc"], - [0.0001, "--simulate-errors"] + [0.0001, "--simulate-errors"], + [0.25, "--compact-map-space"] ] diff --git a/chromium/v8/tools/clusterfuzz/v8_mock.js b/chromium/v8/tools/clusterfuzz/foozzie/v8_mock.js index 41f1901d5d6..41f1901d5d6 100644 --- a/chromium/v8/tools/clusterfuzz/v8_mock.js +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_mock.js diff --git a/chromium/v8/tools/clusterfuzz/v8_mock_archs.js b/chromium/v8/tools/clusterfuzz/foozzie/v8_mock_archs.js index 3482e8c4c67..3482e8c4c67 100644 --- a/chromium/v8/tools/clusterfuzz/v8_mock_archs.js +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_mock_archs.js diff --git a/chromium/v8/tools/clusterfuzz/v8_mock_webassembly.js b/chromium/v8/tools/clusterfuzz/foozzie/v8_mock_webassembly.js index 594e6e70040..594e6e70040 100644 --- a/chromium/v8/tools/clusterfuzz/v8_mock_webassembly.js +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_mock_webassembly.js diff --git a/chromium/v8/tools/clusterfuzz/v8_smoke_tests.js b/chromium/v8/tools/clusterfuzz/foozzie/v8_smoke_tests.js index 2c5fab338d3..2c5fab338d3 100644 --- a/chromium/v8/tools/clusterfuzz/v8_smoke_tests.js +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_smoke_tests.js diff --git a/chromium/v8/tools/clusterfuzz/v8_suppressions.js b/chromium/v8/tools/clusterfuzz/foozzie/v8_suppressions.js index d73ce04d458..d73ce04d458 100644 --- a/chromium/v8/tools/clusterfuzz/v8_suppressions.js +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_suppressions.js diff --git a/chromium/v8/tools/clusterfuzz/v8_suppressions.py b/chromium/v8/tools/clusterfuzz/foozzie/v8_suppressions.py index 18f9de7ac1d..18f9de7ac1d 100644 --- a/chromium/v8/tools/clusterfuzz/v8_suppressions.py +++ b/chromium/v8/tools/clusterfuzz/foozzie/v8_suppressions.py diff --git a/chromium/v8/tools/clusterfuzz/trials/BUILD.gn b/chromium/v8/tools/clusterfuzz/trials/BUILD.gn new file mode 100644 index 00000000000..d3c8bf6aab3 --- /dev/null +++ b/chromium/v8/tools/clusterfuzz/trials/BUILD.gn @@ -0,0 +1,8 @@ +# Copyright 2022 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. + +copy("v8_clusterfuzz_resources") { + sources = [ "clusterfuzz_trials_config.json" ] + outputs = [ "$root_out_dir/{{source_file_part}}" ] +} diff --git a/chromium/v8/tools/clusterfuzz/trials/PRESUBMIT.py b/chromium/v8/tools/clusterfuzz/trials/PRESUBMIT.py new file mode 100644 index 00000000000..866790e5eca --- /dev/null +++ b/chromium/v8/tools/clusterfuzz/trials/PRESUBMIT.py @@ -0,0 +1,54 @@ +# Copyright 2022 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 json + +try: + basestring # Python 2 +except NameError: # Python 3 + basestring = str + + +def _CheckTrialsConfig(input_api, output_api): + def FilterFile(affected_file): + return input_api.FilterSourceFile( + affected_file, + files_to_check=(r'.+clusterfuzz_trials_config\.json',)) + + results = [] + for f in input_api.AffectedFiles( + file_filter=FilterFile, include_deletes=False): + with open(f.AbsoluteLocalPath()) as j: + try: + trials = json.load(j) + for trial in trials: + if not all (k in trial for k in ('app_args', 'app_name', 'probability')): + results.append('trial %s is not configured correctly' % trial) + if trial['app_name'] != 'd8': + results.append('trial %s has an incorrect app_name' % trial) + if not isinstance(trial['probability'], float): + results.append('trial %s probability is not a float' % trial) + if not (0 <= trial['probability'] <= 1): + results.append('trial %s has invalid probability value' % trial) + if not isinstance(trial['app_args'], basestring) or not trial['app_args']: + results.append('trial %s should have a non-empty string for app_args' % trial) + except Exception as e: + results.append( + 'JSON validation failed for %s. Error:\n%s' % (f.LocalPath(), e)) + + return [output_api.PresubmitError(r) for r in results] + +def _CommonChecks(input_api, output_api): + """Checks common to both upload and commit.""" + checks = [ + _CheckTrialsConfig, + ] + + return sum([check(input_api, output_api) for check in checks], []) + +def CheckChangeOnCommit(input_api, output_api): + return _CommonChecks(input_api, output_api) + +def CheckChangeOnUpload(input_api, output_api): + return _CommonChecks(input_api, output_api) diff --git a/chromium/v8/tools/clusterfuzz/trials/clusterfuzz_trials_config.json b/chromium/v8/tools/clusterfuzz/trials/clusterfuzz_trials_config.json new file mode 100644 index 00000000000..ed612ea7f2f --- /dev/null +++ b/chromium/v8/tools/clusterfuzz/trials/clusterfuzz_trials_config.json @@ -0,0 +1,38 @@ +[ + {"app_args": "--assert-types", "app_name": "d8", "probability": 0.25}, + {"app_args": "--interrupt-budget-for-feedback-vector-allocation=0", "app_name": "d8", "probability": 0.05}, + {"app_args": "--compact-map-space", "app_name": "d8", "probability": 0.25}, + {"app_args": "--force-slow-path", "app_name": "d8", "probability": 0.05}, + {"app_args": "--future", "app_name": "d8", "probability": 0.25}, + {"app_args": "--interrupt-budget=1000", "app_name": "d8", "probability": 0.25}, + {"app_args": "--jitless", "app_name": "d8", "probability": 0.1}, + {"app_args": "--random-gc-interval=2000", "app_name": "d8", "probability": 0.05}, + {"app_args": "--noanalyze-environment-liveness", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-avx", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-bmi1", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-bmi2", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-fma3", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-lzcnt", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-popcnt", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-sahf", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-sse3", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-sse4_1", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-sse4_2", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-enable-ssse3", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-lazy-feedback-allocation", "app_name": "d8", "probability": 0.35}, + {"app_args": "--no-regexp-tier-up", "app_name": "d8", "probability": 0.2}, + {"app_args": "--no-untrusted-code-mitigations", "app_name": "d8", "probability": 0.1}, + {"app_args": "--no-use-ic", "app_name": "d8", "probability": 0.25}, + {"app_args": "--no-wasm-generic-wrapper", "app_name": "d8", "probability": 0.1}, + {"app_args": "--regexp-interpret-all", "app_name": "d8", "probability": 0.1}, + {"app_args": "--simulate-errors", "app_name": "d8", "probability": 0.001}, + {"app_args": "--stress-compaction-random", "app_name": "d8", "probability": 0.05}, + {"app_args": "--stress-concurrent-inlining", "app_name": "d8", "probability": 0.25}, + {"app_args": "--stress-concurrent-inlining-attach-code", "app_name": "d8", "probability": 0.25}, + {"app_args": "--stress-flush-code", "app_name": "d8", "probability": 0.25}, + {"app_args": "--stress-marking=100", "app_name": "d8", "probability": 0.05}, + {"app_args": "--stress-scavenge=100", "app_name": "d8", "probability": 0.05}, + {"app_args": "--turbo-instruction-scheduling", "app_name": "d8", "probability": 0.1}, + {"app_args": "--turbo-stress-instruction-scheduling", "app_name": "d8", "probability": 0.1}, + {"app_args": "--wasm-code-gc --stress-wasm-code-gc", "app_name": "d8", "probability": 0.1} +] diff --git a/chromium/v8/tools/compare_torque_output.py b/chromium/v8/tools/compare_torque_output.py index 50e93a7538d..4ef01217dc6 100644 --- a/chromium/v8/tools/compare_torque_output.py +++ b/chromium/v8/tools/compare_torque_output.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # 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. diff --git a/chromium/v8/tools/debug_helper/debug-macro-shims.h b/chromium/v8/tools/debug_helper/debug-macro-shims.h index 948482810b6..02deb3d766f 100644 --- a/chromium/v8/tools/debug_helper/debug-macro-shims.h +++ b/chromium/v8/tools/debug_helper/debug-macro-shims.h @@ -8,6 +8,7 @@ #ifndef V8_TORQUE_DEBUG_MACRO_SHIMS_H_ #define V8_TORQUE_DEBUG_MACRO_SHIMS_H_ +#include "src/numbers/integer-literal.h" #include "src/objects/smi.h" #include "tools/debug_helper/debug-helper-internal.h" @@ -66,6 +67,14 @@ inline Value<intptr_t> IntPtrMul(d::MemoryAccessor accessor, intptr_t a, intptr_t b) { return {d::MemoryAccessResult::kOk, a * b}; } +inline Value<bool> IntPtrLessThan(d::MemoryAccessor accessor, intptr_t a, + intptr_t b) { + return {d::MemoryAccessResult::kOk, a < b}; +} +inline Value<bool> IntPtrLessThanOrEqual(d::MemoryAccessor accessor, intptr_t a, + intptr_t b) { + return {d::MemoryAccessResult::kOk, a <= b}; +} inline Value<intptr_t> Signed(d::MemoryAccessor accessor, uintptr_t u) { return {d::MemoryAccessResult::kOk, static_cast<intptr_t>(u)}; } @@ -73,6 +82,9 @@ inline Value<int32_t> SmiUntag(d::MemoryAccessor accessor, uintptr_t s_t) { Smi s(s_t); return {d::MemoryAccessResult::kOk, s.value()}; } +inline Value<uintptr_t> SmiFromInt32(d::MemoryAccessor accessor, int32_t i) { + return {d::MemoryAccessResult::kOk, Smi::FromInt(i).ptr()}; +} inline Value<bool> UintPtrLessThan(d::MemoryAccessor accessor, uintptr_t a, uintptr_t b) { return {d::MemoryAccessResult::kOk, a < b}; @@ -93,6 +105,19 @@ inline Value<bool> Word32NotEqual(d::MemoryAccessor accessor, uint32_t a, uint32_t b) { return {d::MemoryAccessResult::kOk, a != b}; } +// This is used in a nested call where we cannot pass Value<int32_t>. +inline int31_t ConstexprIntegerLiteralToInt31(d::MemoryAccessor accessor, + const IntegerLiteral& i) { + return i.To<int32_t>(); +} +inline int32_t ConstexprIntegerLiteralToInt32(d::MemoryAccessor accessor, + const IntegerLiteral& i) { + return i.To<int32_t>(); +} +inline intptr_t ConstexprIntegerLiteralToIntptr(d::MemoryAccessor accessor, + const IntegerLiteral& i) { + return i.To<intptr_t>(); +} } // namespace CodeStubAssembler } // namespace TorqueDebugMacroShims diff --git a/chromium/v8/tools/debug_helper/get-object-properties.cc b/chromium/v8/tools/debug_helper/get-object-properties.cc index 10ef48cbbac..43a67941ac6 100644 --- a/chromium/v8/tools/debug_helper/get-object-properties.cc +++ b/chromium/v8/tools/debug_helper/get-object-properties.cc @@ -11,7 +11,7 @@ #include "src/execution/frames.h" #include "src/execution/isolate-utils.h" #include "src/objects/string-inl.h" -#include "src/security/external-pointer.h" +#include "src/sandbox/external-pointer.h" #include "src/strings/unicode-inl.h" #include "torque-generated/class-debug-readers.h" #include "torque-generated/debug-macros.h" @@ -350,7 +350,7 @@ class ReadStringVisitor : public TqObjectVisitor { ExternalPointer_t resource_data = GetOrFinish(object->GetResourceDataValue(accessor_)); #ifdef V8_COMPRESS_POINTERS - Isolate* isolate = GetIsolateForHeapSandbox( + Isolate* isolate = GetIsolateForSandbox( HeapObject::unchecked_cast(Object(heap_addresses_.any_heap_pointer))); uintptr_t data_address = static_cast<uintptr_t>(DecodeExternalPointer( isolate, resource_data, kExternalStringResourceDataTag)); diff --git a/chromium/v8/tools/dev/gm.py b/chromium/v8/tools/dev/gm.py index 613065d5b11..d16b4dd737a 100755 --- a/chromium/v8/tools/dev/gm.py +++ b/chromium/v8/tools/dev/gm.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # Copyright 2017 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. @@ -21,9 +21,6 @@ Flags are passed unchanged to the test runner. They must start with -- and must not contain spaces. """ # See HELP below for additional documentation. -# Note on Python3 compatibility: gm.py itself is Python3 compatible, but -# run-tests.py, which will be executed by the same binary, is not; hence -# the hashbang line at the top of this file explicitly requires Python2. from __future__ import print_function import errno @@ -43,7 +40,8 @@ BUILD_TARGETS_ALL = ["all"] # All arches that this script understands. ARCHES = ["ia32", "x64", "arm", "arm64", "mipsel", "mips64el", "ppc", "ppc64", - "riscv64", "s390", "s390x", "android_arm", "android_arm64", "loong64"] + "riscv64", "s390", "s390x", "android_arm", "android_arm64", "loong64", + "fuchsia_x64", "fuchsia_arm64"] # Arches that get built/run when you don't specify any. DEFAULT_ARCHES = ["ia32", "x64", "arm", "arm64"] # Modes that this script understands. @@ -291,7 +289,7 @@ class Config(object): cpu = "x86" if self.arch == "android_arm": cpu = "arm" - elif self.arch == "android_arm64": + elif self.arch == "android_arm64" or self.arch == "fuchsia_arm64": cpu = "arm64" elif self.arch == "arm64" and _GetMachine() in ("aarch64", "arm64"): # arm64 build host: @@ -310,7 +308,7 @@ class Config(object): def GetV8TargetCpu(self): if self.arch == "android_arm": v8_cpu = "arm" - elif self.arch == "android_arm64": + elif self.arch == "android_arm64" or self.arch == "fuchsia_arm64": v8_cpu = "arm64" elif self.arch in ("arm", "arm64", "mipsel", "mips64el", "ppc", "ppc64", "riscv64", "s390", "s390x", "loong64"): @@ -322,6 +320,8 @@ class Config(object): def GetTargetOS(self): if self.arch in ("android_arm", "android_arm64"): return ["target_os = \"android\""] + elif self.arch in ("fuchsia_x64", "fuchsia_arm64"): + return ["target_os = \"fuchsia\""] return [] def GetSpecialCompiler(self): diff --git a/chromium/v8/tools/gcmole/gcmole.py b/chromium/v8/tools/gcmole/gcmole.py index 3df0788adef..9b555632629 100644 --- a/chromium/v8/tools/gcmole/gcmole.py +++ b/chromium/v8/tools/gcmole/gcmole.py @@ -529,7 +529,7 @@ def main(args): #:n't use parallel python runner. "sequential": False, # Print commands to console before executing them. - "verbose": True, + "verbose": False, # Perform dead variable analysis. "dead_vars": True, # Enable verbose tracing from the plugin itself. diff --git a/chromium/v8/tools/gdbinit b/chromium/v8/tools/gdbinit index 4e26346afaa..3db2e42278e 100644 --- a/chromium/v8/tools/gdbinit +++ b/chromium/v8/tools/gdbinit @@ -161,16 +161,17 @@ end set disable-randomization off # Install a handler whenever the debugger stops due to a signal. It walks up the -# stack looking for V8_Dcheck and moves the frame to the one above it so it's -# immediately at the line of code that triggered the DCHECK. +# stack looking for V8_Dcheck / V8_Fatal / OS::DebugBreak frame and moves the +# frame to the one above it so it's immediately at the line of code that +# triggered the stop condition. python -def dcheck_stop_handler(event): +def v8_stop_handler(event): frame = gdb.selected_frame() select_frame = None message = None count = 0 - # limit stack scanning since they're usually shallow and otherwise stack - # overflows can be very slow. + # Limit stack scanning since the frames we look for are near the top anyway, + # and otherwise stack overflows can be very slow. while frame is not None and count < 7: count += 1 # If we are in a frame created by gdb (e.g. for `(gdb) call foo()`), gdb @@ -186,6 +187,8 @@ def dcheck_stop_handler(event): break if frame.name() is not None and frame.name().startswith('V8_Fatal'): select_frame = frame.older() + if frame.name() == 'v8::base::OS::DebugBreak': + select_frame = frame.older() frame = frame.older() if select_frame is not None: @@ -194,7 +197,7 @@ def dcheck_stop_handler(event): if message: print('DCHECK error: {}'.format(message)) -gdb.events.stop.connect(dcheck_stop_handler) +gdb.events.stop.connect(v8_stop_handler) end # Code imported from chromium/src/tools/gdb/gdbinit diff --git a/chromium/v8/tools/gen-keywords-gen-h.py b/chromium/v8/tools/gen-keywords-gen-h.py index 02750dc1096..97c91ee2894 100755 --- a/chromium/v8/tools/gen-keywords-gen-h.py +++ b/chromium/v8/tools/gen-keywords-gen-h.py @@ -83,7 +83,8 @@ def trim_and_dcheck_char_table(out): def use_isinrange(out): # Our IsInRange method is more efficient than checking for min/max length return checked_sub(r'if \(len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH\)', - r'if (IsInRange(len, MIN_WORD_LENGTH, MAX_WORD_LENGTH))', + r'if (base::IsInRange(len, MIN_WORD_LENGTH, ' + + r'MAX_WORD_LENGTH))', out) diff --git a/chromium/v8/tools/grokdump.py b/chromium/v8/tools/grokdump.py index 368580f0c3a..1d73b43aced 100755 --- a/chromium/v8/tools/grokdump.py +++ b/chromium/v8/tools/grokdump.py @@ -168,7 +168,7 @@ def FullDump(reader, heap): print("%s - %s" % (reader.FormatIntPtr(start), reader.FormatIntPtr(start + size))) print(start + size + 1); - for i in range(0, size, reader.PointerSize()): + for i in range(0, size, reader.MachinePointerSize()): slot = start + i maybe_address = reader.ReadUIntPtr(slot) heap_object = heap.FindObject(maybe_address) @@ -710,7 +710,7 @@ class MinidumpReader(object): def _FindObjdump(self, options): if options.objdump: - objdump_bin = options.objdump + objdump_bin = options.objdump else: objdump_bin = self._FindThirdPartyObjdump() if not objdump_bin or not os.path.exists(objdump_bin): @@ -722,29 +722,29 @@ class MinidumpReader(object): disasm.OBJDUMP_BIN = objdump_bin def _FindThirdPartyObjdump(self): - # Try to find the platform specific objdump - third_party_dir = os.path.join( - os.path.dirname(os.path.dirname(__file__)), 'third_party') - objdumps = [] - for root, dirs, files in os.walk(third_party_dir): - for file in files: - if file.endswith("objdump"): - objdumps.append(os.path.join(root, file)) - if self.arch == MD_CPU_ARCHITECTURE_ARM: - platform_filter = 'arm-linux' - elif self.arch == MD_CPU_ARCHITECTURE_ARM64: - platform_filter = 'aarch64' - else: - # use default otherwise - return None - print(("# Looking for platform specific (%s) objdump in " - "third_party directory.") % platform_filter) - objdumps = filter(lambda file: platform_filter in file >= 0, objdumps) - if len(objdumps) == 0: - print("# Could not find platform specific objdump in third_party.") - print("# Make sure you installed the correct SDK.") - return None - return objdumps[0] + # Try to find the platform specific objdump + third_party_dir = os.path.join( + os.path.dirname(os.path.dirname(__file__)), 'third_party') + objdumps = [] + for root, dirs, files in os.walk(third_party_dir): + for file in files: + if file.endswith("objdump"): + objdumps.append(os.path.join(root, file)) + if self.arch == MD_CPU_ARCHITECTURE_ARM: + platform_filter = 'arm-linux' + elif self.arch == MD_CPU_ARCHITECTURE_ARM64: + platform_filter = 'aarch64' + else: + # use default otherwise + return None + print(("# Looking for platform specific (%s) objdump in " + "third_party directory.") % platform_filter) + objdumps = filter(lambda file: platform_filter in file >= 0, objdumps) + if len(objdumps) == 0: + print("# Could not find platform specific objdump in third_party.") + print("# Make sure you installed the correct SDK.") + return None + return objdumps[0] def ContextDescriptor(self): if self.arch == MD_CPU_ARCHITECTURE_X86: @@ -765,7 +765,7 @@ class MinidumpReader(object): return self.FindLocation(address) is not None def IsAlignedAddress(self, address): - return (address % self.PointerSize()) == 0 + return (address % self.MachinePointerSize()) == 0 def IsExceptionStackAddress(self, address): if not self.IsAlignedAddress(address): return False @@ -804,11 +804,29 @@ class MinidumpReader(object): return (self.arch == MD_CPU_ARCHITECTURE_ARM64 or self.arch == MD_CPU_ARCHITECTURE_AMD64) + def IsPointerCompressed(self): + # Assume all 64-bit builds are pointer compressed. + return self.Is64() + + def Is32BitTagged(self): + return not self.Is64() or self.IsPointerCompressed() + + def ReadTagged(self, address): + if self.Is32BitTagged(): + return self.ReadU32(address) + return self.ReadU64(address) + def ReadUIntPtr(self, address): if self.Is64(): return self.ReadU64(address) return self.ReadU32(address) + def ReadSized(self, address, size): + if size == 8: + return self.ReadU64(address) + assert (size == 4) + return self.ReadU32(address) + def ReadBytes(self, address, size): location = self.FindLocation(address) return self.minidump[location:location + size] @@ -819,8 +837,10 @@ class MinidumpReader(object): return ctypes.c_uint32.from_buffer(self.minidump, location).value def ReadAsciiPtr(self, address): - ascii_content = [c if c >= '\x20' and c < '\x7f' else '.' - for c in self.ReadBytes(address, self.PointerSize())] + ascii_content = [ + c if c >= '\x20' and c < '\x7f' else '.' + for c in self.ReadBytes(address, self.MachinePointerSize()) + ] return ''.join(ascii_content) def ReadAsciiString(self, address): @@ -908,7 +928,7 @@ class MinidumpReader(object): def FindWord(self, word, alignment=0): def search_inside_region(reader, start, size, location): location = (location + alignment) & ~alignment - for i in range(size - self.PointerSize()): + for i in range(size - self.MachinePointerSize()): loc = location + i if reader._ReadWord(loc) == word: slot = start + (loc - location) @@ -920,7 +940,7 @@ class MinidumpReader(object): aligned_res = [] unaligned_res = [] def search_inside_region(reader, start, size, location): - for i in range(size - self.PointerSize()): + for i in range(size - self.MachinePointerSize()): loc = location + i if reader._ReadWord(loc) == word: slot = start + (loc - location) @@ -1023,11 +1043,21 @@ class MinidumpReader(object): return "%016x" % value return "%08x" % value - def PointerSize(self): + def FormatTagged(self, value): + if self.Is64() and not self.IsPointerCompressed(): + return "%016x" % value + return "%08x" % value + + def MachinePointerSize(self): if self.Is64(): return 8 return 4 + def TaggedPointerSize(self): + if self.IsPointerCompressed(): + return 4 + return self.MachinePointerSize() + def Register(self, name): return self.exception_context.__getattribute__(name) @@ -1173,11 +1203,11 @@ class HeapObject(object): instance_type) def ObjectField(self, offset): - field_value = self.heap.reader.ReadUIntPtr(self.address + offset) + field_value = self.heap.reader.ReadTagged(self.address + offset) return self.heap.FindObjectOrSmi(field_value) def SmiField(self, offset): - field_value = self.heap.reader.ReadUIntPtr(self.address + offset) + field_value = self.heap.reader.ReadTagged(self.address + offset) if self.heap.IsSmi(field_value): return self.heap.SmiUntag(field_value) return None @@ -1189,7 +1219,7 @@ class Map(HeapObject): # Instance Sizes def InstanceSizesOffset(self): - return self.heap.PointerSize() + return self.heap.TaggedPointerSize() def InstanceSizeOffset(self): return self.InstanceSizesOffset() @@ -1224,28 +1254,29 @@ class Map(HeapObject): return self.InstanceAttributesOffset() + self.heap.IntSize() def PrototypeOffset(self): - return self.BitField3Offset() + self.heap.PointerSize() + return self.BitField3Offset() + self.heap.TaggedPointerSize() def ConstructorOrBackPointerOffset(self): - return self.PrototypeOffset() + self.heap.PointerSize() + return self.PrototypeOffset() + self.heap.TaggedPointerSize() def TransitionsOrPrototypeInfoOffset(self): - return self.ConstructorOrBackPointerOffset() + self.heap.PointerSize() + return self.ConstructorOrBackPointerOffset() + self.heap.TaggedPointerSize() def DescriptorsOffset(self): - return self.TransitionsOrPrototypeInfoOffset() + self.heap.PointerSize() + return (self.TransitionsOrPrototypeInfoOffset() + + self.heap.TaggedPointerSize()) def CodeCacheOffset(self): - return self.DescriptorsOffset() + self.heap.PointerSize() + return self.DescriptorsOffset() + self.heap.TaggedPointerSize() def DependentCodeOffset(self): - return self.CodeCacheOffset() + self.heap.PointerSize() + return self.CodeCacheOffset() + self.heap.TaggedPointerSize() def ReadByte(self, offset): return self.heap.reader.ReadU8(self.address + offset) - def ReadWord(self, offset): - return self.heap.reader.ReadUIntPtr(self.address + offset) + def ReadSlot(self, offset): + return self.heap.reader.ReadTagged(self.address + offset) def Print(self, p): p.Print("Map(%08x)" % (self.address)) @@ -1264,7 +1295,7 @@ class Map(HeapObject): p.Print(" - kind: %s" % (self.Decode(3, 5, bitfield2))) - bitfield3 = self.ReadWord(self.BitField3Offset()) + bitfield3 = self.ReadSlot(self.BitField3Offset()) p.Print( " - EnumLength: %d NumberOfOwnDescriptors: %d OwnsDescriptors: %s" % ( @@ -1299,7 +1330,7 @@ class Map(HeapObject): class String(HeapObject): def LengthOffset(self): # First word after the map is the hash, the second is the length. - return self.heap.PointerSize() * 2 + return self.heap.TaggedPointerSize() * 2 def __init__(self, heap, map, address): HeapObject.__init__(self, heap, map, address) @@ -1317,7 +1348,7 @@ class String(HeapObject): class SeqString(String): def CharsOffset(self): - return self.heap.PointerSize() * 3 + return self.heap.TaggedPointerSize() * 3 def __init__(self, heap, map, address): String.__init__(self, heap, map, address) @@ -1360,10 +1391,10 @@ class ExternalString(String): class ConsString(String): def LeftOffset(self): - return self.heap.PointerSize() * 3 + return self.heap.TaggedPointerSize() * 3 def RightOffset(self): - return self.heap.PointerSize() * 4 + return self.heap.TaggedPointerSize() * 4 def __init__(self, heap, map, address): String.__init__(self, heap, map, address) @@ -1390,13 +1421,13 @@ class Oddball(HeapObject): ] def ToStringOffset(self): - return self.heap.PointerSize() + return self.heap.TaggedPointerSize() def ToNumberOffset(self): - return self.ToStringOffset() + self.heap.PointerSize() + return self.ToStringOffset() + self.heap.TaggedPointerSize() def KindOffset(self): - return self.ToNumberOffset() + self.heap.PointerSize() + return self.ToNumberOffset() + self.heap.TaggedPointerSize() def __init__(self, heap, map, address): HeapObject.__init__(self, heap, map, address) @@ -1418,13 +1449,13 @@ class Oddball(HeapObject): class FixedArray(HeapObject): def LengthOffset(self): - return self.heap.PointerSize() + return self.heap.TaggedPointerSize() def ElementsOffset(self): - return self.heap.PointerSize() * 2 + return self.heap.TaggedPointerSize() * 2 def MemberOffset(self, i): - return self.ElementsOffset() + self.heap.PointerSize() * i + return self.ElementsOffset() + self.heap.TaggedPointerSize() * i def Get(self, i): return self.ObjectField(self.MemberOffset(i)) @@ -1561,10 +1592,10 @@ class TransitionArray(object): class JSFunction(HeapObject): def CodeEntryOffset(self): - return 3 * self.heap.PointerSize() + return 3 * self.heap.TaggedPointerSize() def SharedOffset(self): - return 5 * self.heap.PointerSize() + return 5 * self.heap.TaggedPointerSize() def __init__(self, heap, map, address): HeapObject.__init__(self, heap, map, address) @@ -1611,19 +1642,19 @@ class JSFunction(HeapObject): class SharedFunctionInfo(HeapObject): def CodeOffset(self): - return 2 * self.heap.PointerSize() + return 2 * self.heap.TaggedPointerSize() def ScriptOffset(self): - return 7 * self.heap.PointerSize() + return 7 * self.heap.TaggedPointerSize() def InferredNameOffset(self): - return 9 * self.heap.PointerSize() + return 9 * self.heap.TaggedPointerSize() def EndPositionOffset(self): - return 12 * self.heap.PointerSize() + 4 * self.heap.IntSize() + return 12 * self.heap.TaggedPointerSize() + 4 * self.heap.IntSize() def StartPositionAndTypeOffset(self): - return 12 * self.heap.PointerSize() + 5 * self.heap.IntSize() + return 12 * self.heap.TaggedPointerSize() + 5 * self.heap.IntSize() def __init__(self, heap, map, address): HeapObject.__init__(self, heap, map, address) @@ -1631,7 +1662,7 @@ class SharedFunctionInfo(HeapObject): self.code = self.ObjectField(self.CodeOffset()) self.script = self.ObjectField(self.ScriptOffset()) self.inferred_name = self.ObjectField(self.InferredNameOffset()) - if heap.PointerSize() == 8: + if heap.TaggedPointerSize() == 8: start_position_and_type = \ heap.reader.ReadU32(self.StartPositionAndTypeOffset()) self.start_position = start_position_and_type >> 2 @@ -1653,10 +1684,10 @@ class SharedFunctionInfo(HeapObject): class Script(HeapObject): def SourceOffset(self): - return self.heap.PointerSize() + return self.heap.TaggedPointerSize() def NameOffset(self): - return self.SourceOffset() + self.heap.PointerSize() + return self.SourceOffset() + self.heap.TaggedPointerSize() def __init__(self, heap, map, address): HeapObject.__init__(self, heap, map, address) @@ -1666,10 +1697,10 @@ class Script(HeapObject): class CodeCache(HeapObject): def DefaultCacheOffset(self): - return self.heap.PointerSize() + return self.heap.TaggedPointerSize() def NormalTypeCacheOffset(self): - return self.DefaultCacheOffset() + self.heap.PointerSize() + return self.DefaultCacheOffset() + self.heap.TaggedPointerSize() def __init__(self, heap, map, address): HeapObject.__init__(self, heap, map, address) @@ -1689,12 +1720,12 @@ class Code(HeapObject): CODE_ALIGNMENT_MASK = (1 << 5) - 1 def InstructionSizeOffset(self): - return self.heap.PointerSize() + return self.heap.TaggedPointerSize() @staticmethod def HeaderSize(heap): - return (heap.PointerSize() + heap.IntSize() + \ - 4 * heap.PointerSize() + 3 * heap.IntSize() + \ + return (heap.TaggedPointerSize() + heap.IntSize() + \ + 4 * heap.TaggedPointerSize() + 3 * heap.IntSize() + \ Code.CODE_ALIGNMENT_MASK) & ~Code.CODE_ALIGNMENT_MASK def __init__(self, heap, map, address): @@ -1763,7 +1794,7 @@ class V8Heap(object): if not self.IsTaggedObjectAddress(tagged_address): return None address = tagged_address - 1 if not self.reader.IsValidAddress(address): return None - map_tagged_address = self.reader.ReadUIntPtr(address) + map_tagged_address = self.reader.ReadTagged(address) if tagged_address == map_tagged_address: # Meta map? meta_map = Map(self, None, address) @@ -1796,11 +1827,17 @@ class V8Heap(object): def IntSize(self): return 4 - def PointerSize(self): - return self.reader.PointerSize() + def MachinePointerSize(self): + return self.reader.MachinePointerSize() + + def TaggedPointerSize(self): + return self.reader.TaggedPointerSize() + + def IsPointerCompressed(self): + return self.reader.IsPointerCompressed() def ObjectAlignmentMask(self): - return self.PointerSize() - 1 + return self.TaggedPointerSize() - 1 def IsTaggedObjectAddress(self, address): return (address & self.ObjectAlignmentMask()) == 1 @@ -1829,13 +1866,14 @@ class V8Heap(object): return (address & self.ObjectAlignmentMask()) == 1 def IsSmi(self, tagged_address): - if self.reader.Is64(): + if self.reader.Is64() and not self.reader.IsPointerCompressed(): return (tagged_address & 0xFFFFFFFF) == 0 return not self.IsTaggedAddress(tagged_address) def SmiUntag(self, tagged_address): - if self.reader.Is64(): return tagged_address >> 32 - return tagged_address >> 1 + if self.reader.Is64() and not self.reader.IsPointerCompressed(): + return tagged_address >> 32 + return (tagged_address >> 1) & 0xFFFFFFFF def AddressTypeMarker(self, address): if not self.reader.IsValidAddress(address): return " " @@ -1858,7 +1896,7 @@ class V8Heap(object): if self.IsTaggedObjectAddress(address): address -= 1 if not self.reader.IsValidAlignedAddress(address): return None - offset = (address - slot) / self.PointerSize() + offset = (address - slot) / self.MachinePointerSize() lower_limit = -32 upper_limit = 128 @@ -1873,12 +1911,12 @@ class V8Heap(object): def FindObjectPointers(self, start=0, end=0): objects = set() def find_object_in_region(reader, start, size, location): - for slot in range(start, start+size, self.reader.PointerSize()): + for slot in range(start, start + size, self.reader.TaggedPointerSize()): if not self.reader.IsValidAddress(slot): break # Collect only tagged pointers (object) to tagged pointers (map) - tagged_address = self.reader.ReadUIntPtr(slot) + tagged_address = self.reader.ReadTagged(slot) if not self.IsValidTaggedObjectAddress(tagged_address): continue - map_address = self.reader.ReadUIntPtr(tagged_address - 1) + map_address = self.reader.ReadTagged(tagged_address - 1) if not self.IsTaggedMapAddress(map_address): continue objects.add(tagged_address) @@ -1951,10 +1989,12 @@ class InspectionInfo(object): exception_thread.stack.memory.data_size frame_pointer = self.reader.ExceptionFP() self.styles[frame_pointer] = "frame" - for slot in range(stack_top, stack_bottom, self.reader.PointerSize()): + for slot in range(stack_top, stack_bottom, + self.reader.MachinePointerSize()): # stack address self.styles[slot] = "sa" - for slot in range(stack_top, stack_bottom, self.reader.PointerSize()): + for slot in range(stack_top, stack_bottom, + self.reader.MachinePointerSize()): maybe_address = self.reader.ReadUIntPtr(slot) # stack value self.styles[maybe_address] = "sv" @@ -2026,7 +2066,7 @@ class InspectionPadawan(object): # Frame markers only occur directly after a frame pointer and only on the # stack. if not self.reader.IsExceptionStackAddress(slot): return False - next_slot = slot + self.reader.PointerSize() + next_slot = slot + self.reader.MachinePointerSize() if not self.reader.IsValidAddress(next_slot): return False next_address = self.reader.ReadUIntPtr(next_slot) return self.reader.IsExceptionStackAddress(next_address) @@ -2058,7 +2098,7 @@ class InspectionPadawan(object): if found_obj: return found_obj address = tagged_address - 1 if self.reader.IsValidAddress(address): - map_tagged_address = self.reader.ReadUIntPtr(address) + map_tagged_address = self.reader.ReadTagged(address) map = self.SenseMap(map_tagged_address) if map is None: return None instance_type_name = INSTANCE_TYPES.get(map.instance_type) @@ -2118,7 +2158,7 @@ class InspectionPadawan(object): Returns the first address where the normal stack starts again. """ # Only look at the first 1k words on the stack - ptr_size = self.reader.PointerSize() + ptr_size = self.reader.MachinePointerSize() if start is None: start = self.reader.ExceptionSP() if not self.reader.IsValidAddress(start): return start end = start + ptr_size * 1024 * 4 @@ -2140,7 +2180,7 @@ class InspectionPadawan(object): print_message) def TryExtractStackTrace(self, slot, start, end, print_message): - ptr_size = self.reader.PointerSize() + ptr_size = self.reader.MachinePointerSize() assert self.reader.ReadUIntPtr(slot) & 0xFFFFFFFF == STACK_TRACE_MARKER end_marker = STACK_TRACE_MARKER + 1; header_size = 10 @@ -2163,7 +2203,7 @@ class InspectionPadawan(object): return stack_start def FindPtr(self, expected_value, start, end): - ptr_size = self.reader.PointerSize() + ptr_size = self.reader.MachinePointerSize() for slot in range(start, end, ptr_size): if not self.reader.IsValidAddress(slot): return None value = self.reader.ReadUIntPtr(slot) @@ -2171,7 +2211,7 @@ class InspectionPadawan(object): return None def TryExtractErrorMessage(self, slot, start, end, print_message): - ptr_size = self.reader.PointerSize() + ptr_size = self.reader.MachinePointerSize() end_marker = ERROR_MESSAGE_MARKER + 1; header_size = 1 end_search = start + 1024 + (header_size * ptr_size); @@ -2186,7 +2226,7 @@ class InspectionPadawan(object): def TryExtractOldStyleStackTrace(self, message_slot, start, end, print_message): - ptr_size = self.reader.PointerSize() + ptr_size = self.reader.MachinePointerSize() if message_slot == 0: """ On Mac we don't always get proper magic markers, so just try printing @@ -2225,7 +2265,7 @@ class InspectionPadawan(object): print(" Use `dsa` to print the message with annotated addresses.") print("") return - ptr_size = self.reader.PointerSize() + ptr_size = self.reader.MachinePointerSize() # Annotate all addresses in the dumped message prog = re.compile("[0-9a-fA-F]{%s}" % ptr_size*2) addresses = list(set(prog.findall(message))) @@ -2252,7 +2292,7 @@ class InspectionPadawan(object): def TryInferContext(self, address): if self.context: return - ptr_size = self.reader.PointerSize() + ptr_size = self.reader.MachinePointerSize() possible_context = dict() count = 0 while self.reader.IsExceptionStackAddress(address): @@ -2287,7 +2327,7 @@ class InspectionPadawan(object): in_oom_dump_area = False is_stack = self.reader.IsExceptionStackAddress(start) free_space_end = 0 - ptr_size = self.reader.PointerSize() + ptr_size = self.reader.TaggedPointerSize() for slot in range(start, end, ptr_size): if not self.reader.IsValidAddress(slot): @@ -2309,7 +2349,7 @@ class InspectionPadawan(object): if isinstance(heap_object, KnownMap) and \ heap_object.known_name == "FreeSpaceMap": # The free-space length is is stored as a Smi in the next slot. - length = self.reader.ReadUIntPtr(slot + ptr_size) + length = self.reader.ReadTagged(slot + ptr_size) if self.heap.IsSmi(length): length = self.heap.SmiUntag(length) free_space_end = slot + length - ptr_size @@ -2711,7 +2751,8 @@ class InspectionWebFormatter(object): stack_bottom = exception_thread.stack.start + \ exception_thread.stack.memory.data_size stack_map = {self.reader.ExceptionIP(): -1} - for slot in range(stack_top, stack_bottom, self.reader.PointerSize()): + for slot in range(stack_top, stack_bottom, + self.reader.MachinePointerSize()): maybe_address = self.reader.ReadUIntPtr(slot) if not maybe_address in stack_map: stack_map[maybe_address] = slot @@ -2757,6 +2798,18 @@ class InspectionWebFormatter(object): return ("<a %s href=s?%s&val=%s>%s</a>" % (style_class, self.encfilename, straddress, straddress)) + def format_onheap_address(self, size, maybeaddress, uncompressed): + if maybeaddress is None: + return "not in dump" + else: + straddress = "0x" + self.reader.FormatTagged(maybeaddress) + struncompressed = "0x" + self.reader.FormatIntPtr(uncompressed) + style_class = "" + if not self.reader.IsValidAddress(maybeaddress): + style_class = "class=nd" + return ("<a %s href=s?%s&val=%s>%s</a>" % + (style_class, self.encfilename, struncompressed, straddress)) + def output_header(self, f): f.write(WEB_HEADER % { "query_dump" : self.encfilename, @@ -2779,7 +2832,8 @@ class InspectionWebFormatter(object): stack_bottom = min(exception_thread.stack.start + \ exception_thread.stack.memory.data_size, stack_top + self.MAX_CONTEXT_STACK) - self.output_words(f, stack_top - 16, stack_bottom, stack_top, "Stack") + self.output_words(f, stack_top - 16, stack_bottom, stack_top, "Stack", + self.heap.MachinePointerSize()) f.write('</div>') self.output_footer(f) @@ -2900,7 +2954,11 @@ class InspectionWebFormatter(object): return region = self.reader.FindRegion(address) if datakind == "address": - self.output_words(f, region[0], region[0] + region[1], address, "Dump") + self.output_words(f, region[0], region[0] + region[1], address, "Dump", + self.heap.MachinePointerSize()) + if datakind == "tagged": + self.output_words(f, region[0], region[0] + region[1], address, + "Tagged Dump", self.heap.TaggedPointerSize()) elif datakind == "ascii": self.output_ascii(f, region[0], region[0] + region[1], address) self.output_footer(f) @@ -2909,14 +2967,13 @@ class InspectionWebFormatter(object): f.write("<h3>Unrecognized address format \"%s\".</h3>" % straddress) return - def output_words(self, f, start_address, end_address, - highlight_address, desc): + def output_words(self, f, start_address, end_address, highlight_address, desc, + size): region = self.reader.FindRegion(highlight_address) if region is None: f.write("<h3>Address 0x%x not found in the dump.</h3>" % (highlight_address)) return - size = self.heap.PointerSize() start_address = self.align_down(start_address, size) low = self.align_down(region[0], size) high = self.align_up(region[0] + region[1], size) @@ -2943,6 +3000,7 @@ class InspectionWebFormatter(object): slot = start_address + j heap_object = "" maybe_address = None + maybe_uncompressed_address = None end_region = region[0] + region[1] if slot < region[0] or slot + size > end_region: straddress = "0x" @@ -2954,10 +3012,20 @@ class InspectionWebFormatter(object): for i in range(slot, region[0]): straddress += "??" else: - maybe_address = self.reader.ReadUIntPtr(slot) - straddress = self.format_address(maybe_address) - if maybe_address: - heap_object = self.format_object(maybe_address) + maybe_address = self.reader.ReadSized(slot, size) + if size == self.reader.MachinePointerSize(): + maybe_uncompressed_address = maybe_address + else: + maybe_uncompressed_address = (slot & (0xFFFFFF << 32)) | ( + maybe_address & 0xFFFFFF) + + if size == self.reader.TaggedPointerSize(): + straddress = self.format_onheap_address(size, maybe_address, + maybe_uncompressed_address) + if maybe_address: + heap_object = self.format_object(maybe_address) + else: + straddress = self.format_address(maybe_address) address_fmt = "%s </td>" if slot == highlight_address: @@ -2974,12 +3042,12 @@ class InspectionWebFormatter(object): f.write("</td>") self.td_from_address(f, slot) f.write(address_fmt % self.format_address(slot)) - self.td_from_address(f, maybe_address) + self.td_from_address(f, maybe_uncompressed_address) f.write(": %s </td>" % straddress) f.write("<td>") - if maybe_address != None: - self.output_comment_box( - f, "sv-" + self.reader.FormatIntPtr(slot), maybe_address) + if maybe_uncompressed_address != None: + self.output_comment_box(f, "sv-" + self.reader.FormatIntPtr(slot), + maybe_uncompressed_address) f.write("</td>") f.write("<td>%s</td>" % (heap_object or '')) f.write("</tr>") @@ -3134,9 +3202,9 @@ class InspectionWebFormatter(object): # Some disassemblers insert spaces between each byte, # while some do not. if code[2] == " ": - op_offset = 3 * num_bytes - 1 + op_offset = 3 * num_bytes - 1 else: - op_offset = 2 * num_bytes + op_offset = 2 * num_bytes # Compute the actual call target which the disassembler is too stupid # to figure out (it adds the call offset to the disassembly offset rather @@ -3230,7 +3298,12 @@ class InspectionWebFormatter(object): straddress) else: # Print as words - self.output_words(f, address - 8, address + 32, address, "Dump") + self.output_words(f, address - 8, address + 32, address, "Dump", + self.heap.MachinePointerSize()) + + if self.heap.IsPointerCompressed(): + self.output_words(f, address - 8, address + 32, address, + "Tagged Dump", self.heap.TaggedPointerSize()) # Print as ASCII f.write("<hr>") @@ -3534,10 +3607,10 @@ class InspectionShell(cmd.Cmd): self.dd_start = self.ParseAddressExpr(args[0]) self.dd_num = int(args[1], 16) if len(args) > 1 else 0x10 else: - self.dd_start += self.dd_num * self.reader.PointerSize() + self.dd_start += self.dd_num * self.reader.MachinePointerSize() if not self.reader.IsAlignedAddress(self.dd_start): print("Warning: Dumping un-aligned memory, is this what you had in mind?") - end = self.dd_start + self.reader.PointerSize() * self.dd_num + end = self.dd_start + self.reader.MachinePointerSize() * self.dd_num self.padawan.InterpretMemory(self.dd_start, end) def do_do(self, address): @@ -3828,7 +3901,7 @@ def AnalyzeMinidump(options, minidump_name): stack_top = reader.ExceptionSP() stack_bottom = reader.StackBottom() stack_map = {reader.ExceptionIP(): -1} - for slot in range(stack_top, stack_bottom, reader.PointerSize()): + for slot in range(stack_top, stack_bottom, reader.MachinePointerSize()): maybe_address = reader.ReadUIntPtr(slot) if not maybe_address in stack_map: stack_map[maybe_address] = slot diff --git a/chromium/v8/tools/heap-layout/heap-layout-viewer-template.html b/chromium/v8/tools/heap-layout/heap-layout-viewer-template.html new file mode 100644 index 00000000000..c50f5cc3d38 --- /dev/null +++ b/chromium/v8/tools/heap-layout/heap-layout-viewer-template.html @@ -0,0 +1,14 @@ +<!-- 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. --> + +<style> + #chart { + width: 100%; + height: 600px; + } +</style> +<div id="container" style="display: none;"> + <h2>V8 Heap Layout</h2> + <div id="chart"></div> +</div>
\ No newline at end of file diff --git a/chromium/v8/tools/heap-layout/heap-layout-viewer.mjs b/chromium/v8/tools/heap-layout/heap-layout-viewer.mjs new file mode 100644 index 00000000000..ada4a02311c --- /dev/null +++ b/chromium/v8/tools/heap-layout/heap-layout-viewer.mjs @@ -0,0 +1,225 @@ +// 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. + +import {GB, MB} from '../js/helper.mjs'; +import {DOM} from '../js/web-api-helper.mjs'; + +import {getColorFromSpaceName, kSpaceNames} from './space-categories.mjs'; + +DOM.defineCustomElement('heap-layout-viewer', + (templateText) => + class HeapLayoutViewer extends HTMLElement { + constructor() { + super(); + const shadowRoot = this.attachShadow({mode: 'open'}); + shadowRoot.innerHTML = templateText; + this.chart = echarts.init(this.$('#chart'), null, { + renderer: 'canvas', + }); + window.addEventListener('resize', () => { + this.chart.resize(); + }); + this.currentIndex = 0; + } + + $(id) { + return this.shadowRoot.querySelector(id); + } + + set data(value) { + this._data = value; + this.stateChanged(); + } + + get data() { + return this._data; + } + + hide() { + this.$('#container').style.display = 'none'; + } + + show() { + this.$('#container').style.display = 'block'; + } + + stateChanged() { + this.drawChart(0); + } + + getChartTitle(index) { + return this.data[index].header; + } + + getSeriesData(pageinfos) { + let ret = []; + for (let pageinfo of pageinfos) { + ret.push({value: pageinfo}); + } + return ret; + } + + getChartSeries(index) { + const snapshot = this.data[index]; + let series = []; + for (const [space_name, pageinfos] of Object.entries(snapshot.data)) { + let space_series = { + name: space_name, + type: 'custom', + renderItem(params, api) { + const addressBegin = api.value(1); + const addressEnd = api.value(2); + const allocated = api.value(3); + const start = api.coord([addressBegin, 0]); + const end = api.coord([addressEnd, 0]); + + const allocatedRate = allocated / (addressEnd - addressBegin); + const unAllocatedRate = 1 - allocatedRate; + + const standardH = api.size([0, 1])[1]; + const standardY = start[1] - standardH / 2; + + const allocatedY = standardY + standardH * unAllocatedRate; + const allocatedH = standardH * allocatedRate; + + const unAllocatedY = standardY; + const unAllocatedH = standardH - allocatedH; + + const allocatedShape = echarts.graphic.clipRectByRect( + { + x: start[0], + y: allocatedY, + width: end[0] - start[0], + height: allocatedH, + }, + { + x: params.coordSys.x, + y: params.coordSys.y, + width: params.coordSys.width, + height: params.coordSys.height, + }); + + const unAllocatedShape = echarts.graphic.clipRectByRect( + { + x: start[0], + y: unAllocatedY, + width: end[0] - start[0], + height: unAllocatedH, + }, + { + x: params.coordSys.x, + y: params.coordSys.y, + width: params.coordSys.width, + height: params.coordSys.height, + }); + + const ret = { + type: 'group', + children: [ + { + type: 'rect', + shape: allocatedShape, + style: api.style(), + }, + { + type: 'rect', + shape: unAllocatedShape, + style: { + fill: '#000000', + }, + }, + ], + }; + return ret; + }, + data: this.getSeriesData(pageinfos), + encode: { + x: [1, 2], + }, + itemStyle: { + color: getColorFromSpaceName(space_name), + }, + }; + series.push(space_series); + } + return series; + } + + drawChart(index) { + if (index >= this.data.length || index < 0) { + console.error('Invalid index:', index); + return; + } + const option = { + tooltip: { + formatter(params) { + const ret = params.marker + params.value[0] + '<br>' + + 'address:' + (params.value[1] / MB).toFixed(3) + 'MB' + + '<br>' + + 'size:' + ((params.value[2] - params.value[1]) / MB).toFixed(3) + + 'MB' + + '<br>' + + 'allocated:' + (params.value[3] / MB).toFixed(3) + 'MB' + + '<br>' + + 'wasted:' + params.value[4] + 'B'; + return ret; + }, + }, + grid: { + bottom: 120, + top: 120, + }, + dataZoom: [ + { + type: 'slider', + filterMode: 'weakFilter', + showDataShadow: true, + labelFormatter: '', + }, + { + type: 'inside', + filterMode: 'weakFilter', + }, + ], + legend: { + show: true, + data: kSpaceNames, + top: '6%', + type: 'scroll', + }, + title: { + text: this.getChartTitle(index), + left: 'center', + }, + xAxis: { + name: 'Address offset in heap(MB)', + nameLocation: 'center', + nameTextStyle: { + fontSize: 25, + padding: [30, 0, 50, 0], + }, + type: 'value', + min: 0, + max: 4 * GB, + axisLabel: { + rotate: 0, + formatter(value, index) { + value = value / MB; + value = value.toFixed(3); + return value; + }, + }, + }, + yAxis: { + data: ['Page'], + }, + series: this.getChartSeries(index), + }; + + this.show(); + this.chart.resize(); + this.chart.setOption(option); + this.currentIndex = index; + } +}); diff --git a/chromium/v8/tools/heap-layout/heap-size-trend-viewer-template.html b/chromium/v8/tools/heap-layout/heap-size-trend-viewer-template.html new file mode 100644 index 00000000000..cbf2bc711dc --- /dev/null +++ b/chromium/v8/tools/heap-layout/heap-size-trend-viewer-template.html @@ -0,0 +1,14 @@ +<!-- 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. --> + +<style> + #chart { + width: 100%; + height: 400px; + } +</style> +<div id="container" style="display: none;"> + <h2>V8 Heap Space Size Trend</h2> + <div id="chart"></div> +</div>
\ No newline at end of file diff --git a/chromium/v8/tools/heap-layout/heap-size-trend-viewer.mjs b/chromium/v8/tools/heap-layout/heap-size-trend-viewer.mjs new file mode 100644 index 00000000000..d7b8737d7f3 --- /dev/null +++ b/chromium/v8/tools/heap-layout/heap-size-trend-viewer.mjs @@ -0,0 +1,266 @@ +// 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. + +import {MB} from '../js/helper.mjs'; +import {DOM} from '../js/web-api-helper.mjs'; + +import {getColorFromSpaceName, kSpaceNames} from './space-categories.mjs'; + +class TrendLineHelper { + static re_gc_count = /(?<=(Before|After) GC:)\d+(?=,)/; + static re_allocated = /allocated/; + static re_space_name = /^[a-z_]+_space/; + + static snapshotHeaderToXLabel(header) { + const gc_count = this.re_gc_count.exec(header)[0]; + const alpha = header[0]; + return alpha + gc_count; + } + + static getLineSymbolFromTrendLineName(trend_line_name) { + const is_allocated_line = this.re_allocated.test(trend_line_name); + if (is_allocated_line) { + return 'emptyTriangle'; + } + return 'emptyCircle'; + } + + static getSizeTrendLineName(space_name) { + return space_name + ' size'; + } + + static getAllocatedTrendSizeName(space_name) { + return space_name + ' allocated'; + } + + static getSpaceNameFromTrendLineName(trend_line_name) { + const space_name = this.re_space_name.exec(trend_line_name)[0]; + return space_name; + } +} + +DOM.defineCustomElement('heap-size-trend-viewer', + (templateText) => + class HeapSizeTrendViewer extends HTMLElement { + constructor() { + super(); + const shadowRoot = this.attachShadow({mode: 'open'}); + shadowRoot.innerHTML = templateText; + this.chart = echarts.init(this.$('#chart'), null, { + renderer: 'canvas', + }); + this.chart.getZr().on('click', 'series.line', (params) => { + const pointInPixel = [params.offsetX, params.offsetY]; + const pointInGrid = + this.chart.convertFromPixel({seriesIndex: 0}, pointInPixel); + const xIndex = pointInGrid[0]; + this.dispatchEvent(new CustomEvent('change', { + bubbles: true, + composed: true, + detail: xIndex, + })); + this.setXMarkLine(xIndex); + }); + this.chartXAxisData = null; + this.chartSeriesData = null; + this.currentIndex = 0; + window.addEventListener('resize', () => { + this.chart.resize(); + }); + } + + $(id) { + return this.shadowRoot.querySelector(id); + } + + set data(value) { + this._data = value; + this.stateChanged(); + } + + get data() { + return this._data; + } + + hide() { + this.$('#container').style.display = 'none'; + } + + show() { + this.$('#container').style.display = 'block'; + } + + stateChanged() { + this.initTrendLineNames(); + this.initXAxisDataAndSeries(); + this.drawChart(); + } + + initTrendLineNames() { + this.trend_line_names = []; + for (const space_name of kSpaceNames) { + this.trend_line_names.push( + TrendLineHelper.getSizeTrendLineName(space_name)); + this.trend_line_names.push( + TrendLineHelper.getAllocatedTrendSizeName(space_name)); + } + } + + // X axis represent the moment before or after nth GC : [B1,A1,...Bn,An]. + initXAxisDataAndSeries() { + this.chartXAxisData = []; + this.chartSeriesData = []; + let trend_line_name_data_dict = {}; + + for (const trend_line_name of this.trend_line_names) { + trend_line_name_data_dict[trend_line_name] = []; + } + + // Init x axis data and trend line series. + for (const snapshot of this.data) { + this.chartXAxisData.push( + TrendLineHelper.snapshotHeaderToXLabel(snapshot.header)); + for (const [space_name, pageinfos] of Object.entries(snapshot.data)) { + const size_trend_line_name = + TrendLineHelper.getSizeTrendLineName(space_name); + const allocated_trend_line_name = + TrendLineHelper.getAllocatedTrendSizeName(space_name); + let size_sum = 0; + let allocated_sum = 0; + for (const pageinfo of pageinfos) { + size_sum += pageinfo[2] - pageinfo[1]; + allocated_sum += pageinfo[3]; + } + trend_line_name_data_dict[size_trend_line_name].push(size_sum); + trend_line_name_data_dict[allocated_trend_line_name].push( + allocated_sum); + } + } + + // Init mark line series as the first series + const markline_series = { + name: 'mark-line', + type: 'line', + + markLine: { + silent: true, + symbol: 'none', + label: { + show: false, + }, + lineStyle: { + color: '#333', + }, + data: [ + { + xAxis: 0, + }, + ], + }, + }; + this.chartSeriesData.push(markline_series); + + for (const [trend_line_name, trend_line_data] of Object.entries( + trend_line_name_data_dict)) { + const color = getColorFromSpaceName( + TrendLineHelper.getSpaceNameFromTrendLineName(trend_line_name)); + const trend_line_series = { + name: trend_line_name, + type: 'line', + data: trend_line_data, + lineStyle: { + color: color, + }, + itemStyle: { + color: color, + }, + symbol: TrendLineHelper.getLineSymbolFromTrendLineName(trend_line_name), + symbolSize: 8, + }; + this.chartSeriesData.push(trend_line_series); + } + } + + setXMarkLine(index) { + if (index < 0 || index >= this.data.length) { + console.error('Invalid index:', index); + return; + } + // Set the mark-line series + this.chartSeriesData[0].markLine.data[0].xAxis = index; + this.chart.setOption({ + series: this.chartSeriesData, + }); + this.currentIndex = index; + } + + drawChart() { + const option = { + dataZoom: [ + { + type: 'inside', + filterMode: 'weakFilter', + }, + { + type: 'slider', + filterMode: 'weakFilter', + labelFormatter: '', + }, + ], + title: { + text: 'Size Trend', + left: 'center', + }, + tooltip: { + trigger: 'axis', + position(point, params, dom, rect, size) { + let ret_x = point[0] + 10; + if (point[0] > size.viewSize[0] * 0.7) { + ret_x = point[0] - dom.clientWidth - 10; + } + return [ret_x, '85%']; + }, + formatter(params) { + const colorSpan = (color) => + '<span style="display:inline-block;margin-right:1px;border-radius:5px;width:9px;height:9px;background-color:' + + color + '"></span>'; + let result = '<p>' + params[0].axisValue + '</p>'; + params.forEach((item) => { + const xx = '<p style="margin:0;">' + colorSpan(item.color) + ' ' + + item.seriesName + ': ' + (item.data / MB).toFixed(2) + 'MB' + + '</p>'; + result += xx; + }); + + return result; + }, + }, + legend: { + data: this.trend_line_names, + top: '6%', + type: 'scroll', + }, + + xAxis: { + minInterval: 1, + type: 'category', + boundaryGap: false, + data: this.chartXAxisData, + }, + yAxis: { + type: 'value', + axisLabel: { + formatter(value, index) { + return (value / MB).toFixed(3) + 'MB'; + }, + }, + }, + + series: this.chartSeriesData, + }; + this.show(); + this.chart.resize(); + this.chart.setOption(option); + } +}); diff --git a/chromium/v8/tools/heap-layout/index.css b/chromium/v8/tools/heap-layout/index.css new file mode 100644 index 00000000000..53fcf97defc --- /dev/null +++ b/chromium/v8/tools/heap-layout/index.css @@ -0,0 +1,24 @@ +:root { + --surface-color: #ffffff; + --primary-color: #bb86fc; + --on-primary-color: #000000; + --error-color: #cf6679; + --file-reader-background-color: #ffffff80; + --file-reader-border-color: #000000; +} + +body { + font-family: "Roboto", sans-serif; + margin-left: 5%; + margin-right: 5%; +} + +.button-container { + text-align: center; + display: none; +} + +button { + height: 50px; + width: 100px; +} diff --git a/chromium/v8/tools/heap-layout/index.html b/chromium/v8/tools/heap-layout/index.html new file mode 100644 index 00000000000..0f33a730499 --- /dev/null +++ b/chromium/v8/tools/heap-layout/index.html @@ -0,0 +1,72 @@ +<!DOCTYPE html> +<!-- 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. --> + +<html lang="en"> + +<head> + <meta charset="UTF-8"> + <title>V8 Heap Layout</title> + + <script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.2.2/echarts.min.js"></script> + + <script type="module" src="heap-layout-viewer.mjs"></script> + <script type="module" src="heap-size-trend-viewer.mjs"></script> + <script type="module" src="trace-file-reader.mjs"></script> + + <link rel="stylesheet" type="text/css" href="./index.css"> + + <script> + 'use strict'; + function $(id) { return document.querySelector(id); } + + function globalDataChanged(e) { + $('#heap-layout-viewer').data = e.detail; + $('#heap-size-trend-viewer').data = e.detail; + $('.button-container').style.display = 'block'; + } + + function selectSnapshotAtIndex(e) { + const index = e.detail; + $('#heap-layout-viewer').drawChart(index); + } + + + function OnPrevClick() { + const heap_size_trend_viewer = $('#heap-size-trend-viewer'); + const heap_layout_viewer = $('#heap-layout-viewer'); + heap_size_trend_viewer.setXMarkLine(heap_size_trend_viewer.currentIndex - 1); + heap_layout_viewer.drawChart(heap_layout_viewer.currentIndex - 1); + } + + function OnNextClick() { + const heap_size_trend_viewer = $('#heap-size-trend-viewer'); + const heap_layout_viewer = $('#heap-layout-viewer'); + heap_size_trend_viewer.setXMarkLine(heap_size_trend_viewer.currentIndex + 1); + heap_layout_viewer.drawChart(heap_layout_viewer.currentIndex + 1); + } + + </script> +</head> + +<body> + <h1>V8 Heap Layout</h1> + <trace-file-reader onchange="globalDataChanged(event)"></trace-file-reader> + <heap-size-trend-viewer id="heap-size-trend-viewer" onchange="selectSnapshotAtIndex(event)"></heap-size-trend-viewer> + <heap-layout-viewer id="heap-layout-viewer"></heap-layout-viewer> + <div class="button-container"> + <button id="button_prev" type="button" onclick="OnPrevClick()">Prev</button> + <button id="button_next" type="button" onclick="OnNextClick()">Next</button> + </div> + + <p>Heap layout is a HTML-based tool for visualizing V8-internal heap layout.</p> + <p>Visualize heap layout that have been gathered using</p> + <ul> + <li><code>--trace-gc-heap-layout</code> on V8</li> + + </ul> + +</body> + +</html>
\ No newline at end of file diff --git a/chromium/v8/tools/heap-layout/space-categories.mjs b/chromium/v8/tools/heap-layout/space-categories.mjs new file mode 100644 index 00000000000..95b52ba9cec --- /dev/null +++ b/chromium/v8/tools/heap-layout/space-categories.mjs @@ -0,0 +1,32 @@ +// 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. + +export const kSpaceNames = [ + 'to_space', + 'from_space', + 'old_space', + 'map_space', + 'code_space', + 'large_object_space', + 'new_large_object_space', + 'code_large_object_space', + 'ro_space', +]; + +const kSpaceColors = [ + '#5b8ff9', + '#5ad8a6', + '#5d7092', + '#f6bd16', + '#e8684a', + '#6dc8ec', + '#9270ca', + '#ff9d4d', + '#269a99', +]; + +export function getColorFromSpaceName(space_name) { + const index = kSpaceNames.indexOf(space_name); + return kSpaceColors[index]; +} diff --git a/chromium/v8/tools/heap-layout/trace-file-reader.mjs b/chromium/v8/tools/heap-layout/trace-file-reader.mjs new file mode 100644 index 00000000000..880acf9fad2 --- /dev/null +++ b/chromium/v8/tools/heap-layout/trace-file-reader.mjs @@ -0,0 +1,110 @@ +// 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. + +import {calcOffsetInVMCage} from '../js/helper.mjs'; +import {DOM, FileReader,} from '../js/web-api-helper.mjs'; + +import {kSpaceNames} from './space-categories.mjs'; + +class TraceLogParseHelper { + static re_gc_header = /(Before|After) GC:\d/; + static re_page_info = + /\{owner:.+,address:.+,size:.+,allocated_bytes:.+,wasted_memory:.+\}/; + static re_owner = /(?<=owner:)[a-z_]+_space/; + static re_address = /(?<=address:)0x[a-f0-9]+(?=,)/; + static re_size = /(?<=size:)\d+(?=,)/; + static re_allocated_bytes = /(?<=allocated_bytes:)\d+(?=,)/; + static re_wasted_memory = /(?<=wasted_memory:)\d+(?=})/; + + static matchGCHeader(content) { + return this.re_gc_header.test(content); + } + + static matchPageInfo(content) { + return this.re_page_info.test(content); + } + + static parsePageInfo(content) { + const owner = this.re_owner.exec(content)[0]; + const address = + calcOffsetInVMCage(BigInt(this.re_address.exec(content)[0], 16)); + const size = parseInt(this.re_size.exec(content)[0]); + const allocated_bytes = parseInt(this.re_allocated_bytes.exec(content)[0]); + const wasted_memory = parseInt(this.re_wasted_memory.exec(content)[0]); + const info = [ + owner, + address, + address + size, + allocated_bytes, + wasted_memory, + ]; + return info; + } + + // Create a empty snapshot. + static createSnapShotData() { + let snapshot = {header: null, data: {}}; + for (let space_name of kSpaceNames) { + snapshot.data[space_name] = []; + } + return snapshot; + } + + static createModelFromV8TraceFile(contents) { + let snapshots = []; + let snapshot = this.createSnapShotData(); + + // Fill data info a snapshot, then push it into snapshots. + for (let content of contents) { + if (this.matchGCHeader(content)) { + if (snapshot.header != null) { + snapshots.push(snapshot); + } + snapshot = this.createSnapShotData(); + snapshot.header = content; + continue; + } + + if (this.matchPageInfo(content)) { + let pageinfo = this.parsePageInfo(content); + try { + snapshot.data[pageinfo[0]].push(pageinfo); + } catch (e) { + console.error(e); + } + } + } + // EOL, push the last. + if (snapshot.header != null) { + snapshots.push(snapshot); + } + return snapshots; + } +} + +DOM.defineCustomElement('../js/log-file-reader', 'trace-file-reader', + (templateText) => + class TraceFileReader extends FileReader { + constructor() { + super(templateText); + this.fullDataFromFile = ''; + this.addEventListener('fileuploadchunk', (e) => this.handleLoadChunk(e)); + + this.addEventListener('fileuploadend', (e) => this.handleLoadEnd(e)); + } + + handleLoadChunk(event) { + this.fullDataFromFile += event.detail; + } + + handleLoadEnd(event) { + let contents = this.fullDataFromFile.split('\n'); + let snapshots = TraceLogParseHelper.createModelFromV8TraceFile(contents); + this.dispatchEvent(new CustomEvent('change', { + bubbles: true, + composed: true, + detail: snapshots, + })); + } +}); diff --git a/chromium/v8/tools/heap-stats/categories.js b/chromium/v8/tools/heap-stats/categories.js index 2bd08fad02d..e4e570c4b40 100644 --- a/chromium/v8/tools/heap-stats/categories.js +++ b/chromium/v8/tools/heap-stats/categories.js @@ -117,6 +117,7 @@ export const CATEGORIES = new Map([ 'BOILERPLATE_PROPERTY_DICTIONARY_TYPE', 'BYTE_ARRAY_TYPE', 'CALL_HANDLER_INFO_TYPE', + 'CALL_SITE_INFO_TYPE', 'CELL_TYPE', 'CODE_STUBS_TABLE_TYPE', 'CONTEXT_EXTENSION_TYPE', @@ -148,7 +149,6 @@ export const CATEGORIES = new Map([ 'SCRIPT_SHARED_FUNCTION_INFOS_TYPE', 'SERIALIZED_OBJECTS_TYPE', 'SINGLE_CHARACTER_STRING_CACHE_TYPE', - 'STACK_FRAME_INFO_TYPE', 'STRING_SPLIT_CACHE_TYPE', 'STRING_TABLE_TYPE', 'TRANSITION_ARRAY_TYPE', diff --git a/chromium/v8/tools/heap-stats/index.html b/chromium/v8/tools/heap-stats/index.html index efb74af011b..9f053a8730f 100644 --- a/chromium/v8/tools/heap-stats/index.html +++ b/chromium/v8/tools/heap-stats/index.html @@ -80,23 +80,32 @@ function globalSelectionChangedA(e) { <p>Visualize object statistics that have been gathered using</p> <ul> - <li><code>--trace-gc-object-stats</code> on V8</li> + <li>Use <code>--trace-gc-object-stats</code> for V8 and load the contents of stdout</li> <li> <a href="https://www.chromium.org/developers/how-tos/trace-event-profiling-tool">Chrome's tracing infrastructure</a> collecting data for the category - <code>v8.gc_stats</code>. + <code>disabled-by-default-v8.gc_stats</code> and directly load the + results.html or trace.json.gzip file. </li> </ul> - <p> - Note that you only get a data point on major GCs. You can enforce this by - using the <code>--gc-global</code> flag. - </p> - <p> - Note that the visualizer needs to run on a web server due to HTML imports - requiring <a - href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing">CORS</a>. - </p> + + Additional information: + <ul> + <li> + You only get a data point on major GCs. You can enforce this by + using the <code>--gc-global</code> V8 flag. + </li> + <li> + For more frequent data points you can also the + <code>--gc-interval=$AFTER_N_ALLOCATIONS</code> V8. + </li> + <li> + The visualizer needs to run on a web server due to HTML imports + requiring <a + href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing">CORS</a>. + </li> + <ul> </body> </html> diff --git a/chromium/v8/tools/heap-stats/trace-file-reader.js b/chromium/v8/tools/heap-stats/trace-file-reader.js index e297723e6fb..ef83b30db11 100644 --- a/chromium/v8/tools/heap-stats/trace-file-reader.js +++ b/chromium/v8/tools/heap-stats/trace-file-reader.js @@ -78,6 +78,27 @@ defineCustomElement('trace-file-reader', (templateText) => }; // Delay the loading a bit to allow for CSS animations to happen. setTimeout(() => reader.readAsArrayBuffer(file), 0); + } else if (file.type == 'text/html') { + // try extracting the data from a results.html file + reader.onload = (e) => { + try { + let html = document.createElement('html'); + html.innerHTML = e.target.result; + for (let dataScript of html.querySelectorAll('#viewer-data')) { + const base64 = dataScript.innerText.slice(1,-1); + const binary = globalThis.atob(base64); + const textResult = pako.inflate(binary, {to: 'string'}); + this.processRawText(file, textResult); + } + this.section.className = 'success'; + this.$('#fileReader').classList.add('done'); + } catch (err) { + console.error(err); + this.section.className = 'failure'; + } + }; + // Delay the loading a bit to allow for CSS animations to happen. + setTimeout(() => reader.readAsText(file), 0); } else { reader.onload = (e) => { try { diff --git a/chromium/v8/tools/index.html b/chromium/v8/tools/index.html index 53b22f170d5..7dd253f4c97 100644 --- a/chromium/v8/tools/index.html +++ b/chromium/v8/tools/index.html @@ -81,6 +81,10 @@ dd, dt { <dd>Visualize heap memory usage.</dd> </div> <div class="card"> + <dt><a href="./heap-layout/index.html">Heap Layout</a></dt> + <dd>Visualize heap memory layout.</dd> + </div> + <div class="card"> <dt><a href="./parse-processor.html">Parse Processor</a></dt> <dd>Analyse parse, compile and first-execution.</dd> </div> diff --git a/chromium/v8/tools/js/helper.mjs b/chromium/v8/tools/js/helper.mjs new file mode 100644 index 00000000000..04df6b54213 --- /dev/null +++ b/chromium/v8/tools/js/helper.mjs @@ -0,0 +1,53 @@ +// 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. + +export const KB = 1024; +export const MB = KB * KB; +export const GB = MB * KB; +export const kMillis2Seconds = 1 / 1000; +export const kMicro2Milli = 1 / 1000; + +export function formatBytes(bytes) { + const units = ['B', 'KiB', 'MiB', 'GiB']; + const divisor = 1024; + let index = 0; + while (index < units.length && bytes >= divisor) { + index++; + bytes /= divisor; + } + return bytes.toFixed(2) + units[index]; +} + +export function formatMicroSeconds(micro) { + return (micro * kMicro2Milli).toFixed(1) + 'ms'; +} + +export function formatDurationMicros(micros, secondsDigits = 3) { + return formatDurationMillis(micros * kMicro2Milli, secondsDigits); +} + +export function formatDurationMillis(millis, secondsDigits = 3) { + if (millis < 1000) { + if (millis < 1) { + return (millis / kMicro2Milli).toFixed(1) + 'ns'; + } + return millis.toFixed(2) + 'ms'; + } + let seconds = millis / 1000; + const hours = Math.floor(seconds / 3600); + const minutes = Math.floor((seconds % 3600) / 60); + seconds = seconds % 60; + let buffer = ''; + if (hours > 0) buffer += hours + 'h '; + if (hours > 0 || minutes > 0) buffer += minutes + 'm '; + buffer += seconds.toFixed(secondsDigits) + 's'; + return buffer; +} + +// Get the offset in the 4GB virtual memory cage. +export function calcOffsetInVMCage(address) { + let mask = (1n << 32n) - 1n; + let ret = Number(address & mask); + return ret; +} diff --git a/chromium/v8/tools/system-analyzer/view/log-file-reader-template.html b/chromium/v8/tools/js/log-file-reader-template.html index 68403300e30..f9e31eed8b9 100644 --- a/chromium/v8/tools/system-analyzer/view/log-file-reader-template.html +++ b/chromium/v8/tools/js/log-file-reader-template.html @@ -1,9 +1,9 @@ -<!-- Copyright 2020 the V8 project authors. All rights reserved. +<!-- 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. --> <head> - <link href="./index.css" rel="stylesheet"> + <link href="./index.css" rel="stylesheet" /> </head> <style> #fileReader { @@ -13,6 +13,8 @@ found in the LICENSE file. --> cursor: pointer; transition: all 0.5s ease-in-out; background-color: var(--surface-color); + border: solid 1px var(--file-reader-border-color); + border-radius: 5px; } #fileReader:hover { @@ -20,7 +22,7 @@ found in the LICENSE file. --> color: var(--on-primary-color); } - .done #fileReader{ + .done #fileReader { display: none; } @@ -32,7 +34,7 @@ found in the LICENSE file. --> cursor: wait; } - #fileReader>input { + #fileReader > input { display: none; } @@ -79,11 +81,11 @@ found in the LICENSE file. --> } </style> <div id="root"> - <div id="fileReader" class="panel" tabindex=1> + <div id="fileReader" class="panel" tabindex="1"> <span id="label"> Drag and drop a v8.log file into this area, or click to choose from disk. </span> - <input id="file" type="file" name="file"> + <input id="file" type="file" name="file" /> </div> <div id="loader"> <div id="spinner"></div> diff --git a/chromium/v8/tools/js/web-api-helper.mjs b/chromium/v8/tools/js/web-api-helper.mjs new file mode 100644 index 00000000000..17c1c0b1bee --- /dev/null +++ b/chromium/v8/tools/js/web-api-helper.mjs @@ -0,0 +1,258 @@ +// 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. + +export class V8CustomElement extends HTMLElement { + _updateTimeoutId; + _updateCallback = this.forceUpdate.bind(this); + + constructor(templateText) { + super(); + const shadowRoot = this.attachShadow({mode: 'open'}); + shadowRoot.innerHTML = templateText; + } + + $(id) { + return this.shadowRoot.querySelector(id); + } + + querySelectorAll(query) { + return this.shadowRoot.querySelectorAll(query); + } + + requestUpdate(useAnimation = false) { + if (useAnimation) { + window.cancelAnimationFrame(this._updateTimeoutId); + this._updateTimeoutId = + window.requestAnimationFrame(this._updateCallback); + } else { + // Use timeout tasks to asynchronously update the UI without blocking. + clearTimeout(this._updateTimeoutId); + const kDelayMs = 5; + this._updateTimeoutId = setTimeout(this._updateCallback, kDelayMs); + } + } + + forceUpdate() { + this._update(); + } + + _update() { + throw Error('Subclass responsibility'); + } +} + +export class FileReader extends V8CustomElement { + constructor(templateText) { + super(templateText); + this.addEventListener('click', (e) => this.handleClick(e)); + this.addEventListener('dragover', (e) => this.handleDragOver(e)); + this.addEventListener('drop', (e) => this.handleChange(e)); + this.$('#file').addEventListener('change', (e) => this.handleChange(e)); + this.$('#fileReader') + .addEventListener('keydown', (e) => this.handleKeyEvent(e)); + } + + set error(message) { + this._updateLabel(message); + this.root.className = 'fail'; + } + + _updateLabel(text) { + this.$('#label').innerText = text; + } + + handleKeyEvent(event) { + if (event.key == 'Enter') this.handleClick(event); + } + + handleClick(event) { + this.$('#file').click(); + } + + handleChange(event) { + // Used for drop and file change. + event.preventDefault(); + this.dispatchEvent( + new CustomEvent('fileuploadstart', {bubbles: true, composed: true})); + const host = event.dataTransfer ? event.dataTransfer : event.target; + this.readFile(host.files[0]); + } + + handleDragOver(event) { + event.preventDefault(); + } + + connectedCallback() { + this.fileReader.focus(); + } + + get fileReader() { + return this.$('#fileReader'); + } + + get root() { + return this.$('#root'); + } + + readFile(file) { + if (!file) { + this.error = 'Failed to load file.'; + return; + } + this.fileReader.blur(); + this.root.className = 'loading'; + // Delay the loading a bit to allow for CSS animations to happen. + window.requestAnimationFrame(() => this.asyncReadFile(file)); + } + + async asyncReadFile(file) { + const decoder = globalThis.TextDecoderStream; + if (decoder) { + await this._streamFile(file, decoder); + } else { + await this._readFullFile(file); + } + this._updateLabel(`Finished loading '${file.name}'.`); + this.dispatchEvent( + new CustomEvent('fileuploadend', {bubbles: true, composed: true})); + this.root.className = 'done'; + } + + async _readFullFile(file) { + const text = await file.text(); + this._handleFileChunk(text); + } + + async _streamFile(file, decoder) { + const stream = file.stream().pipeThrough(new decoder()); + const reader = stream.getReader(); + let chunk, readerDone; + do { + const readResult = await reader.read(); + chunk = readResult.value; + readerDone = readResult.done; + if (chunk) this._handleFileChunk(chunk); + } while (!readerDone); + } + + _handleFileChunk(chunk) { + this.dispatchEvent(new CustomEvent('fileuploadchunk', { + bubbles: true, + composed: true, + detail: chunk, + })); + } +} + +export class DOM { + static element(type, options) { + const node = document.createElement(type); + if (options !== undefined) { + if (typeof options === 'string') { + // Old behaviour: options = class string + node.className = options; + } else if (Array.isArray(options)) { + // Old behaviour: options = class array + DOM.addClasses(node, options); + } else { + // New behaviour: options = attribute dict + for (const [key, value] of Object.entries(options)) { + if (key == 'className') { + node.className = value; + } else if (key == 'classList') { + node.classList = value; + } else if (key == 'textContent') { + node.textContent = value; + } else if (key == 'children') { + for (const child of value) { + node.appendChild(child); + } + } else { + node.setAttribute(key, value); + } + } + } + } + return node; + } + + static addClasses(node, classes) { + const classList = node.classList; + if (typeof classes === 'string') { + classList.add(classes); + } else { + for (let i = 0; i < classes.length; i++) { + classList.add(classes[i]); + } + } + return node; + } + + static text(string) { + return document.createTextNode(string); + } + + static button(label, clickHandler) { + const button = DOM.element('button'); + button.innerText = label; + button.onclick = clickHandler; + return button; + } + + static div(options) { + return this.element('div', options); + } + + static span(options) { + return this.element('span', options); + } + + static table(options) { + return this.element('table', options); + } + + static tbody(options) { + return this.element('tbody', options); + } + + static td(textOrNode, className) { + const node = this.element('td'); + if (typeof textOrNode === 'object') { + node.appendChild(textOrNode); + } else if (textOrNode) { + node.innerText = textOrNode; + } + if (className) node.className = className; + return node; + } + + static tr(classes) { + return this.element('tr', classes); + } + + static removeAllChildren(node) { + let range = document.createRange(); + range.selectNodeContents(node); + range.deleteContents(); + } + + static defineCustomElement( + path, nameOrGenerator, maybeGenerator = undefined) { + let generator = nameOrGenerator; + let name = nameOrGenerator; + if (typeof nameOrGenerator == 'function') { + console.assert(maybeGenerator === undefined); + name = path.substring(path.lastIndexOf('/') + 1, path.length); + } else { + console.assert(typeof nameOrGenerator == 'string'); + generator = maybeGenerator; + } + path = path + '-template.html'; + fetch(path) + .then(stream => stream.text()) + .then( + templateText => + customElements.define(name, generator(templateText))); + } +}
\ No newline at end of file diff --git a/chromium/v8/tools/mb/mb.py b/chromium/v8/tools/mb/mb.py index 408e2b566a0..1ba74b747b8 100755 --- a/chromium/v8/tools/mb/mb.py +++ b/chromium/v8/tools/mb/mb.py @@ -1150,6 +1150,8 @@ class MetaBuildWrapper(object): stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) out, err = p.communicate() + out = out.decode('utf-8') + err = err.decode('utf-8') else: p = subprocess.Popen(cmd, shell=False, cwd=self.chromium_src_dir, env=env) diff --git a/chromium/v8/tools/profile.mjs b/chromium/v8/tools/profile.mjs index 5f0b1667ec0..3f11bff1394 100644 --- a/chromium/v8/tools/profile.mjs +++ b/chromium/v8/tools/profile.mjs @@ -314,7 +314,6 @@ export class Profile { COMPILED: 0, IGNITION: 1, BASELINE: 2, - TURBOPROP: 4, TURBOFAN: 5, } @@ -346,8 +345,6 @@ export class Profile { return this.CodeState.IGNITION; case '^': return this.CodeState.BASELINE; - case '+': - return this.CodeState.TURBOPROP; case '*': return this.CodeState.TURBOFAN; } @@ -361,8 +358,6 @@ export class Profile { return "Unopt"; } else if (state === this.CodeState.BASELINE) { return "Baseline"; - } else if (state === this.CodeState.TURBOPROP) { - return "Turboprop"; } else if (state === this.CodeState.TURBOFAN) { return "Opt"; } diff --git a/chromium/v8/tools/release/auto_roll.py b/chromium/v8/tools/release/auto_roll.py index 76247b1fb3e..2aa4ff68297 100755 --- a/chromium/v8/tools/release/auto_roll.py +++ b/chromium/v8/tools/release/auto_roll.py @@ -80,7 +80,7 @@ class DetectRevisionToRoll(Step): version = self.GetVersionTag(revision) assert version, "Internal error. All recent releases should have a tag" - if SortingKey(self["last_version"]) < SortingKey(version): + if LooseVersion(self["last_version"]) < LooseVersion(version): self["roll"] = revision break else: diff --git a/chromium/v8/tools/release/common_includes.py b/chromium/v8/tools/release/common_includes.py index b61a3e2e27f..beee8184953 100644 --- a/chromium/v8/tools/release/common_includes.py +++ b/chromium/v8/tools/release/common_includes.py @@ -31,7 +31,7 @@ from __future__ import print_function import argparse import datetime -import httplib +from distutils.version import LooseVersion import glob import imp import json @@ -43,11 +43,20 @@ import sys import textwrap import time import urllib -import urllib2 from git_recipes import GitRecipesMixin from git_recipes import GitFailedException +PYTHON3 = sys.version_info >= (3, 0) + +if PYTHON3: + import http.client as httplib + import urllib.request as urllib2 +else: + import httplib + import urllib2 + + DAY_IN_SECONDS = 24 * 60 * 60 PUSH_MSG_GIT_RE = re.compile(r".* \(based on (?P<git_rev>[a-fA-F0-9]+)\)$") PUSH_MSG_NEW_RE = re.compile(r"^Version \d+\.\d+\.\d+$") @@ -67,6 +76,10 @@ new_path = path_to_depot_tools + os.pathsep + os.environ.get('PATH') os.environ['PATH'] = new_path +def maybe_decode(obj): + return obj.decode('utf-8') if PYTHON3 else obj + + def TextToFile(text, file_name): with open(file_name, "w") as f: f.write(text) @@ -92,16 +105,6 @@ def MSub(rexp, replacement, text): return re.sub(rexp, replacement, text, flags=re.MULTILINE) -def SortingKey(version): - """Key for sorting version number strings: '3.11' > '3.2.1.1'""" - version_keys = map(int, version.split(".")) - # Fill up to full version numbers to normalize comparison. - while len(version_keys) < 4: # pragma: no cover - version_keys.append(0) - # Fill digits. - return ".".join(map("{0:04d}".format, version_keys)) - - # Some commands don't like the pipe, e.g. calling vi from within the script or # from subscripts like git cl upload. def Command(cmd, args="", prefix="", pipe=True, cwd=None): @@ -113,7 +116,7 @@ def Command(cmd, args="", prefix="", pipe=True, cwd=None): sys.stdout.flush() try: if pipe: - return subprocess.check_output(cmd_line, shell=True, cwd=cwd) + return maybe_decode(subprocess.check_output(cmd_line, shell=True, cwd=cwd)) else: return subprocess.check_call(cmd_line, shell=True, cwd=cwd) except subprocess.CalledProcessError: @@ -256,7 +259,7 @@ class GitInterface(VCInterface): lambda s: re.match(r"^branch\-heads/\d+\.\d+$", s), self.step.GitRemotes()) # Remove 'branch-heads/' prefix. - return map(lambda s: s[13:], branches) + return [b[13:] for b in branches] def MainBranch(self): return "main" @@ -557,7 +560,7 @@ class Step(GitRecipesMixin): int(time_now - max_age)).strip() # Filter out revisions who's tag is off by one or more commits. - return filter(lambda r: self.GetVersionTag(r), revisions.splitlines()) + return list(filter(self.GetVersionTag, revisions.splitlines())) def GetLatestVersion(self): # Use cached version if available. @@ -571,7 +574,7 @@ class Step(GitRecipesMixin): only_version_tags = NormalizeVersionTags(all_tags) version = sorted(only_version_tags, - key=SortingKey, reverse=True)[0] + key=LooseVersion, reverse=True)[0] self["latest_version"] = version return version diff --git a/chromium/v8/tools/release/create_release.py b/chromium/v8/tools/release/create_release.py index d1a066f00b6..62c5ed675f4 100755 --- a/chromium/v8/tools/release/create_release.py +++ b/chromium/v8/tools/release/create_release.py @@ -10,10 +10,17 @@ import argparse import os import sys import tempfile -import urllib2 from common_includes import * +PYTHON3 = sys.version_info >= (3, 0) + +if PYTHON3: + import urllib.request as urllib2 +else: + import urllib2 + + class Preparation(Step): MESSAGE = "Preparation." @@ -48,7 +55,7 @@ class IncrementVersion(Step): # Use the highest version from main or from tags to determine the new # version. authoritative_version = sorted( - [main_version, latest_version], key=SortingKey)[1] + [main_version, latest_version], key=LooseVersion)[1] self.StoreVersion(authoritative_version, "authoritative_") # Variables prefixed with 'new_' contain the new version numbers for the diff --git a/chromium/v8/tools/release/test_scripts.py b/chromium/v8/tools/release/test_scripts.py index e8757cf2771..c2c49de8ca6 100755 --- a/chromium/v8/tools/release/test_scripts.py +++ b/chromium/v8/tools/release/test_scripts.py @@ -29,6 +29,7 @@ # for py2/py3 compatibility from __future__ import print_function +import json import os import shutil import tempfile @@ -93,6 +94,10 @@ class ToplevelTest(unittest.TestCase): ] self.assertEquals(expected, NormalizeVersionTags(input)) + def testCommand(self): + """Ensure json can decode the output of commands.""" + json.dumps(Command('ls', pipe=True)) + def Cmd(*args, **kwargs): """Convenience function returning a shell command test expectation.""" diff --git a/chromium/v8/tools/run_perf.py b/chromium/v8/tools/run_perf.py index 1e22b298a80..4dd7d87996c 100644 --- a/chromium/v8/tools/run_perf.py +++ b/chromium/v8/tools/run_perf.py @@ -119,13 +119,21 @@ import sys import time import traceback -import numpy - from testrunner.local import android from testrunner.local import command from testrunner.local import utils from testrunner.objects.output import Output, NULL_OUTPUT +from math import sqrt +# NOTE: added import here to prevent breakages during the py2/3 migration, +# once we enable python3 only, we can move the import up +try: + from numpy import mean + from numpy import std as stdev +except ImportError: + from statistics import mean, stdev + + # for py2/py3 compatibility try: basestring # Python 2 @@ -265,11 +273,11 @@ class ResultTracker(object): return False logging.debug(' Results: %d entries', len(results)) - mean = numpy.mean(results) - mean_stderr = numpy.std(results) / numpy.sqrt(len(results)) - logging.debug(' Mean: %.2f, mean_stderr: %.2f', mean, mean_stderr) - logging.info('>>> Confidence level is %.2f', mean / (1000.0 * mean_stderr)) - return confidence_level * mean_stderr < mean / 1000.0 + avg = mean(results) + avg_stderr = stdev(results) / sqrt(len(results)) + logging.debug(' Mean: %.2f, mean_stderr: %.2f', avg, avg_stderr) + logging.info('>>> Confidence level is %.2f', avg / (1000.0 * avg_stderr)) + return confidence_level * avg_stderr < avg / 1000.0 def __str__(self): # pragma: no cover return json.dumps(self.ToDict(), indent=2, separators=(',', ': ')) @@ -289,7 +297,8 @@ def RunResultsProcessor(results_processor, output, count): stderr=subprocess.PIPE, ) new_output = copy.copy(output) - new_output.stdout, _ = p.communicate(input=output.stdout) + new_output.stdout = p.communicate( + input=output.stdout.encode('utf-8'))[0].decode('utf-8') logging.info('>>> Processed stdout (#%d):\n%s', count, output.stdout) return new_output diff --git a/chromium/v8/tools/sanitizers/tsan_suppressions.txt b/chromium/v8/tools/sanitizers/tsan_suppressions.txt index 270340e4843..f9e3942039d 100644 --- a/chromium/v8/tools/sanitizers/tsan_suppressions.txt +++ b/chromium/v8/tools/sanitizers/tsan_suppressions.txt @@ -4,3 +4,7 @@ # Incorrectly detected lock cycles in test-lockers # https://code.google.com/p/thread-sanitizer/issues/detail?id=81 deadlock:LockAndUnlockDifferentIsolatesThread::Run + +# A global safepoint might lock client isolate mutexes in any order, which +# would be reported as potential deadlocks. +deadlock:GlobalSafepoint::EnterGlobalSafepointScope diff --git a/chromium/v8/tools/system-analyzer/helper.mjs b/chromium/v8/tools/system-analyzer/helper.mjs index ba6d0614f22..c444aea944a 100644 --- a/chromium/v8/tools/system-analyzer/helper.mjs +++ b/chromium/v8/tools/system-analyzer/helper.mjs @@ -2,48 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -export const KB = 1024; -export const MB = KB * KB; -export const GB = MB * KB; -export const kMicro2Milli = 1 / 1000; - -export function formatBytes(bytes) { - const units = ['B', 'KiB', 'MiB', 'GiB']; - const divisor = 1024; - let index = 0; - while (index < units.length && bytes >= divisor) { - index++; - bytes /= divisor; - } - return bytes.toFixed(2) + units[index]; -} - -export function formatMicroSeconds(micro) { - return (micro * kMicro2Milli).toFixed(1) + 'ms'; -} - -export function formatDurationMicros(micros, secondsDigits = 3) { - return formatDurationMillis(micros * kMicro2Milli, secondsDigits); -} - -export function formatDurationMillis(millis, secondsDigits = 3) { - if (millis < 1000) { - if (millis < 1) { - return (millis / kMicro2Milli).toFixed(1) + 'ns'; - } - return millis.toFixed(2) + 'ms'; - } - let seconds = millis / 1000; - const hours = Math.floor(seconds / 3600); - const minutes = Math.floor((seconds % 3600) / 60); - seconds = seconds % 60; - let buffer = '' - if (hours > 0) buffer += hours + 'h '; - if (hours > 0 || minutes > 0) buffer += minutes + 'm '; - buffer += seconds.toFixed(secondsDigits) + 's' - return buffer; -} - export function delay(time) { return new Promise(resolver => setTimeout(resolver, time)); } @@ -105,3 +63,5 @@ export function groupBy(array, keyFunction, collect = false) { // Sort by length return groups.sort((a, b) => b.length - a.length); } + +export * from '../js/helper.mjs'
\ No newline at end of file diff --git a/chromium/v8/tools/system-analyzer/index.css b/chromium/v8/tools/system-analyzer/index.css index 4525f0d9b40..b2fb95843f4 100644 --- a/chromium/v8/tools/system-analyzer/index.css +++ b/chromium/v8/tools/system-analyzer/index.css @@ -13,6 +13,7 @@ --map-background-color: #5e5454; --timeline-background-color: #1f1f1f; --file-reader-background-color: #ffffff80; + --file-reader-border-color: #ffffff; --red: #dc6eae; --green: #aedc6e; --yellow: #eeff41; diff --git a/chromium/v8/tools/system-analyzer/index.html b/chromium/v8/tools/system-analyzer/index.html index e85a59d6e69..0a333dd18f1 100644 --- a/chromium/v8/tools/system-analyzer/index.html +++ b/chromium/v8/tools/system-analyzer/index.html @@ -11,7 +11,7 @@ found in the LICENSE file. --> <link rel="modulepreload" href="./helper.mjs" > <link rel="modulepreload" href="./view/log-file-reader.mjs" > <link rel="modulepreload" href="./view/helper.mjs" > - <link rel="preload" href="./view/log-file-reader-template.html" as="fetch" crossorigin="anonymous"> + <link rel="preload" href="../js/log-file-reader-template.html" as="fetch" crossorigin="anonymous"> <script type="module"> // Force instatiating the log-reader before anything else. import "./view/log-file-reader.mjs"; diff --git a/chromium/v8/tools/system-analyzer/view/helper.mjs b/chromium/v8/tools/system-analyzer/view/helper.mjs index 50dc6a9a037..f9a1272573b 100644 --- a/chromium/v8/tools/system-analyzer/view/helper.mjs +++ b/chromium/v8/tools/system-analyzer/view/helper.mjs @@ -122,117 +122,7 @@ export class CSSColor { } } -export class DOM { - static element(type, options) { - const node = document.createElement(type); - if (options !== undefined) { - if (typeof options === 'string') { - // Old behaviour: options = class string - node.className = options; - } else if (Array.isArray(options)) { - // Old behaviour: options = class array - DOM.addClasses(node, options); - } else { - // New behaviour: options = attribute dict - for (const [key, value] of Object.entries(options)) { - if (key == 'className') { - node.className = value; - } else if (key == 'classList') { - node.classList = value; - } else if (key == 'textContent') { - node.textContent = value; - } else if (key == 'children') { - for (const child of value) { - node.appendChild(child); - } - } else { - node.setAttribute(key, value); - } - } - } - } - return node; - } - - static addClasses(node, classes) { - const classList = node.classList; - if (typeof classes === 'string') { - classList.add(classes); - } else { - for (let i = 0; i < classes.length; i++) { - classList.add(classes[i]); - } - } - return node; - } - - static text(string) { - return document.createTextNode(string); - } - - static button(label, clickHandler) { - const button = DOM.element('button'); - button.innerText = label; - button.onclick = clickHandler; - return button; - } - - static div(options) { - return this.element('div', options); - } - - static span(options) { - return this.element('span', options); - } - - static table(options) { - return this.element('table', options); - } - - static tbody(options) { - return this.element('tbody', options); - } - - static td(textOrNode, className) { - const node = this.element('td'); - if (typeof textOrNode === 'object') { - node.appendChild(textOrNode); - } else if (textOrNode) { - node.innerText = textOrNode; - } - if (className) node.className = className; - return node; - } - - static tr(classes) { - return this.element('tr', classes); - } - - static removeAllChildren(node) { - let range = document.createRange(); - range.selectNodeContents(node); - range.deleteContents(); - } - - static defineCustomElement( - path, nameOrGenerator, maybeGenerator = undefined) { - let generator = nameOrGenerator; - let name = nameOrGenerator; - if (typeof nameOrGenerator == 'function') { - console.assert(maybeGenerator === undefined); - name = path.substring(path.lastIndexOf('/') + 1, path.length); - } else { - console.assert(typeof nameOrGenerator == 'string'); - generator = maybeGenerator; - } - path = path + '-template.html'; - fetch(path) - .then(stream => stream.text()) - .then( - templateText => - customElements.define(name, generator(templateText))); - } -} +import {DOM} from '../../js/web-api-helper.mjs'; const SVGNamespace = 'http://www.w3.org/2000/svg'; export class SVG { @@ -259,45 +149,7 @@ export function $(id) { return document.querySelector(id) } -export class V8CustomElement extends HTMLElement { - _updateTimeoutId; - _updateCallback = this.forceUpdate.bind(this); - - constructor(templateText) { - super(); - const shadowRoot = this.attachShadow({mode: 'open'}); - shadowRoot.innerHTML = templateText; - } - - $(id) { - return this.shadowRoot.querySelector(id); - } - - querySelectorAll(query) { - return this.shadowRoot.querySelectorAll(query); - } - - requestUpdate(useAnimation = false) { - if (useAnimation) { - window.cancelAnimationFrame(this._updateTimeoutId); - this._updateTimeoutId = - window.requestAnimationFrame(this._updateCallback); - } else { - // Use timeout tasks to asynchronously update the UI without blocking. - clearTimeout(this._updateTimeoutId); - const kDelayMs = 5; - this._updateTimeoutId = setTimeout(this._updateCallback, kDelayMs); - } - } - - forceUpdate() { - this._update(); - } - - _update() { - throw Error('Subclass responsibility'); - } -} +import {V8CustomElement} from '../../js/web-api-helper.mjs' export class CollapsableElement extends V8CustomElement { constructor(templateText) { @@ -468,3 +320,4 @@ export function gradientStopsFromGroups( } export * from '../helper.mjs'; +export * from '../../js/web-api-helper.mjs'
\ No newline at end of file diff --git a/chromium/v8/tools/system-analyzer/view/log-file-reader.mjs b/chromium/v8/tools/system-analyzer/view/log-file-reader.mjs index 5edb90d2fca..8d65c030f14 100644 --- a/chromium/v8/tools/system-analyzer/view/log-file-reader.mjs +++ b/chromium/v8/tools/system-analyzer/view/log-file-reader.mjs @@ -1,110 +1,12 @@ // 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. -import {delay} from '../helper.mjs'; -import {DOM, V8CustomElement} from './helper.mjs'; - -DOM.defineCustomElement('view/log-file-reader', - (templateText) => - class LogFileReader extends V8CustomElement { - constructor() { - super(templateText); - this.addEventListener('click', e => this.handleClick(e)); - this.addEventListener('dragover', e => this.handleDragOver(e)); - this.addEventListener('drop', e => this.handleChange(e)); - this.$('#file').addEventListener('change', e => this.handleChange(e)); - this.$('#fileReader') - .addEventListener('keydown', e => this.handleKeyEvent(e)); - } - - set error(message) { - this._updateLabel(message); - this.root.className = 'fail'; - } - - _updateLabel(text) { - this.$('#label').innerText = text; - } - - handleKeyEvent(event) { - if (event.key == 'Enter') this.handleClick(event); - } - - handleClick(event) { - this.$('#file').click(); - } - - handleChange(event) { - // Used for drop and file change. - event.preventDefault(); - this.dispatchEvent( - new CustomEvent('fileuploadstart', {bubbles: true, composed: true})); - const host = event.dataTransfer ? event.dataTransfer : event.target; - this.readFile(host.files[0]); - } - - handleDragOver(event) { - event.preventDefault(); - } - - connectedCallback() { - this.fileReader.focus(); - } - - get fileReader() { - return this.$('#fileReader'); - } - - get root() { - return this.$('#root'); - } - - readFile(file) { - if (!file) { - this.error = 'Failed to load file.'; - return; - } - this.fileReader.blur(); - this.root.className = 'loading'; - // Delay the loading a bit to allow for CSS animations to happen. - window.requestAnimationFrame(() => this.asyncReadFile(file)); - } - - async asyncReadFile(file) { - const decoder = globalThis.TextDecoderStream; - if (decoder) { - await this._streamFile(file, decoder); - } else { - await this._readFullFile(file); - } - this._updateLabel(`Finished loading '${file.name}'.`); - this.dispatchEvent( - new CustomEvent('fileuploadend', {bubbles: true, composed: true})); - this.root.className = 'done'; - } - - async _readFullFile(file) { - const text = await file.text(); - this._handleFileChunk(text) - } - - async _streamFile(file, decoder) { - const stream = file.stream().pipeThrough(new decoder()); - const reader = stream.getReader(); - let chunk, readerDone; - do { - const readResult = await reader.read(); - chunk = readResult.value; - readerDone = readResult.done; - if (chunk) this._handleFileChunk(chunk); - } while (!readerDone); - } - - _handleFileChunk(chunk) { - this.dispatchEvent(new CustomEvent('fileuploadchunk', { - bubbles: true, - composed: true, - detail: chunk, - })); - } -}); +import {DOM, FileReader} from './helper.mjs'; + +DOM.defineCustomElement( + '../js/log-file-reader', + (templateText) => class LogFileReader extends FileReader { + constructor() { + super(templateText); + } + }); diff --git a/chromium/v8/tools/testrunner/base_runner.py b/chromium/v8/tools/testrunner/base_runner.py index 4b62fe7b9b8..e9ff4e793be 100644 --- a/chromium/v8/tools/testrunner/base_runner.py +++ b/chromium/v8/tools/testrunner/base_runner.py @@ -192,7 +192,8 @@ class BuildConfig(object): self.lite_mode = build_config['v8_enable_lite_mode'] self.pointer_compression = build_config['v8_enable_pointer_compression'] self.pointer_compression_shared_cage = build_config['v8_enable_pointer_compression_shared_cage'] - self.virtual_memory_cage = build_config['v8_enable_virtual_memory_cage'] + self.shared_ro_heap = build_config['v8_enable_shared_ro_heap'] + self.sandbox = build_config['v8_enable_sandbox'] self.third_party_heap = build_config['v8_enable_third_party_heap'] self.webassembly = build_config['v8_enable_webassembly'] self.dict_property_const_tracking = build_config['v8_dict_property_const_tracking'] @@ -237,8 +238,8 @@ class BuildConfig(object): detected_options.append('pointer_compression') if self.pointer_compression_shared_cage: detected_options.append('pointer_compression_shared_cage') - if self.virtual_memory_cage: - detected_options.append('virtual_memory_cage') + if self.sandbox: + detected_options.append('sandbox') if self.third_party_heap: detected_options.append('third_party_heap') if self.webassembly: @@ -668,7 +669,7 @@ class BaseTestRunner(object): no_simd_hardware = any( i in options.extra_flags for i in ['--noenable-sse3', - '--no-enable-sse3' + '--no-enable-sse3', '--noenable-ssse3', '--no-enable-ssse3', '--noenable-sse4-1', @@ -694,10 +695,6 @@ class BaseTestRunner(object): utils.GuessPowerProcessorVersion() < 9: no_simd_hardware = True - # riscv64 do not support Simd instructions - if self.build_config.arch == 'riscv64': - no_simd_hardware = True - return { "arch": self.build_config.arch, "asan": self.build_config.asan, @@ -736,7 +733,10 @@ class BaseTestRunner(object): "lite_mode": self.build_config.lite_mode, "pointer_compression": self.build_config.pointer_compression, "pointer_compression_shared_cage": self.build_config.pointer_compression_shared_cage, - "virtual_memory_cage": self.build_config.virtual_memory_cage, + "no_js_shared_memory": (not self.build_config.shared_ro_heap) or + (self.build_config.pointer_compression and + not self.build_config.pointer_compression_shared_cage), + "sandbox": self.build_config.sandbox, "dict_property_const_tracking": self.build_config.dict_property_const_tracking, } diff --git a/chromium/v8/tools/testrunner/local/command.py b/chromium/v8/tools/testrunner/local/command.py index df603d79d2f..6942d1b9a48 100644 --- a/chromium/v8/tools/testrunner/local/command.py +++ b/chromium/v8/tools/testrunner/local/command.py @@ -19,6 +19,7 @@ from ..local.android import ( from ..local import utils from ..objects import output +PYTHON3 = sys.version_info >= (3, 0) BASE_DIR = os.path.normpath( os.path.join(os.path.dirname(os.path.abspath(__file__)), '..' , '..', '..')) @@ -114,11 +115,17 @@ class BaseCommand(object): timer.cancel() + def convert(stream): + if PYTHON3: + return stream.decode('utf-8', 'replace') + else: + return stream.decode('utf-8', 'replace').encode('utf-8') + return output.Output( process.returncode, timeout_occured[0], - stdout.decode('utf-8', 'replace').encode('utf-8'), - stderr.decode('utf-8', 'replace').encode('utf-8'), + convert(stdout), + convert(stderr), process.pid, duration ) diff --git a/chromium/v8/tools/testrunner/local/variants.py b/chromium/v8/tools/testrunner/local/variants.py index 1552ac75345..3feee7dfd30 100644 --- a/chromium/v8/tools/testrunner/local/variants.py +++ b/chromium/v8/tools/testrunner/local/variants.py @@ -15,10 +15,9 @@ ALL_VARIANT_FLAGS = { "experimental_regexp": [["--default-to-experimental-regexp-engine"]], "jitless": [["--jitless"]], "sparkplug": [["--sparkplug"]], + "concurrent_sparkplug": [["--concurrent-sparkplug", "--sparkplug"]], "always_sparkplug": [[ "--always-sparkplug", "--sparkplug"]], "minor_mc": [["--minor-mc"]], - "no_concurrent_inlining": [["--no-concurrent-inlining", - "--no-stress-concurrent-inlining"]], "no_lfa": [["--no-lazy-feedback-allocation"]], # No optimization means disable all optimizations. OptimizeFunctionOnNextCall # would not force optimization too. It turns into a Nop. Please see @@ -31,8 +30,7 @@ ALL_VARIANT_FLAGS = { "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", - "--concurrent-inlining"]], + "stress_concurrent_inlining": [["--stress-concurrent-inlining"]], "stress_js_bg_compile_wasm_code_gc": [["--stress-background-compile", "--stress-wasm-code-gc"]], "stress_incremental_marking": [["--stress-incremental-marking"]], @@ -40,8 +38,6 @@ ALL_VARIANT_FLAGS = { # Trigger stress sampling allocation profiler with sample interval = 2^14 "stress_sampling": [["--stress-sampling-allocation-profiler=16384"]], "no_wasm_traps": [["--no-wasm-trap-handler"]], - "turboprop": [["--turboprop"]], - "turboprop_as_toptier": [["--turboprop-as-toptier", "--turboprop"]], "instruction_scheduling": [["--turbo-instruction-scheduling"]], "stress_instruction_scheduling": [["--turbo-stress-instruction-scheduling"]], "wasm_write_protect_code": [["--wasm-write-protect-code-memory"]], @@ -55,15 +51,15 @@ ALL_VARIANT_FLAGS = { # implications defined in flag-definitions.h. INCOMPATIBLE_FLAGS_PER_VARIANT = { "jitless": ["--opt", "--always-opt", "--liftoff", "--track-field-types", - "--validate-asm", "--sparkplug", "--always-sparkplug", - "--regexp-tier-up", "--no-regexp-interpret-all"], + "--validate-asm", "--sparkplug", "--concurrent-sparkplug", + "--always-sparkplug", "--regexp-tier-up", "--no-regexp-interpret-all"], "nooptimization": ["--always-opt"], "slow_path": ["--no-force-slow-path"], "stress_concurrent_allocation": ["--single-threaded-gc", "--predictable"], "stress_concurrent_inlining": ["--single-threaded", "--predictable", - "--turboprop", "--lazy-feedback-allocation", - "--assert-types"], - "turboprop": ["--stress_concurrent_inlining"], + "--lazy-feedback-allocation", + "--assert-types", + "--no-concurrent-recompilation"], # The fast API tests initialize an embedder object that never needs to be # serialized to the snapshot, so we don't have a # SerializeInternalFieldsCallback for it, so they are incompatible with @@ -72,8 +68,10 @@ INCOMPATIBLE_FLAGS_PER_VARIANT = { "stress": ["--always-opt", "--no-always-opt", "--max-inlined-bytecode-size=*", "--max-inlined-bytecode-size-cumulative=*", "--stress-inline", - "--liftoff-only", "--wasm-speculative-inlining"], + "--liftoff-only", "--wasm-speculative-inlining", + "--wasm-dynamic-tiering"], "sparkplug": ["--jitless"], + "concurrent_sparkplug": ["--jitless"], "always_sparkplug": ["--jitless"], "code_serializer": ["--cache=after-execute", "--cache=full-code-cache", "--cache=none"], @@ -81,7 +79,7 @@ INCOMPATIBLE_FLAGS_PER_VARIANT = { # There is a negative implication: --perf-prof disables # --wasm-write-protect-code-memory. "wasm_write_protect_code": ["--perf-prof"], - "assert_types": ["--concurrent-recompilation", "--concurrent-inlining", "--stress_concurrent_inlining", "--no-assert-types"], + "assert_types": ["--concurrent-recompilation", "--stress_concurrent_inlining", "--no-assert-types"], } # Flags that lead to a contradiction under certain build variables. @@ -99,8 +97,6 @@ INCOMPATIBLE_FLAGS_PER_BUILD_VARIABLE = { "--stress-concurrent-allocation", "--stress-concurrent-inlining"], "dict_property_const_tracking": [ - "--concurrent-inlining", - "--turboprop", "--stress-concurrent-inlining"], } diff --git a/chromium/v8/tools/testrunner/objects/testcase.py b/chromium/v8/tools/testrunner/objects/testcase.py index 19fbdd6c112..82fb5430553 100644 --- a/chromium/v8/tools/testrunner/objects/testcase.py +++ b/chromium/v8/tools/testrunner/objects/testcase.py @@ -75,11 +75,11 @@ except NameError: def cmp(x, y): # Python 3 return (x > y) - (x < y) -def read_file_utf8(file): +def read_file(file): try: # Python 3 - with open(file, encoding='utf-8') as f: + with open(file, encoding='ISO-8859-1') as f: return f.read() - except TypeError: # Python 2 + except TypeError: # Python 2 .. with open(file) as f: return f.read() @@ -414,7 +414,7 @@ class TestCase(object): return self._get_source_path() is not None def get_source(self): - return read_file_utf8(self._get_source_path()) + return read_file(self._get_source_path()) def _get_source_path(self): return None @@ -460,7 +460,7 @@ class D8TestCase(TestCase): """Returns for a given file a list of absolute paths of files needed by the given file. """ - source = read_file_utf8(file) + source = read_file(file) result = [] def add_path(path): result.append(os.path.abspath(path.replace('/', os.path.sep))) diff --git a/chromium/v8/tools/testrunner/outproc/base.py b/chromium/v8/tools/testrunner/outproc/base.py index 74a1d901590..b7ee301c5e2 100644 --- a/chromium/v8/tools/testrunner/outproc/base.py +++ b/chromium/v8/tools/testrunner/outproc/base.py @@ -2,7 +2,12 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import itertools +try: # Python3 + from itertools import zip_longest + PYTHON3 = True +except ImportError: # Python2 + from itertools import izip_longest as zip_longest + PYTHON3 = False from ..testproc.base import ( DROP_RESULT, DROP_OUTPUT, DROP_PASS_OUTPUT, DROP_PASS_STDOUT) @@ -140,13 +145,15 @@ class ExpectedOutProc(OutProc): def _is_failure_output(self, output): if output.exit_code != 0: - return True + return True - with open(self._expected_filename, 'r') as f: + # TODO(https://crbug.com/1292013): Simplify after Python3 migration. + kwargs = {'encoding': 'utf-8'} if PYTHON3 else {} + with open(self._expected_filename, 'r', **kwargs) as f: expected_lines = f.readlines() for act_iterator in self._act_block_iterator(output): - for expected, actual in itertools.izip_longest( + for expected, actual in zip_longest( self._expected_iterator(expected_lines), act_iterator, fillvalue='' diff --git a/chromium/v8/tools/testrunner/outproc/message.py b/chromium/v8/tools/testrunner/outproc/message.py index c301529eb7d..39b8eadf64e 100644 --- a/chromium/v8/tools/testrunner/outproc/message.py +++ b/chromium/v8/tools/testrunner/outproc/message.py @@ -2,10 +2,14 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import itertools import os import re +try: # Python3 + from itertools import zip_longest +except ImportError: # Python2 + from itertools import izip_longest as zip_longest + from . import base @@ -44,7 +48,7 @@ class OutProc(base.ExpectedOutProc): env = { 'basename': os.path.basename(base_path), } - for (expected, actual) in itertools.izip_longest( + for (expected, actual) in zip_longest( expected_lines, actual_lines, fillvalue=''): pattern = re.escape(expected.rstrip() % env) pattern = pattern.replace('\\*', '.*') diff --git a/chromium/v8/tools/testrunner/standard_runner.py b/chromium/v8/tools/testrunner/standard_runner.py index 08f17e77216..eed75274539 100755 --- a/chromium/v8/tools/testrunner/standard_runner.py +++ b/chromium/v8/tools/testrunner/standard_runner.py @@ -46,7 +46,7 @@ VARIANT_ALIASES = { # Shortcut for the two above ('more' first - it has the longer running tests) 'exhaustive': MORE_VARIANTS + VARIANTS, # Additional variants, run on a subset of bots. - 'extra': ['nooptimization', 'future', 'no_wasm_traps', 'turboprop', + 'extra': ['nooptimization', 'future', 'no_wasm_traps', 'instruction_scheduling', 'always_sparkplug'], } diff --git a/chromium/v8/tools/testrunner/testproc/fuzzer.py b/chromium/v8/tools/testrunner/testproc/fuzzer.py index b5b87d8bfb5..e75c93f24a4 100644 --- a/chromium/v8/tools/testrunner/testproc/fuzzer.py +++ b/chromium/v8/tools/testrunner/testproc/fuzzer.py @@ -11,44 +11,45 @@ from . import base # Extra flags randomly added to all fuzz tests with numfuzz. List of tuples # (probability, flag). EXTRA_FLAGS = [ - (0.1, '--always-opt'), - (0.1, '--assert-types'), - (0.1, '--budget-for-feedback-vector-allocation=0'), - (0.1, '--cache=code'), - (0.1, '--force-slow-path'), - (0.2, '--future'), - (0.1, '--interrupt-budget=100'), - (0.1, '--liftoff'), - (0.2, '--no-analyze-environment-liveness'), - # TODO(machenbach): Enable when it doesn't collide with crashing on missing - # simd features. - #(0.1, '--no-enable-sse3'), - #(0.1, '--no-enable-ssse3'), - #(0.1, '--no-enable-sse4_1'), - (0.1, '--no-enable-sse4_2'), - (0.1, '--no-enable-sahf'), - (0.1, '--no-enable-avx'), - (0.1, '--no-enable-fma3'), - (0.1, '--no-enable-bmi1'), - (0.1, '--no-enable-bmi2'), - (0.1, '--no-enable-lzcnt'), - (0.1, '--no-enable-popcnt'), - (0.3, '--no-lazy-feedback-allocation'), - (0.1, '--no-liftoff'), - (0.1, '--no-opt'), - (0.2, '--no-regexp-tier-up'), - (0.1, '--no-wasm-tier-up'), - (0.1, '--regexp-interpret-all'), - (0.1, '--regexp-tier-up-ticks=10'), - (0.1, '--regexp-tier-up-ticks=100'), - (0.1, '--stress-background-compile'), - (0.1, '--stress-concurrent-inlining'), - (0.1, '--stress-flush-code'), - (0.1, '--stress-lazy-source-positions'), - (0.1, '--stress-wasm-code-gc'), - (0.1, '--turbo-instruction-scheduling'), - (0.1, '--turbo-stress-instruction-scheduling'), - (0.1, '--turbo-force-mid-tier-regalloc'), + (0.1, '--always-opt'), + (0.1, '--assert-types'), + (0.1, '--interrupt-budget-for-feedback-allocation=0'), + (0.1, '--cache=code'), + (0.25, '--compact-map-space'), + (0.1, '--force-slow-path'), + (0.2, '--future'), + (0.1, '--interrupt-budget=100'), + (0.1, '--liftoff'), + (0.2, '--no-analyze-environment-liveness'), + # TODO(machenbach): Enable when it doesn't collide with crashing on missing + # simd features. + #(0.1, '--no-enable-sse3'), + #(0.1, '--no-enable-ssse3'), + #(0.1, '--no-enable-sse4_1'), + (0.1, '--no-enable-sse4_2'), + (0.1, '--no-enable-sahf'), + (0.1, '--no-enable-avx'), + (0.1, '--no-enable-fma3'), + (0.1, '--no-enable-bmi1'), + (0.1, '--no-enable-bmi2'), + (0.1, '--no-enable-lzcnt'), + (0.1, '--no-enable-popcnt'), + (0.3, '--no-lazy-feedback-allocation'), + (0.1, '--no-liftoff'), + (0.1, '--no-opt'), + (0.2, '--no-regexp-tier-up'), + (0.1, '--no-wasm-tier-up'), + (0.1, '--regexp-interpret-all'), + (0.1, '--regexp-tier-up-ticks=10'), + (0.1, '--regexp-tier-up-ticks=100'), + (0.1, '--stress-background-compile'), + (0.1, '--stress-concurrent-inlining'), + (0.1, '--stress-flush-code'), + (0.1, '--stress-lazy-source-positions'), + (0.1, '--stress-wasm-code-gc'), + (0.1, '--turbo-instruction-scheduling'), + (0.1, '--turbo-stress-instruction-scheduling'), + (0.1, '--turbo-force-mid-tier-regalloc'), ] def random_extra_flags(rng): @@ -277,7 +278,8 @@ class InterruptBudgetFuzzer(Fuzzer): # For most code paths, only one of the flags below has a meaning # based on the flag above. flag2 = '--interrupt-budget=%d' % rng.randint(0, 135168) - flag3 = '--budget-for-feedback-vector-allocation=%d' % rng.randint(0, 940) + flag3 = '--interrupt-budget-for-feedback-allocation=%d' % rng.randint( + 0, 940) yield [flag1, flag2, flag3] diff --git a/chromium/v8/tools/torque/format-torque.py b/chromium/v8/tools/torque/format-torque.py index 638ca100fb9..98ae087ca1d 100755 --- a/chromium/v8/tools/torque/format-torque.py +++ b/chromium/v8/tools/torque/format-torque.py @@ -15,6 +15,14 @@ import sys import re from subprocess import Popen, PIPE +PYTHON3 = sys.version_info >= (3, 0) + +def maybe_decode(arg, encoding="utf-8"): + return arg.decode(encoding) if PYTHON3 else arg + +def maybe_encode(arg, encoding="utf-8"): + return arg.encode(encoding) if PYTHON3 else arg + kPercentEscape = r'α'; # Unicode alpha kDerefEscape = r'☆'; # Unicode star kAddressofEscape = r'⌂'; # Unicode house @@ -103,8 +111,8 @@ def process(filename, lint, should_format): p = Popen(['clang-format', '-assume-filename=.ts'], stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True) else: p = Popen(['clang-format', '-assume-filename=.ts'], stdin=PIPE, stdout=PIPE, stderr=PIPE) - output, err = p.communicate(preprocess(content)) - output = postprocess(output) + output, err = p.communicate(maybe_encode(preprocess(content))) + output = postprocess(maybe_decode(output)) rc = p.returncode if (rc != 0): print("error code " + str(rc) + " running clang-format. Exiting...") diff --git a/chromium/v8/tools/turbolizer/OWNERS b/chromium/v8/tools/turbolizer/OWNERS index b7694bd267b..fc52961eff7 100644 --- a/chromium/v8/tools/turbolizer/OWNERS +++ b/chromium/v8/tools/turbolizer/OWNERS @@ -1,2 +1 @@ danno@chromium.org -sigurds@chromium.org diff --git a/chromium/v8/tools/unittests/compare_torque_output_test.py b/chromium/v8/tools/unittests/compare_torque_output_test.py index a6086d96c9a..d5a5c4a1253 100644 --- a/chromium/v8/tools/unittests/compare_torque_output_test.py +++ b/chromium/v8/tools/unittests/compare_torque_output_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # 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. @@ -14,6 +14,11 @@ TOOLS_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) COMPARE_SCRIPT = os.path.join(TOOLS_DIR, 'compare_torque_output.py') TEST_DATA = os.path.join(TOOLS_DIR, 'unittests', 'testdata', 'compare_torque') +_PY3 = sys.version_info[0] == 3 +PYTHON_EXECUTABLE = "python%s" % sys.version_info[0] + +def maybe_bytes(value): + return value.decode("utf-8") if _PY3 else value class PredictableTest(unittest.TestCase): def setUp(self): @@ -24,7 +29,7 @@ class PredictableTest(unittest.TestCase): file1 = os.path.join(TEST_DATA, test_folder, 'f1') file2 = os.path.join(TEST_DATA, test_folder, 'f2') proc = subprocess.Popen([ - 'python', '-u', + PYTHON_EXECUTABLE, '-u', COMPARE_SCRIPT, file1, file2, self.tmp_file ], stdout=subprocess.PIPE, stderr=subprocess.PIPE) _, err = proc.communicate() @@ -34,7 +39,7 @@ class PredictableTest(unittest.TestCase): exitcode, output = self._compare_from('test1') self.assertEqual(1, exitcode) full_match = r'^Found.*-line 2\+line 2 with diff.*\+line 3\n\n$' - self.assertRegexpMatches(output, re.compile(full_match, re.M | re.S)) + self.assertRegexpMatches(maybe_bytes(output), re.compile(full_match, re.M | re.S)) def test_no_diff(self): exitcode, output = self._compare_from('test2') @@ -44,12 +49,12 @@ class PredictableTest(unittest.TestCase): def test_right_only(self): exitcode, output = self._compare_from('test3') self.assertEqual(1, exitcode) - self.assertRegexpMatches(output, r'Some files exist only in.*f2\nfile3') + self.assertRegexpMatches(maybe_bytes(output), r'Some files exist only in.*f2\nfile3') def test_left_only(self): exitcode, output = self._compare_from('test4') self.assertEqual(1, exitcode) - self.assertRegexpMatches(output, r'Some files exist only in.*f1\nfile4') + self.assertRegexpMatches(maybe_bytes(output), r'Some files exist only in.*f1\nfile4') def tearDown(self): os.unlink(self.tmp_file) diff --git a/chromium/v8/tools/unittests/run_perf_test.py b/chromium/v8/tools/unittests/run_perf_test.py index 28f71b2b339..6d8c5e2a130 100755 --- a/chromium/v8/tools/unittests/run_perf_test.py +++ b/chromium/v8/tools/unittests/run_perf_test.py @@ -28,6 +28,8 @@ TEST_DATA = os.path.join(BASE_DIR, 'unittests', 'testdata') TEST_WORKSPACE = os.path.join(tempfile.gettempdir(), 'test-v8-run-perf') +SORT_KEY = lambda x: x['graphs'] + V8_JSON = { 'path': ['.'], 'owners': ['username@chromium.org'], @@ -196,8 +198,8 @@ class PerfTest(unittest.TestCase): {'units': units, 'graphs': [suite, trace['name']], 'results': trace['results'], - 'stddev': trace['stddev']} for trace in traces]), - sorted(self._LoadResults(file_name)['traces'])) + 'stddev': trace['stddev']} for trace in traces], key=SORT_KEY), + sorted(self._LoadResults(file_name)['traces'], key=SORT_KEY)) def _VerifyRunnableDurations(self, runs, timeout, file_name=None): self.assertListEqual([ @@ -368,7 +370,7 @@ class PerfTest(unittest.TestCase): 'graphs': ['test', 'DeltaBlue'], 'results': [200.0], 'stddev': ''}, - ]), sorted(self._LoadResults()['traces'])) + ], key=SORT_KEY), sorted(self._LoadResults()['traces'], key=SORT_KEY)) self._VerifyErrors([]) self._VerifyMockMultiple( (os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js'), @@ -605,7 +607,7 @@ class PerfTest(unittest.TestCase): 'results': [2.1, 2.1], 'stddev': '', }, - ]), sorted(results['traces'])) + ], key=SORT_KEY), sorted(results['traces'], key=SORT_KEY)) def testResultsProcessor(self): results = self._RunPerf('d8_mocked2.py', 'test2.json') diff --git a/chromium/v8/tools/unittests/run_tests_test.py b/chromium/v8/tools/unittests/run_tests_test.py index 89acacaaa36..762d3096ec4 100755 --- a/chromium/v8/tools/unittests/run_tests_test.py +++ b/chromium/v8/tools/unittests/run_tests_test.py @@ -30,7 +30,11 @@ import sys import tempfile import unittest -from cStringIO import StringIO +# TODO(https://crbug.com/1292016): Remove after Python3 migration. +try: + from cStringIO import StringIO +except ImportError: + from io import StringIO TOOLS_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEST_DATA_ROOT = os.path.join(TOOLS_ROOT, 'unittests', 'testdata') @@ -277,7 +281,9 @@ class SystemTest(unittest.TestCase): # We need lexicographic sorting here to avoid non-deterministic behaviour # The original sorting key is duration, but in our fake test we have # non-deterministic durations before we reset them to 1 - json_output['slowest_tests'].sort(key= lambda x: str(x)) + def sort_key(x): + return str(sorted(x.items())) + json_output['slowest_tests'].sort(key=sort_key) with open(os.path.join(TEST_DATA_ROOT, expected_results_name)) as f: expected_test_results = json.load(f) @@ -351,7 +357,8 @@ class SystemTest(unittest.TestCase): v8_enable_verify_csa=False, v8_enable_lite_mode=False, v8_enable_pointer_compression=False, v8_enable_pointer_compression_shared_cage=False, - v8_enable_virtual_memory_cage=False) + v8_enable_shared_ro_heap=False, + v8_enable_sandbox=False) result = run_tests( basedir, '--progress=verbose', diff --git a/chromium/v8/tools/v8_presubmit.py b/chromium/v8/tools/v8_presubmit.py index f4212794513..459f63bb1c1 100755 --- a/chromium/v8/tools/v8_presubmit.py +++ b/chromium/v8/tools/v8_presubmit.py @@ -41,20 +41,28 @@ except ImportError as e: import json +import multiprocessing import optparse import os from os.path import abspath, join, dirname, basename, exists import pickle import re -import sys import subprocess -import multiprocessing from subprocess import PIPE +import sys from testrunner.local import statusfile from testrunner.local import testsuite from testrunner.local import utils +PYTHON3 = sys.version_info >= (3, 0) + +def maybe_decode(arg, encoding="utf-8"): + return arg.decode(encoding) if PYTHON3 else arg + +def maybe_encode(arg, encoding="utf-8"): + return arg.encode(encoding) if PYTHON3 else arg + # Special LINT rules diverging from default and reason. # build/header_guard: Our guards have the form "V8_FOO_H_", not "SRC_FOO_H_". # We now run our own header guard check in PRESUBMIT.py. @@ -76,7 +84,7 @@ LINT_RULES = """ -whitespace/comments """.split() -LINT_OUTPUT_PATTERN = re.compile(r'^.+[:(]\d+[:)]|^Done processing') +LINT_OUTPUT_PATTERN = re.compile(r'^.+[:(]\d+[:)]') FLAGS_LINE = re.compile("//\s*Flags:.*--([A-z0-9-])+_[A-z0-9].*\n") ASSERT_OPTIMIZED_PATTERN = re.compile("assertOptimized") FLAGS_ENABLE_OPT = re.compile("//\s*Flags:.*--opt[^-].*\n") @@ -92,16 +100,20 @@ def CppLintWorker(command): out_lines = "" error_count = -1 while True: - out_line = process.stderr.readline() + out_line = maybe_decode(process.stderr.readline()) if out_line == '' and process.poll() != None: if error_count == -1: print("Failed to process %s" % command.pop()) return 1 break - m = LINT_OUTPUT_PATTERN.match(out_line) - if m: - out_lines += out_line + if out_line.strip() == 'Total errors found: 0': + out_lines += "Done processing %s\n" % command.pop() error_count += 1 + else: + m = LINT_OUTPUT_PATTERN.match(out_line) + if m: + out_lines += out_line + error_count += 1 sys.stdout.write(out_lines) return error_count except KeyboardInterrupt: @@ -118,7 +130,7 @@ def TorqueLintWorker(command): out_lines = "" error_count = 0 while True: - out_line = process.stderr.readline() + out_line = maybe_decode(process.stderr.readline()) if out_line == '' and process.poll() != None: break out_lines += out_line @@ -148,7 +160,7 @@ def JSLintWorker(command): sys.stdout.write("error code " + str(rc) + " running clang-format.\n") return rc - if output != contents: + if maybe_decode(output) != contents: return 1 return 0 @@ -206,7 +218,7 @@ class FileContentsCache(object): for file in files: try: handle = open(file, "r") - file_sum = md5er(handle.read()).digest() + file_sum = md5er(maybe_encode(handle.read())).digest() if not file in self.sums or self.sums[file] != file_sum: changed_or_new.append(file) self.sums[file] = file_sum @@ -441,7 +453,7 @@ class JSLintProcessor(CacheableSourceFileProcessor): return name.endswith('.js') or name.endswith('.mjs') def GetPathsToSearch(self): - return ['tools/system-analyzer'] + return ['tools/system-analyzer', 'tools/heap-layout', 'tools/js'] def GetProcessorWorker(self): return JSLintWorker @@ -490,7 +502,7 @@ class SourceProcessor(SourceFileProcessor): output = subprocess.Popen('git ls-files --full-name', stdout=PIPE, cwd=path, shell=True) result = [] - for file in output.stdout.read().split(): + for file in maybe_decode(output.stdout.read()).split(): for dir_part in os.path.dirname(file).replace(os.sep, '/').split('/'): if self.IgnoreDir(dir_part): break @@ -623,8 +635,8 @@ class SourceProcessor(SourceFileProcessor): violations = 0 for file in files: try: - handle = open(file) - contents = handle.read() + handle = open(file, "rb") + contents = maybe_decode(handle.read(), "ISO-8859-1") if len(contents) > 0 and not self.ProcessContents(file, contents): success = False violations += 1 @@ -733,7 +745,7 @@ def CheckDeps(workspace): def PyTests(workspace): result = True for script in [ - join(workspace, 'tools', 'clusterfuzz', 'v8_foozzie_test.py'), + join(workspace, 'tools', 'clusterfuzz', 'foozzie', 'v8_foozzie_test.py'), join(workspace, 'tools', 'release', 'test_scripts.py'), join(workspace, 'tools', 'unittests', 'run_tests_test.py'), join(workspace, 'tools', 'unittests', 'run_perf_test.py'), diff --git a/chromium/v8/tools/v8heapconst.py b/chromium/v8/tools/v8heapconst.py index 306eeb7aa27..4da63178038 100644 --- a/chromium/v8/tools/v8heapconst.py +++ b/chromium/v8/tools/v8heapconst.py @@ -6,6 +6,8 @@ # be modified manually. # List of known V8 instance types. +# yapf: disable + INSTANCE_TYPES = { 0: "INTERNALIZED_STRING_TYPE", 2: "EXTERNAL_INTERNALIZED_STRING_TYPE", @@ -55,119 +57,123 @@ INSTANCE_TYPES = { 151: "BREAK_POINT_INFO_TYPE", 152: "CACHED_TEMPLATE_OBJECT_TYPE", 153: "CALL_HANDLER_INFO_TYPE", - 154: "CLASS_POSITIONS_TYPE", - 155: "DEBUG_INFO_TYPE", - 156: "ENUM_CACHE_TYPE", - 157: "FEEDBACK_CELL_TYPE", - 158: "FUNCTION_TEMPLATE_RARE_DATA_TYPE", - 159: "INTERCEPTOR_INFO_TYPE", - 160: "INTERPRETER_DATA_TYPE", - 161: "MODULE_REQUEST_TYPE", - 162: "PROMISE_CAPABILITY_TYPE", - 163: "PROMISE_REACTION_TYPE", - 164: "PROPERTY_DESCRIPTOR_OBJECT_TYPE", - 165: "PROTOTYPE_INFO_TYPE", - 166: "REG_EXP_BOILERPLATE_DESCRIPTION_TYPE", - 167: "SCRIPT_TYPE", - 168: "SCRIPT_OR_MODULE_TYPE", - 169: "SOURCE_TEXT_MODULE_INFO_ENTRY_TYPE", - 170: "STACK_FRAME_INFO_TYPE", - 171: "TEMPLATE_OBJECT_DESCRIPTION_TYPE", - 172: "TUPLE2_TYPE", - 173: "WASM_CONTINUATION_OBJECT_TYPE", - 174: "WASM_EXCEPTION_TAG_TYPE", - 175: "WASM_INDIRECT_FUNCTION_TABLE_TYPE", - 176: "FIXED_ARRAY_TYPE", - 177: "HASH_TABLE_TYPE", - 178: "EPHEMERON_HASH_TABLE_TYPE", - 179: "GLOBAL_DICTIONARY_TYPE", - 180: "NAME_DICTIONARY_TYPE", - 181: "NUMBER_DICTIONARY_TYPE", - 182: "ORDERED_HASH_MAP_TYPE", - 183: "ORDERED_HASH_SET_TYPE", - 184: "ORDERED_NAME_DICTIONARY_TYPE", - 185: "SIMPLE_NUMBER_DICTIONARY_TYPE", - 186: "CLOSURE_FEEDBACK_CELL_ARRAY_TYPE", - 187: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE", - 188: "SCRIPT_CONTEXT_TABLE_TYPE", - 189: "BYTE_ARRAY_TYPE", - 190: "BYTECODE_ARRAY_TYPE", - 191: "FIXED_DOUBLE_ARRAY_TYPE", - 192: "INTERNAL_CLASS_WITH_SMI_ELEMENTS_TYPE", - 193: "SLOPPY_ARGUMENTS_ELEMENTS_TYPE", - 194: "AWAIT_CONTEXT_TYPE", - 195: "BLOCK_CONTEXT_TYPE", - 196: "CATCH_CONTEXT_TYPE", - 197: "DEBUG_EVALUATE_CONTEXT_TYPE", - 198: "EVAL_CONTEXT_TYPE", - 199: "FUNCTION_CONTEXT_TYPE", - 200: "MODULE_CONTEXT_TYPE", - 201: "NATIVE_CONTEXT_TYPE", - 202: "SCRIPT_CONTEXT_TYPE", - 203: "WITH_CONTEXT_TYPE", + 154: "CALL_SITE_INFO_TYPE", + 155: "CLASS_POSITIONS_TYPE", + 156: "DEBUG_INFO_TYPE", + 157: "ENUM_CACHE_TYPE", + 158: "ERROR_STACK_DATA_TYPE", + 159: "FEEDBACK_CELL_TYPE", + 160: "FUNCTION_TEMPLATE_RARE_DATA_TYPE", + 161: "INTERCEPTOR_INFO_TYPE", + 162: "INTERPRETER_DATA_TYPE", + 163: "MODULE_REQUEST_TYPE", + 164: "PROMISE_CAPABILITY_TYPE", + 165: "PROMISE_REACTION_TYPE", + 166: "PROPERTY_DESCRIPTOR_OBJECT_TYPE", + 167: "PROTOTYPE_INFO_TYPE", + 168: "REG_EXP_BOILERPLATE_DESCRIPTION_TYPE", + 169: "SCRIPT_TYPE", + 170: "SCRIPT_OR_MODULE_TYPE", + 171: "SOURCE_TEXT_MODULE_INFO_ENTRY_TYPE", + 172: "STACK_FRAME_INFO_TYPE", + 173: "TEMPLATE_OBJECT_DESCRIPTION_TYPE", + 174: "TUPLE2_TYPE", + 175: "WASM_CONTINUATION_OBJECT_TYPE", + 176: "WASM_EXCEPTION_TAG_TYPE", + 177: "WASM_INDIRECT_FUNCTION_TABLE_TYPE", + 178: "FIXED_ARRAY_TYPE", + 179: "HASH_TABLE_TYPE", + 180: "EPHEMERON_HASH_TABLE_TYPE", + 181: "GLOBAL_DICTIONARY_TYPE", + 182: "NAME_DICTIONARY_TYPE", + 183: "NAME_TO_INDEX_HASH_TABLE_TYPE", + 184: "NUMBER_DICTIONARY_TYPE", + 185: "ORDERED_HASH_MAP_TYPE", + 186: "ORDERED_HASH_SET_TYPE", + 187: "ORDERED_NAME_DICTIONARY_TYPE", + 188: "SIMPLE_NUMBER_DICTIONARY_TYPE", + 189: "CLOSURE_FEEDBACK_CELL_ARRAY_TYPE", + 190: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE", + 191: "SCRIPT_CONTEXT_TABLE_TYPE", + 192: "BYTE_ARRAY_TYPE", + 193: "BYTECODE_ARRAY_TYPE", + 194: "FIXED_DOUBLE_ARRAY_TYPE", + 195: "INTERNAL_CLASS_WITH_SMI_ELEMENTS_TYPE", + 196: "SLOPPY_ARGUMENTS_ELEMENTS_TYPE", + 197: "TURBOFAN_BITSET_TYPE_TYPE", + 198: "TURBOFAN_HEAP_CONSTANT_TYPE_TYPE", + 199: "TURBOFAN_OTHER_NUMBER_CONSTANT_TYPE_TYPE", + 200: "TURBOFAN_RANGE_TYPE_TYPE", + 201: "TURBOFAN_UNION_TYPE_TYPE", + 202: "ABSTRACT_INTERNAL_CLASS_SUBCLASS1_TYPE", + 203: "ABSTRACT_INTERNAL_CLASS_SUBCLASS2_TYPE", 204: "FOREIGN_TYPE", 205: "WASM_INTERNAL_FUNCTION_TYPE", 206: "WASM_TYPE_INFO_TYPE", - 207: "TURBOFAN_BITSET_TYPE_TYPE", - 208: "TURBOFAN_HEAP_CONSTANT_TYPE_TYPE", - 209: "TURBOFAN_OTHER_NUMBER_CONSTANT_TYPE_TYPE", - 210: "TURBOFAN_RANGE_TYPE_TYPE", - 211: "TURBOFAN_UNION_TYPE_TYPE", - 212: "UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE", - 213: "UNCOMPILED_DATA_WITH_PREPARSE_DATA_AND_JOB_TYPE", - 214: "UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE", - 215: "UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_WITH_JOB_TYPE", - 216: "WASM_FUNCTION_DATA_TYPE", - 217: "WASM_CAPI_FUNCTION_DATA_TYPE", - 218: "WASM_EXPORTED_FUNCTION_DATA_TYPE", - 219: "WASM_JS_FUNCTION_DATA_TYPE", - 220: "EXPORTED_SUB_CLASS_BASE_TYPE", - 221: "EXPORTED_SUB_CLASS_TYPE", - 222: "EXPORTED_SUB_CLASS2_TYPE", - 223: "SMALL_ORDERED_HASH_MAP_TYPE", - 224: "SMALL_ORDERED_HASH_SET_TYPE", - 225: "SMALL_ORDERED_NAME_DICTIONARY_TYPE", - 226: "ABSTRACT_INTERNAL_CLASS_SUBCLASS1_TYPE", - 227: "ABSTRACT_INTERNAL_CLASS_SUBCLASS2_TYPE", - 228: "DESCRIPTOR_ARRAY_TYPE", - 229: "STRONG_DESCRIPTOR_ARRAY_TYPE", - 230: "SOURCE_TEXT_MODULE_TYPE", - 231: "SYNTHETIC_MODULE_TYPE", - 232: "WEAK_FIXED_ARRAY_TYPE", - 233: "TRANSITION_ARRAY_TYPE", - 234: "CELL_TYPE", - 235: "CODE_TYPE", - 236: "CODE_DATA_CONTAINER_TYPE", - 237: "COVERAGE_INFO_TYPE", - 238: "EMBEDDER_DATA_ARRAY_TYPE", - 239: "FEEDBACK_METADATA_TYPE", - 240: "FEEDBACK_VECTOR_TYPE", - 241: "FILLER_TYPE", - 242: "FREE_SPACE_TYPE", - 243: "INTERNAL_CLASS_TYPE", - 244: "INTERNAL_CLASS_WITH_STRUCT_ELEMENTS_TYPE", - 245: "MAP_TYPE", - 246: "MEGA_DOM_HANDLER_TYPE", - 247: "ON_HEAP_BASIC_BLOCK_PROFILER_DATA_TYPE", - 248: "PREPARSE_DATA_TYPE", - 249: "PROPERTY_ARRAY_TYPE", - 250: "PROPERTY_CELL_TYPE", - 251: "SCOPE_INFO_TYPE", - 252: "SHARED_FUNCTION_INFO_TYPE", - 253: "SMI_BOX_TYPE", - 254: "SMI_PAIR_TYPE", - 255: "SORT_STATE_TYPE", - 256: "SWISS_NAME_DICTIONARY_TYPE", - 257: "WASM_API_FUNCTION_REF_TYPE", - 258: "WEAK_ARRAY_LIST_TYPE", - 259: "WEAK_CELL_TYPE", - 260: "WASM_ARRAY_TYPE", - 261: "WASM_STRUCT_TYPE", - 262: "JS_PROXY_TYPE", + 207: "AWAIT_CONTEXT_TYPE", + 208: "BLOCK_CONTEXT_TYPE", + 209: "CATCH_CONTEXT_TYPE", + 210: "DEBUG_EVALUATE_CONTEXT_TYPE", + 211: "EVAL_CONTEXT_TYPE", + 212: "FUNCTION_CONTEXT_TYPE", + 213: "MODULE_CONTEXT_TYPE", + 214: "NATIVE_CONTEXT_TYPE", + 215: "SCRIPT_CONTEXT_TYPE", + 216: "WITH_CONTEXT_TYPE", + 217: "UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE", + 218: "UNCOMPILED_DATA_WITH_PREPARSE_DATA_AND_JOB_TYPE", + 219: "UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE", + 220: "UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_WITH_JOB_TYPE", + 221: "WASM_FUNCTION_DATA_TYPE", + 222: "WASM_CAPI_FUNCTION_DATA_TYPE", + 223: "WASM_EXPORTED_FUNCTION_DATA_TYPE", + 224: "WASM_JS_FUNCTION_DATA_TYPE", + 225: "EXPORTED_SUB_CLASS_BASE_TYPE", + 226: "EXPORTED_SUB_CLASS_TYPE", + 227: "EXPORTED_SUB_CLASS2_TYPE", + 228: "SMALL_ORDERED_HASH_MAP_TYPE", + 229: "SMALL_ORDERED_HASH_SET_TYPE", + 230: "SMALL_ORDERED_NAME_DICTIONARY_TYPE", + 231: "DESCRIPTOR_ARRAY_TYPE", + 232: "STRONG_DESCRIPTOR_ARRAY_TYPE", + 233: "SOURCE_TEXT_MODULE_TYPE", + 234: "SYNTHETIC_MODULE_TYPE", + 235: "WEAK_FIXED_ARRAY_TYPE", + 236: "TRANSITION_ARRAY_TYPE", + 237: "CELL_TYPE", + 238: "CODE_TYPE", + 239: "CODE_DATA_CONTAINER_TYPE", + 240: "COVERAGE_INFO_TYPE", + 241: "EMBEDDER_DATA_ARRAY_TYPE", + 242: "FEEDBACK_METADATA_TYPE", + 243: "FEEDBACK_VECTOR_TYPE", + 244: "FILLER_TYPE", + 245: "FREE_SPACE_TYPE", + 246: "INTERNAL_CLASS_TYPE", + 247: "INTERNAL_CLASS_WITH_STRUCT_ELEMENTS_TYPE", + 248: "MAP_TYPE", + 249: "MEGA_DOM_HANDLER_TYPE", + 250: "ON_HEAP_BASIC_BLOCK_PROFILER_DATA_TYPE", + 251: "PREPARSE_DATA_TYPE", + 252: "PROPERTY_ARRAY_TYPE", + 253: "PROPERTY_CELL_TYPE", + 254: "SCOPE_INFO_TYPE", + 255: "SHARED_FUNCTION_INFO_TYPE", + 256: "SMI_BOX_TYPE", + 257: "SMI_PAIR_TYPE", + 258: "SORT_STATE_TYPE", + 259: "SWISS_NAME_DICTIONARY_TYPE", + 260: "WASM_API_FUNCTION_REF_TYPE", + 261: "WASM_ON_FULFILLED_DATA_TYPE", + 262: "WEAK_ARRAY_LIST_TYPE", + 263: "WEAK_CELL_TYPE", + 264: "WASM_ARRAY_TYPE", + 265: "WASM_STRUCT_TYPE", + 266: "JS_PROXY_TYPE", 1057: "JS_OBJECT_TYPE", - 263: "JS_GLOBAL_OBJECT_TYPE", - 264: "JS_GLOBAL_PROXY_TYPE", - 265: "JS_MODULE_NAMESPACE_TYPE", + 267: "JS_GLOBAL_OBJECT_TYPE", + 268: "JS_GLOBAL_PROXY_TYPE", + 269: "JS_MODULE_NAMESPACE_TYPE", 1040: "JS_SPECIAL_API_OBJECT_TYPE", 1041: "JS_PRIMITIVE_WRAPPER_TYPE", 1058: "JS_API_OBJECT_TYPE", @@ -237,315 +243,319 @@ INSTANCE_TYPES = { 2121: "JS_SEGMENT_ITERATOR_TYPE", 2122: "JS_SEGMENTER_TYPE", 2123: "JS_SEGMENTS_TYPE", - 2124: "JS_STRING_ITERATOR_TYPE", - 2125: "JS_TEMPORAL_CALENDAR_TYPE", - 2126: "JS_TEMPORAL_DURATION_TYPE", - 2127: "JS_TEMPORAL_INSTANT_TYPE", - 2128: "JS_TEMPORAL_PLAIN_DATE_TYPE", - 2129: "JS_TEMPORAL_PLAIN_DATE_TIME_TYPE", - 2130: "JS_TEMPORAL_PLAIN_MONTH_DAY_TYPE", - 2131: "JS_TEMPORAL_PLAIN_TIME_TYPE", - 2132: "JS_TEMPORAL_PLAIN_YEAR_MONTH_TYPE", - 2133: "JS_TEMPORAL_TIME_ZONE_TYPE", - 2134: "JS_TEMPORAL_ZONED_DATE_TIME_TYPE", - 2135: "JS_V8_BREAK_ITERATOR_TYPE", - 2136: "JS_WEAK_REF_TYPE", - 2137: "WASM_GLOBAL_OBJECT_TYPE", - 2138: "WASM_INSTANCE_OBJECT_TYPE", - 2139: "WASM_MEMORY_OBJECT_TYPE", - 2140: "WASM_MODULE_OBJECT_TYPE", - 2141: "WASM_SUSPENDER_OBJECT_TYPE", - 2142: "WASM_TABLE_OBJECT_TYPE", - 2143: "WASM_TAG_OBJECT_TYPE", - 2144: "WASM_VALUE_OBJECT_TYPE", + 2124: "JS_SHADOW_REALM_TYPE", + 2125: "JS_STRING_ITERATOR_TYPE", + 2126: "JS_TEMPORAL_CALENDAR_TYPE", + 2127: "JS_TEMPORAL_DURATION_TYPE", + 2128: "JS_TEMPORAL_INSTANT_TYPE", + 2129: "JS_TEMPORAL_PLAIN_DATE_TYPE", + 2130: "JS_TEMPORAL_PLAIN_DATE_TIME_TYPE", + 2131: "JS_TEMPORAL_PLAIN_MONTH_DAY_TYPE", + 2132: "JS_TEMPORAL_PLAIN_TIME_TYPE", + 2133: "JS_TEMPORAL_PLAIN_YEAR_MONTH_TYPE", + 2134: "JS_TEMPORAL_TIME_ZONE_TYPE", + 2135: "JS_TEMPORAL_ZONED_DATE_TIME_TYPE", + 2136: "JS_V8_BREAK_ITERATOR_TYPE", + 2137: "JS_WEAK_REF_TYPE", + 2138: "WASM_GLOBAL_OBJECT_TYPE", + 2139: "WASM_INSTANCE_OBJECT_TYPE", + 2140: "WASM_MEMORY_OBJECT_TYPE", + 2141: "WASM_MODULE_OBJECT_TYPE", + 2142: "WASM_SUSPENDER_OBJECT_TYPE", + 2143: "WASM_TABLE_OBJECT_TYPE", + 2144: "WASM_TAG_OBJECT_TYPE", + 2145: "WASM_VALUE_OBJECT_TYPE", } # List of known V8 maps. KNOWN_MAPS = { - ("read_only_space", 0x02119): (245, "MetaMap"), - ("read_only_space", 0x02141): (131, "NullMap"), - ("read_only_space", 0x02169): (229, "StrongDescriptorArrayMap"), - ("read_only_space", 0x02191): (258, "WeakArrayListMap"), - ("read_only_space", 0x021d5): (156, "EnumCacheMap"), - ("read_only_space", 0x02209): (176, "FixedArrayMap"), - ("read_only_space", 0x02255): (8, "OneByteInternalizedStringMap"), - ("read_only_space", 0x022a1): (242, "FreeSpaceMap"), - ("read_only_space", 0x022c9): (241, "OnePointerFillerMap"), - ("read_only_space", 0x022f1): (241, "TwoPointerFillerMap"), - ("read_only_space", 0x02319): (131, "UninitializedMap"), - ("read_only_space", 0x02391): (131, "UndefinedMap"), - ("read_only_space", 0x023d5): (130, "HeapNumberMap"), - ("read_only_space", 0x02409): (131, "TheHoleMap"), - ("read_only_space", 0x02469): (131, "BooleanMap"), - ("read_only_space", 0x0250d): (189, "ByteArrayMap"), - ("read_only_space", 0x02535): (176, "FixedCOWArrayMap"), - ("read_only_space", 0x0255d): (177, "HashTableMap"), - ("read_only_space", 0x02585): (128, "SymbolMap"), - ("read_only_space", 0x025ad): (40, "OneByteStringMap"), - ("read_only_space", 0x025d5): (251, "ScopeInfoMap"), - ("read_only_space", 0x025fd): (252, "SharedFunctionInfoMap"), - ("read_only_space", 0x02625): (235, "CodeMap"), - ("read_only_space", 0x0264d): (234, "CellMap"), - ("read_only_space", 0x02675): (250, "GlobalPropertyCellMap"), - ("read_only_space", 0x0269d): (204, "ForeignMap"), - ("read_only_space", 0x026c5): (233, "TransitionArrayMap"), - ("read_only_space", 0x026ed): (45, "ThinOneByteStringMap"), - ("read_only_space", 0x02715): (240, "FeedbackVectorMap"), - ("read_only_space", 0x0274d): (131, "ArgumentsMarkerMap"), - ("read_only_space", 0x027ad): (131, "ExceptionMap"), - ("read_only_space", 0x02809): (131, "TerminationExceptionMap"), - ("read_only_space", 0x02871): (131, "OptimizedOutMap"), - ("read_only_space", 0x028d1): (131, "StaleRegisterMap"), - ("read_only_space", 0x02931): (188, "ScriptContextTableMap"), - ("read_only_space", 0x02959): (186, "ClosureFeedbackCellArrayMap"), - ("read_only_space", 0x02981): (239, "FeedbackMetadataArrayMap"), - ("read_only_space", 0x029a9): (176, "ArrayListMap"), - ("read_only_space", 0x029d1): (129, "BigIntMap"), - ("read_only_space", 0x029f9): (187, "ObjectBoilerplateDescriptionMap"), - ("read_only_space", 0x02a21): (190, "BytecodeArrayMap"), - ("read_only_space", 0x02a49): (236, "CodeDataContainerMap"), - ("read_only_space", 0x02a71): (237, "CoverageInfoMap"), - ("read_only_space", 0x02a99): (191, "FixedDoubleArrayMap"), - ("read_only_space", 0x02ac1): (179, "GlobalDictionaryMap"), - ("read_only_space", 0x02ae9): (157, "ManyClosuresCellMap"), - ("read_only_space", 0x02b11): (246, "MegaDomHandlerMap"), - ("read_only_space", 0x02b39): (176, "ModuleInfoMap"), - ("read_only_space", 0x02b61): (180, "NameDictionaryMap"), - ("read_only_space", 0x02b89): (157, "NoClosuresCellMap"), - ("read_only_space", 0x02bb1): (181, "NumberDictionaryMap"), - ("read_only_space", 0x02bd9): (157, "OneClosureCellMap"), - ("read_only_space", 0x02c01): (182, "OrderedHashMapMap"), - ("read_only_space", 0x02c29): (183, "OrderedHashSetMap"), - ("read_only_space", 0x02c51): (184, "OrderedNameDictionaryMap"), - ("read_only_space", 0x02c79): (248, "PreparseDataMap"), - ("read_only_space", 0x02ca1): (249, "PropertyArrayMap"), - ("read_only_space", 0x02cc9): (153, "SideEffectCallHandlerInfoMap"), - ("read_only_space", 0x02cf1): (153, "SideEffectFreeCallHandlerInfoMap"), - ("read_only_space", 0x02d19): (153, "NextCallSideEffectFreeCallHandlerInfoMap"), - ("read_only_space", 0x02d41): (185, "SimpleNumberDictionaryMap"), - ("read_only_space", 0x02d69): (223, "SmallOrderedHashMapMap"), - ("read_only_space", 0x02d91): (224, "SmallOrderedHashSetMap"), - ("read_only_space", 0x02db9): (225, "SmallOrderedNameDictionaryMap"), - ("read_only_space", 0x02de1): (230, "SourceTextModuleMap"), - ("read_only_space", 0x02e09): (256, "SwissNameDictionaryMap"), - ("read_only_space", 0x02e31): (231, "SyntheticModuleMap"), - ("read_only_space", 0x02e59): (257, "WasmApiFunctionRefMap"), - ("read_only_space", 0x02e81): (217, "WasmCapiFunctionDataMap"), - ("read_only_space", 0x02ea9): (218, "WasmExportedFunctionDataMap"), - ("read_only_space", 0x02ed1): (205, "WasmInternalFunctionMap"), - ("read_only_space", 0x02ef9): (219, "WasmJSFunctionDataMap"), - ("read_only_space", 0x02f21): (206, "WasmTypeInfoMap"), - ("read_only_space", 0x02f49): (232, "WeakFixedArrayMap"), - ("read_only_space", 0x02f71): (178, "EphemeronHashTableMap"), - ("read_only_space", 0x02f99): (238, "EmbedderDataArrayMap"), - ("read_only_space", 0x02fc1): (259, "WeakCellMap"), - ("read_only_space", 0x02fe9): (32, "StringMap"), - ("read_only_space", 0x03011): (41, "ConsOneByteStringMap"), - ("read_only_space", 0x03039): (33, "ConsStringMap"), - ("read_only_space", 0x03061): (37, "ThinStringMap"), - ("read_only_space", 0x03089): (35, "SlicedStringMap"), - ("read_only_space", 0x030b1): (43, "SlicedOneByteStringMap"), - ("read_only_space", 0x030d9): (34, "ExternalStringMap"), - ("read_only_space", 0x03101): (42, "ExternalOneByteStringMap"), - ("read_only_space", 0x03129): (50, "UncachedExternalStringMap"), - ("read_only_space", 0x03151): (0, "InternalizedStringMap"), - ("read_only_space", 0x03179): (2, "ExternalInternalizedStringMap"), - ("read_only_space", 0x031a1): (10, "ExternalOneByteInternalizedStringMap"), - ("read_only_space", 0x031c9): (18, "UncachedExternalInternalizedStringMap"), - ("read_only_space", 0x031f1): (26, "UncachedExternalOneByteInternalizedStringMap"), - ("read_only_space", 0x03219): (58, "UncachedExternalOneByteStringMap"), - ("read_only_space", 0x03241): (104, "SharedOneByteStringMap"), - ("read_only_space", 0x03269): (96, "SharedStringMap"), - ("read_only_space", 0x03291): (109, "SharedThinOneByteStringMap"), - ("read_only_space", 0x032b9): (101, "SharedThinStringMap"), - ("read_only_space", 0x032e1): (96, "TwoByteSeqStringMigrationSentinelMap"), - ("read_only_space", 0x03309): (104, "OneByteSeqStringMigrationSentinelMap"), - ("read_only_space", 0x03331): (131, "SelfReferenceMarkerMap"), - ("read_only_space", 0x03359): (131, "BasicBlockCountersMarkerMap"), - ("read_only_space", 0x0339d): (147, "ArrayBoilerplateDescriptionMap"), - ("read_only_space", 0x0349d): (159, "InterceptorInfoMap"), - ("read_only_space", 0x05d11): (132, "PromiseFulfillReactionJobTaskMap"), - ("read_only_space", 0x05d39): (133, "PromiseRejectReactionJobTaskMap"), - ("read_only_space", 0x05d61): (134, "CallableTaskMap"), - ("read_only_space", 0x05d89): (135, "CallbackTaskMap"), - ("read_only_space", 0x05db1): (136, "PromiseResolveThenableJobTaskMap"), - ("read_only_space", 0x05dd9): (139, "FunctionTemplateInfoMap"), - ("read_only_space", 0x05e01): (140, "ObjectTemplateInfoMap"), - ("read_only_space", 0x05e29): (141, "AccessCheckInfoMap"), - ("read_only_space", 0x05e51): (142, "AccessorInfoMap"), - ("read_only_space", 0x05e79): (143, "AccessorPairMap"), - ("read_only_space", 0x05ea1): (144, "AliasedArgumentsEntryMap"), - ("read_only_space", 0x05ec9): (145, "AllocationMementoMap"), - ("read_only_space", 0x05ef1): (148, "AsmWasmDataMap"), - ("read_only_space", 0x05f19): (149, "AsyncGeneratorRequestMap"), - ("read_only_space", 0x05f41): (150, "BreakPointMap"), - ("read_only_space", 0x05f69): (151, "BreakPointInfoMap"), - ("read_only_space", 0x05f91): (152, "CachedTemplateObjectMap"), - ("read_only_space", 0x05fb9): (154, "ClassPositionsMap"), - ("read_only_space", 0x05fe1): (155, "DebugInfoMap"), - ("read_only_space", 0x06009): (158, "FunctionTemplateRareDataMap"), - ("read_only_space", 0x06031): (160, "InterpreterDataMap"), - ("read_only_space", 0x06059): (161, "ModuleRequestMap"), - ("read_only_space", 0x06081): (162, "PromiseCapabilityMap"), - ("read_only_space", 0x060a9): (163, "PromiseReactionMap"), - ("read_only_space", 0x060d1): (164, "PropertyDescriptorObjectMap"), - ("read_only_space", 0x060f9): (165, "PrototypeInfoMap"), - ("read_only_space", 0x06121): (166, "RegExpBoilerplateDescriptionMap"), - ("read_only_space", 0x06149): (167, "ScriptMap"), - ("read_only_space", 0x06171): (168, "ScriptOrModuleMap"), - ("read_only_space", 0x06199): (169, "SourceTextModuleInfoEntryMap"), - ("read_only_space", 0x061c1): (170, "StackFrameInfoMap"), - ("read_only_space", 0x061e9): (171, "TemplateObjectDescriptionMap"), - ("read_only_space", 0x06211): (172, "Tuple2Map"), - ("read_only_space", 0x06239): (173, "WasmContinuationObjectMap"), - ("read_only_space", 0x06261): (174, "WasmExceptionTagMap"), - ("read_only_space", 0x06289): (175, "WasmIndirectFunctionTableMap"), - ("read_only_space", 0x062b1): (193, "SloppyArgumentsElementsMap"), - ("read_only_space", 0x062d9): (228, "DescriptorArrayMap"), - ("read_only_space", 0x06301): (214, "UncompiledDataWithoutPreparseDataMap"), - ("read_only_space", 0x06329): (212, "UncompiledDataWithPreparseDataMap"), - ("read_only_space", 0x06351): (215, "UncompiledDataWithoutPreparseDataWithJobMap"), - ("read_only_space", 0x06379): (213, "UncompiledDataWithPreparseDataAndJobMap"), - ("read_only_space", 0x063a1): (247, "OnHeapBasicBlockProfilerDataMap"), - ("read_only_space", 0x063c9): (207, "TurbofanBitsetTypeMap"), - ("read_only_space", 0x063f1): (211, "TurbofanUnionTypeMap"), - ("read_only_space", 0x06419): (210, "TurbofanRangeTypeMap"), - ("read_only_space", 0x06441): (208, "TurbofanHeapConstantTypeMap"), - ("read_only_space", 0x06469): (209, "TurbofanOtherNumberConstantTypeMap"), - ("read_only_space", 0x06491): (243, "InternalClassMap"), - ("read_only_space", 0x064b9): (254, "SmiPairMap"), - ("read_only_space", 0x064e1): (253, "SmiBoxMap"), - ("read_only_space", 0x06509): (220, "ExportedSubClassBaseMap"), - ("read_only_space", 0x06531): (221, "ExportedSubClassMap"), - ("read_only_space", 0x06559): (226, "AbstractInternalClassSubclass1Map"), - ("read_only_space", 0x06581): (227, "AbstractInternalClassSubclass2Map"), - ("read_only_space", 0x065a9): (192, "InternalClassWithSmiElementsMap"), - ("read_only_space", 0x065d1): (244, "InternalClassWithStructElementsMap"), - ("read_only_space", 0x065f9): (222, "ExportedSubClass2Map"), - ("read_only_space", 0x06621): (255, "SortStateMap"), - ("read_only_space", 0x06649): (146, "AllocationSiteWithWeakNextMap"), - ("read_only_space", 0x06671): (146, "AllocationSiteWithoutWeakNextMap"), - ("read_only_space", 0x06699): (137, "LoadHandler1Map"), - ("read_only_space", 0x066c1): (137, "LoadHandler2Map"), - ("read_only_space", 0x066e9): (137, "LoadHandler3Map"), - ("read_only_space", 0x06711): (138, "StoreHandler0Map"), - ("read_only_space", 0x06739): (138, "StoreHandler1Map"), - ("read_only_space", 0x06761): (138, "StoreHandler2Map"), - ("read_only_space", 0x06789): (138, "StoreHandler3Map"), - ("map_space", 0x02119): (1057, "ExternalMap"), - ("map_space", 0x02141): (2114, "JSMessageObjectMap"), + ("read_only_space", 0x02149): (248, "MetaMap"), + ("read_only_space", 0x02171): (131, "NullMap"), + ("read_only_space", 0x02199): (232, "StrongDescriptorArrayMap"), + ("read_only_space", 0x021c1): (262, "WeakArrayListMap"), + ("read_only_space", 0x02205): (157, "EnumCacheMap"), + ("read_only_space", 0x02239): (178, "FixedArrayMap"), + ("read_only_space", 0x02285): (8, "OneByteInternalizedStringMap"), + ("read_only_space", 0x022d1): (245, "FreeSpaceMap"), + ("read_only_space", 0x022f9): (244, "OnePointerFillerMap"), + ("read_only_space", 0x02321): (244, "TwoPointerFillerMap"), + ("read_only_space", 0x02349): (131, "UninitializedMap"), + ("read_only_space", 0x023c1): (131, "UndefinedMap"), + ("read_only_space", 0x02405): (130, "HeapNumberMap"), + ("read_only_space", 0x02439): (131, "TheHoleMap"), + ("read_only_space", 0x02499): (131, "BooleanMap"), + ("read_only_space", 0x0253d): (192, "ByteArrayMap"), + ("read_only_space", 0x02565): (178, "FixedCOWArrayMap"), + ("read_only_space", 0x0258d): (179, "HashTableMap"), + ("read_only_space", 0x025b5): (128, "SymbolMap"), + ("read_only_space", 0x025dd): (40, "OneByteStringMap"), + ("read_only_space", 0x02605): (254, "ScopeInfoMap"), + ("read_only_space", 0x0262d): (255, "SharedFunctionInfoMap"), + ("read_only_space", 0x02655): (238, "CodeMap"), + ("read_only_space", 0x0267d): (237, "CellMap"), + ("read_only_space", 0x026a5): (253, "GlobalPropertyCellMap"), + ("read_only_space", 0x026cd): (204, "ForeignMap"), + ("read_only_space", 0x026f5): (236, "TransitionArrayMap"), + ("read_only_space", 0x0271d): (45, "ThinOneByteStringMap"), + ("read_only_space", 0x02745): (243, "FeedbackVectorMap"), + ("read_only_space", 0x0277d): (131, "ArgumentsMarkerMap"), + ("read_only_space", 0x027dd): (131, "ExceptionMap"), + ("read_only_space", 0x02839): (131, "TerminationExceptionMap"), + ("read_only_space", 0x028a1): (131, "OptimizedOutMap"), + ("read_only_space", 0x02901): (131, "StaleRegisterMap"), + ("read_only_space", 0x02961): (191, "ScriptContextTableMap"), + ("read_only_space", 0x02989): (189, "ClosureFeedbackCellArrayMap"), + ("read_only_space", 0x029b1): (242, "FeedbackMetadataArrayMap"), + ("read_only_space", 0x029d9): (178, "ArrayListMap"), + ("read_only_space", 0x02a01): (129, "BigIntMap"), + ("read_only_space", 0x02a29): (190, "ObjectBoilerplateDescriptionMap"), + ("read_only_space", 0x02a51): (193, "BytecodeArrayMap"), + ("read_only_space", 0x02a79): (239, "CodeDataContainerMap"), + ("read_only_space", 0x02aa1): (240, "CoverageInfoMap"), + ("read_only_space", 0x02ac9): (194, "FixedDoubleArrayMap"), + ("read_only_space", 0x02af1): (181, "GlobalDictionaryMap"), + ("read_only_space", 0x02b19): (159, "ManyClosuresCellMap"), + ("read_only_space", 0x02b41): (249, "MegaDomHandlerMap"), + ("read_only_space", 0x02b69): (178, "ModuleInfoMap"), + ("read_only_space", 0x02b91): (182, "NameDictionaryMap"), + ("read_only_space", 0x02bb9): (159, "NoClosuresCellMap"), + ("read_only_space", 0x02be1): (184, "NumberDictionaryMap"), + ("read_only_space", 0x02c09): (159, "OneClosureCellMap"), + ("read_only_space", 0x02c31): (185, "OrderedHashMapMap"), + ("read_only_space", 0x02c59): (186, "OrderedHashSetMap"), + ("read_only_space", 0x02c81): (183, "NameToIndexHashTableMap"), + ("read_only_space", 0x02ca9): (187, "OrderedNameDictionaryMap"), + ("read_only_space", 0x02cd1): (251, "PreparseDataMap"), + ("read_only_space", 0x02cf9): (252, "PropertyArrayMap"), + ("read_only_space", 0x02d21): (153, "SideEffectCallHandlerInfoMap"), + ("read_only_space", 0x02d49): (153, "SideEffectFreeCallHandlerInfoMap"), + ("read_only_space", 0x02d71): (153, "NextCallSideEffectFreeCallHandlerInfoMap"), + ("read_only_space", 0x02d99): (188, "SimpleNumberDictionaryMap"), + ("read_only_space", 0x02dc1): (228, "SmallOrderedHashMapMap"), + ("read_only_space", 0x02de9): (229, "SmallOrderedHashSetMap"), + ("read_only_space", 0x02e11): (230, "SmallOrderedNameDictionaryMap"), + ("read_only_space", 0x02e39): (233, "SourceTextModuleMap"), + ("read_only_space", 0x02e61): (259, "SwissNameDictionaryMap"), + ("read_only_space", 0x02e89): (234, "SyntheticModuleMap"), + ("read_only_space", 0x02eb1): (260, "WasmApiFunctionRefMap"), + ("read_only_space", 0x02ed9): (222, "WasmCapiFunctionDataMap"), + ("read_only_space", 0x02f01): (223, "WasmExportedFunctionDataMap"), + ("read_only_space", 0x02f29): (205, "WasmInternalFunctionMap"), + ("read_only_space", 0x02f51): (224, "WasmJSFunctionDataMap"), + ("read_only_space", 0x02f79): (261, "WasmOnFulfilledDataMap"), + ("read_only_space", 0x02fa1): (206, "WasmTypeInfoMap"), + ("read_only_space", 0x02fc9): (235, "WeakFixedArrayMap"), + ("read_only_space", 0x02ff1): (180, "EphemeronHashTableMap"), + ("read_only_space", 0x03019): (241, "EmbedderDataArrayMap"), + ("read_only_space", 0x03041): (263, "WeakCellMap"), + ("read_only_space", 0x03069): (32, "StringMap"), + ("read_only_space", 0x03091): (41, "ConsOneByteStringMap"), + ("read_only_space", 0x030b9): (33, "ConsStringMap"), + ("read_only_space", 0x030e1): (37, "ThinStringMap"), + ("read_only_space", 0x03109): (35, "SlicedStringMap"), + ("read_only_space", 0x03131): (43, "SlicedOneByteStringMap"), + ("read_only_space", 0x03159): (34, "ExternalStringMap"), + ("read_only_space", 0x03181): (42, "ExternalOneByteStringMap"), + ("read_only_space", 0x031a9): (50, "UncachedExternalStringMap"), + ("read_only_space", 0x031d1): (0, "InternalizedStringMap"), + ("read_only_space", 0x031f9): (2, "ExternalInternalizedStringMap"), + ("read_only_space", 0x03221): (10, "ExternalOneByteInternalizedStringMap"), + ("read_only_space", 0x03249): (18, "UncachedExternalInternalizedStringMap"), + ("read_only_space", 0x03271): (26, "UncachedExternalOneByteInternalizedStringMap"), + ("read_only_space", 0x03299): (58, "UncachedExternalOneByteStringMap"), + ("read_only_space", 0x032c1): (104, "SharedOneByteStringMap"), + ("read_only_space", 0x032e9): (96, "SharedStringMap"), + ("read_only_space", 0x03311): (109, "SharedThinOneByteStringMap"), + ("read_only_space", 0x03339): (101, "SharedThinStringMap"), + ("read_only_space", 0x03361): (96, "TwoByteSeqStringMigrationSentinelMap"), + ("read_only_space", 0x03389): (104, "OneByteSeqStringMigrationSentinelMap"), + ("read_only_space", 0x033b1): (131, "SelfReferenceMarkerMap"), + ("read_only_space", 0x033d9): (131, "BasicBlockCountersMarkerMap"), + ("read_only_space", 0x0341d): (147, "ArrayBoilerplateDescriptionMap"), + ("read_only_space", 0x0351d): (161, "InterceptorInfoMap"), + ("read_only_space", 0x05e69): (132, "PromiseFulfillReactionJobTaskMap"), + ("read_only_space", 0x05e91): (133, "PromiseRejectReactionJobTaskMap"), + ("read_only_space", 0x05eb9): (134, "CallableTaskMap"), + ("read_only_space", 0x05ee1): (135, "CallbackTaskMap"), + ("read_only_space", 0x05f09): (136, "PromiseResolveThenableJobTaskMap"), + ("read_only_space", 0x05f31): (139, "FunctionTemplateInfoMap"), + ("read_only_space", 0x05f59): (140, "ObjectTemplateInfoMap"), + ("read_only_space", 0x05f81): (141, "AccessCheckInfoMap"), + ("read_only_space", 0x05fa9): (142, "AccessorInfoMap"), + ("read_only_space", 0x05fd1): (143, "AccessorPairMap"), + ("read_only_space", 0x05ff9): (144, "AliasedArgumentsEntryMap"), + ("read_only_space", 0x06021): (145, "AllocationMementoMap"), + ("read_only_space", 0x06049): (148, "AsmWasmDataMap"), + ("read_only_space", 0x06071): (149, "AsyncGeneratorRequestMap"), + ("read_only_space", 0x06099): (150, "BreakPointMap"), + ("read_only_space", 0x060c1): (151, "BreakPointInfoMap"), + ("read_only_space", 0x060e9): (152, "CachedTemplateObjectMap"), + ("read_only_space", 0x06111): (154, "CallSiteInfoMap"), + ("read_only_space", 0x06139): (155, "ClassPositionsMap"), + ("read_only_space", 0x06161): (156, "DebugInfoMap"), + ("read_only_space", 0x06189): (158, "ErrorStackDataMap"), + ("read_only_space", 0x061b1): (160, "FunctionTemplateRareDataMap"), + ("read_only_space", 0x061d9): (162, "InterpreterDataMap"), + ("read_only_space", 0x06201): (163, "ModuleRequestMap"), + ("read_only_space", 0x06229): (164, "PromiseCapabilityMap"), + ("read_only_space", 0x06251): (165, "PromiseReactionMap"), + ("read_only_space", 0x06279): (166, "PropertyDescriptorObjectMap"), + ("read_only_space", 0x062a1): (167, "PrototypeInfoMap"), + ("read_only_space", 0x062c9): (168, "RegExpBoilerplateDescriptionMap"), + ("read_only_space", 0x062f1): (169, "ScriptMap"), + ("read_only_space", 0x06319): (170, "ScriptOrModuleMap"), + ("read_only_space", 0x06341): (171, "SourceTextModuleInfoEntryMap"), + ("read_only_space", 0x06369): (172, "StackFrameInfoMap"), + ("read_only_space", 0x06391): (173, "TemplateObjectDescriptionMap"), + ("read_only_space", 0x063b9): (174, "Tuple2Map"), + ("read_only_space", 0x063e1): (175, "WasmContinuationObjectMap"), + ("read_only_space", 0x06409): (176, "WasmExceptionTagMap"), + ("read_only_space", 0x06431): (177, "WasmIndirectFunctionTableMap"), + ("read_only_space", 0x06459): (196, "SloppyArgumentsElementsMap"), + ("read_only_space", 0x06481): (231, "DescriptorArrayMap"), + ("read_only_space", 0x064a9): (219, "UncompiledDataWithoutPreparseDataMap"), + ("read_only_space", 0x064d1): (217, "UncompiledDataWithPreparseDataMap"), + ("read_only_space", 0x064f9): (220, "UncompiledDataWithoutPreparseDataWithJobMap"), + ("read_only_space", 0x06521): (218, "UncompiledDataWithPreparseDataAndJobMap"), + ("read_only_space", 0x06549): (250, "OnHeapBasicBlockProfilerDataMap"), + ("read_only_space", 0x06571): (197, "TurbofanBitsetTypeMap"), + ("read_only_space", 0x06599): (201, "TurbofanUnionTypeMap"), + ("read_only_space", 0x065c1): (200, "TurbofanRangeTypeMap"), + ("read_only_space", 0x065e9): (198, "TurbofanHeapConstantTypeMap"), + ("read_only_space", 0x06611): (199, "TurbofanOtherNumberConstantTypeMap"), + ("read_only_space", 0x06639): (246, "InternalClassMap"), + ("read_only_space", 0x06661): (257, "SmiPairMap"), + ("read_only_space", 0x06689): (256, "SmiBoxMap"), + ("read_only_space", 0x066b1): (225, "ExportedSubClassBaseMap"), + ("read_only_space", 0x066d9): (226, "ExportedSubClassMap"), + ("read_only_space", 0x06701): (202, "AbstractInternalClassSubclass1Map"), + ("read_only_space", 0x06729): (203, "AbstractInternalClassSubclass2Map"), + ("read_only_space", 0x06751): (195, "InternalClassWithSmiElementsMap"), + ("read_only_space", 0x06779): (247, "InternalClassWithStructElementsMap"), + ("read_only_space", 0x067a1): (227, "ExportedSubClass2Map"), + ("read_only_space", 0x067c9): (258, "SortStateMap"), + ("read_only_space", 0x067f1): (146, "AllocationSiteWithWeakNextMap"), + ("read_only_space", 0x06819): (146, "AllocationSiteWithoutWeakNextMap"), + ("read_only_space", 0x06841): (137, "LoadHandler1Map"), + ("read_only_space", 0x06869): (137, "LoadHandler2Map"), + ("read_only_space", 0x06891): (137, "LoadHandler3Map"), + ("read_only_space", 0x068b9): (138, "StoreHandler0Map"), + ("read_only_space", 0x068e1): (138, "StoreHandler1Map"), + ("read_only_space", 0x06909): (138, "StoreHandler2Map"), + ("read_only_space", 0x06931): (138, "StoreHandler3Map"), + ("map_space", 0x02149): (1057, "ExternalMap"), + ("map_space", 0x02171): (2114, "JSMessageObjectMap"), } # List of known V8 objects. KNOWN_OBJECTS = { - ("read_only_space", 0x021b9): "EmptyWeakArrayList", - ("read_only_space", 0x021c5): "EmptyDescriptorArray", - ("read_only_space", 0x021fd): "EmptyEnumCache", - ("read_only_space", 0x02231): "EmptyFixedArray", - ("read_only_space", 0x02239): "NullValue", - ("read_only_space", 0x02341): "UninitializedValue", - ("read_only_space", 0x023b9): "UndefinedValue", - ("read_only_space", 0x023fd): "NanValue", - ("read_only_space", 0x02431): "TheHoleValue", - ("read_only_space", 0x0245d): "HoleNanValue", - ("read_only_space", 0x02491): "TrueValue", - ("read_only_space", 0x024d1): "FalseValue", - ("read_only_space", 0x02501): "empty_string", - ("read_only_space", 0x0273d): "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", 0x03381): "EmptyPropertyArray", - ("read_only_space", 0x03389): "EmptyByteArray", - ("read_only_space", 0x03391): "EmptyObjectBoilerplateDescription", - ("read_only_space", 0x033c5): "EmptyArrayBoilerplateDescription", - ("read_only_space", 0x033d1): "EmptyClosureFeedbackCellArray", - ("read_only_space", 0x033d9): "EmptySlowElementDictionary", - ("read_only_space", 0x033fd): "EmptyOrderedHashMap", - ("read_only_space", 0x03411): "EmptyOrderedHashSet", - ("read_only_space", 0x03425): "EmptyFeedbackMetadata", - ("read_only_space", 0x03431): "EmptyPropertyDictionary", - ("read_only_space", 0x03459): "EmptyOrderedPropertyDictionary", - ("read_only_space", 0x03471): "EmptySwissPropertyDictionary", - ("read_only_space", 0x034c5): "NoOpInterceptorInfo", - ("read_only_space", 0x034ed): "EmptyWeakFixedArray", - ("read_only_space", 0x034f5): "InfinityValue", - ("read_only_space", 0x03501): "MinusZeroValue", - ("read_only_space", 0x0350d): "MinusInfinityValue", - ("read_only_space", 0x03519): "SelfReferenceMarker", - ("read_only_space", 0x03559): "BasicBlockCountersMarker", - ("read_only_space", 0x0359d): "OffHeapTrampolineRelocationInfo", - ("read_only_space", 0x035a9): "TrampolineTrivialCodeDataContainer", - ("read_only_space", 0x035b5): "TrampolinePromiseRejectionCodeDataContainer", - ("read_only_space", 0x035c1): "GlobalThisBindingScopeInfo", - ("read_only_space", 0x035f1): "EmptyFunctionScopeInfo", - ("read_only_space", 0x03615): "NativeScopeInfo", - ("read_only_space", 0x0362d): "HashSeed", - ("old_space", 0x04211): "ArgumentsIteratorAccessor", - ("old_space", 0x04255): "ArrayLengthAccessor", - ("old_space", 0x04299): "BoundFunctionLengthAccessor", - ("old_space", 0x042dd): "BoundFunctionNameAccessor", - ("old_space", 0x04321): "ErrorStackAccessor", - ("old_space", 0x04365): "FunctionArgumentsAccessor", - ("old_space", 0x043a9): "FunctionCallerAccessor", - ("old_space", 0x043ed): "FunctionNameAccessor", - ("old_space", 0x04431): "FunctionLengthAccessor", - ("old_space", 0x04475): "FunctionPrototypeAccessor", - ("old_space", 0x044b9): "StringLengthAccessor", - ("old_space", 0x044fd): "InvalidPrototypeValidityCell", - ("old_space", 0x04505): "EmptyScript", - ("old_space", 0x04545): "ManyClosuresCell", - ("old_space", 0x04551): "ArrayConstructorProtector", - ("old_space", 0x04565): "NoElementsProtector", - ("old_space", 0x04579): "MegaDOMProtector", - ("old_space", 0x0458d): "IsConcatSpreadableProtector", - ("old_space", 0x045a1): "ArraySpeciesProtector", - ("old_space", 0x045b5): "TypedArraySpeciesProtector", - ("old_space", 0x045c9): "PromiseSpeciesProtector", - ("old_space", 0x045dd): "RegExpSpeciesProtector", - ("old_space", 0x045f1): "StringLengthProtector", - ("old_space", 0x04605): "ArrayIteratorProtector", - ("old_space", 0x04619): "ArrayBufferDetachingProtector", - ("old_space", 0x0462d): "PromiseHookProtector", - ("old_space", 0x04641): "PromiseResolveProtector", - ("old_space", 0x04655): "MapIteratorProtector", - ("old_space", 0x04669): "PromiseThenProtector", - ("old_space", 0x0467d): "SetIteratorProtector", - ("old_space", 0x04691): "StringIteratorProtector", - ("old_space", 0x046a5): "SingleCharacterStringCache", - ("old_space", 0x04aad): "StringSplitCache", - ("old_space", 0x04eb5): "RegExpMultipleCache", - ("old_space", 0x052bd): "BuiltinsConstantsTable", - ("old_space", 0x056e5): "AsyncFunctionAwaitRejectSharedFun", - ("old_space", 0x05709): "AsyncFunctionAwaitResolveSharedFun", - ("old_space", 0x0572d): "AsyncGeneratorAwaitRejectSharedFun", - ("old_space", 0x05751): "AsyncGeneratorAwaitResolveSharedFun", - ("old_space", 0x05775): "AsyncGeneratorYieldResolveSharedFun", - ("old_space", 0x05799): "AsyncGeneratorReturnResolveSharedFun", - ("old_space", 0x057bd): "AsyncGeneratorReturnClosedRejectSharedFun", - ("old_space", 0x057e1): "AsyncGeneratorReturnClosedResolveSharedFun", - ("old_space", 0x05805): "AsyncIteratorValueUnwrapSharedFun", - ("old_space", 0x05829): "PromiseAllResolveElementSharedFun", - ("old_space", 0x0584d): "PromiseAllSettledResolveElementSharedFun", - ("old_space", 0x05871): "PromiseAllSettledRejectElementSharedFun", - ("old_space", 0x05895): "PromiseAnyRejectElementSharedFun", - ("old_space", 0x058b9): "PromiseCapabilityDefaultRejectSharedFun", - ("old_space", 0x058dd): "PromiseCapabilityDefaultResolveSharedFun", - ("old_space", 0x05901): "PromiseCatchFinallySharedFun", - ("old_space", 0x05925): "PromiseGetCapabilitiesExecutorSharedFun", - ("old_space", 0x05949): "PromiseThenFinallySharedFun", - ("old_space", 0x0596d): "PromiseThrowerFinallySharedFun", - ("old_space", 0x05991): "PromiseValueThunkFinallySharedFun", - ("old_space", 0x059b5): "ProxyRevokeSharedFun", + ("read_only_space", 0x021e9): "EmptyWeakArrayList", + ("read_only_space", 0x021f5): "EmptyDescriptorArray", + ("read_only_space", 0x0222d): "EmptyEnumCache", + ("read_only_space", 0x02261): "EmptyFixedArray", + ("read_only_space", 0x02269): "NullValue", + ("read_only_space", 0x02371): "UninitializedValue", + ("read_only_space", 0x023e9): "UndefinedValue", + ("read_only_space", 0x0242d): "NanValue", + ("read_only_space", 0x02461): "TheHoleValue", + ("read_only_space", 0x0248d): "HoleNanValue", + ("read_only_space", 0x024c1): "TrueValue", + ("read_only_space", 0x02501): "FalseValue", + ("read_only_space", 0x02531): "empty_string", + ("read_only_space", 0x0276d): "EmptyScopeInfo", + ("read_only_space", 0x027a5): "ArgumentsMarker", + ("read_only_space", 0x02805): "Exception", + ("read_only_space", 0x02861): "TerminationException", + ("read_only_space", 0x028c9): "OptimizedOut", + ("read_only_space", 0x02929): "StaleRegister", + ("read_only_space", 0x03401): "EmptyPropertyArray", + ("read_only_space", 0x03409): "EmptyByteArray", + ("read_only_space", 0x03411): "EmptyObjectBoilerplateDescription", + ("read_only_space", 0x03445): "EmptyArrayBoilerplateDescription", + ("read_only_space", 0x03451): "EmptyClosureFeedbackCellArray", + ("read_only_space", 0x03459): "EmptySlowElementDictionary", + ("read_only_space", 0x0347d): "EmptyOrderedHashMap", + ("read_only_space", 0x03491): "EmptyOrderedHashSet", + ("read_only_space", 0x034a5): "EmptyFeedbackMetadata", + ("read_only_space", 0x034b1): "EmptyPropertyDictionary", + ("read_only_space", 0x034d9): "EmptyOrderedPropertyDictionary", + ("read_only_space", 0x034f1): "EmptySwissPropertyDictionary", + ("read_only_space", 0x03545): "NoOpInterceptorInfo", + ("read_only_space", 0x0356d): "EmptyArrayList", + ("read_only_space", 0x03579): "EmptyWeakFixedArray", + ("read_only_space", 0x03581): "InfinityValue", + ("read_only_space", 0x0358d): "MinusZeroValue", + ("read_only_space", 0x03599): "MinusInfinityValue", + ("read_only_space", 0x035a5): "SelfReferenceMarker", + ("read_only_space", 0x035e5): "BasicBlockCountersMarker", + ("read_only_space", 0x03629): "OffHeapTrampolineRelocationInfo", + ("read_only_space", 0x03635): "GlobalThisBindingScopeInfo", + ("read_only_space", 0x03665): "EmptyFunctionScopeInfo", + ("read_only_space", 0x03689): "NativeScopeInfo", + ("read_only_space", 0x036a1): "HashSeed", + ("old_space", 0x0422d): "ArgumentsIteratorAccessor", + ("old_space", 0x04271): "ArrayLengthAccessor", + ("old_space", 0x042b5): "BoundFunctionLengthAccessor", + ("old_space", 0x042f9): "BoundFunctionNameAccessor", + ("old_space", 0x0433d): "ErrorStackAccessor", + ("old_space", 0x04381): "FunctionArgumentsAccessor", + ("old_space", 0x043c5): "FunctionCallerAccessor", + ("old_space", 0x04409): "FunctionNameAccessor", + ("old_space", 0x0444d): "FunctionLengthAccessor", + ("old_space", 0x04491): "FunctionPrototypeAccessor", + ("old_space", 0x044d5): "StringLengthAccessor", + ("old_space", 0x04519): "InvalidPrototypeValidityCell", + ("old_space", 0x04521): "EmptyScript", + ("old_space", 0x04561): "ManyClosuresCell", + ("old_space", 0x0456d): "ArrayConstructorProtector", + ("old_space", 0x04581): "NoElementsProtector", + ("old_space", 0x04595): "MegaDOMProtector", + ("old_space", 0x045a9): "IsConcatSpreadableProtector", + ("old_space", 0x045bd): "ArraySpeciesProtector", + ("old_space", 0x045d1): "TypedArraySpeciesProtector", + ("old_space", 0x045e5): "PromiseSpeciesProtector", + ("old_space", 0x045f9): "RegExpSpeciesProtector", + ("old_space", 0x0460d): "StringLengthProtector", + ("old_space", 0x04621): "ArrayIteratorProtector", + ("old_space", 0x04635): "ArrayBufferDetachingProtector", + ("old_space", 0x04649): "PromiseHookProtector", + ("old_space", 0x0465d): "PromiseResolveProtector", + ("old_space", 0x04671): "MapIteratorProtector", + ("old_space", 0x04685): "PromiseThenProtector", + ("old_space", 0x04699): "SetIteratorProtector", + ("old_space", 0x046ad): "StringIteratorProtector", + ("old_space", 0x046c1): "SingleCharacterStringCache", + ("old_space", 0x04ac9): "StringSplitCache", + ("old_space", 0x04ed1): "RegExpMultipleCache", + ("old_space", 0x052d9): "BuiltinsConstantsTable", + ("old_space", 0x05705): "AsyncFunctionAwaitRejectSharedFun", + ("old_space", 0x05729): "AsyncFunctionAwaitResolveSharedFun", + ("old_space", 0x0574d): "AsyncGeneratorAwaitRejectSharedFun", + ("old_space", 0x05771): "AsyncGeneratorAwaitResolveSharedFun", + ("old_space", 0x05795): "AsyncGeneratorYieldResolveSharedFun", + ("old_space", 0x057b9): "AsyncGeneratorReturnResolveSharedFun", + ("old_space", 0x057dd): "AsyncGeneratorReturnClosedRejectSharedFun", + ("old_space", 0x05801): "AsyncGeneratorReturnClosedResolveSharedFun", + ("old_space", 0x05825): "AsyncIteratorValueUnwrapSharedFun", + ("old_space", 0x05849): "PromiseAllResolveElementSharedFun", + ("old_space", 0x0586d): "PromiseAllSettledResolveElementSharedFun", + ("old_space", 0x05891): "PromiseAllSettledRejectElementSharedFun", + ("old_space", 0x058b5): "PromiseAnyRejectElementSharedFun", + ("old_space", 0x058d9): "PromiseCapabilityDefaultRejectSharedFun", + ("old_space", 0x058fd): "PromiseCapabilityDefaultResolveSharedFun", + ("old_space", 0x05921): "PromiseCatchFinallySharedFun", + ("old_space", 0x05945): "PromiseGetCapabilitiesExecutorSharedFun", + ("old_space", 0x05969): "PromiseThenFinallySharedFun", + ("old_space", 0x0598d): "PromiseThrowerFinallySharedFun", + ("old_space", 0x059b1): "PromiseValueThunkFinallySharedFun", + ("old_space", 0x059d5): "ProxyRevokeSharedFun", } # Lower 32 bits of first page addresses for various heap spaces. HEAP_FIRST_PAGES = { - 0x080c0000: "old_space", - 0x08100000: "map_space", - 0x08000000: "read_only_space", + 0x000c0000: "old_space", + 0x00100000: "map_space", + 0x00000000: "read_only_space", } # List of known V8 Frame Markers. @@ -556,7 +566,7 @@ FRAME_MARKERS = ( "WASM", "WASM_TO_JS", "JS_TO_WASM", - "RETURN_PROMISE_ON_SUSPEND", + "STACK_SWITCH", "WASM_DEBUG_BREAK", "C_WASM_ENTRY", "WASM_EXIT", diff --git a/chromium/v8/tools/v8windbg/BUILD.gn b/chromium/v8/tools/v8windbg/BUILD.gn index e30b826b0f4..5516a6109f2 100644 --- a/chromium/v8/tools/v8windbg/BUILD.gn +++ b/chromium/v8/tools/v8windbg/BUILD.gn @@ -75,8 +75,8 @@ action("copy_prereqs") { outputs = [ "$root_out_dir/dbgeng.dll" ] args = [ - rebase_path("//build"), - rebase_path(root_out_dir), + rebase_path("//build", root_build_dir), + rebase_path(root_out_dir, root_build_dir), target_cpu, ] } |