From 124d91667abb203098baa7d6cf6011e8df5eeeff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= <targos@protonmail.com> Date: Wed, 24 Oct 2018 15:30:26 +0200 Subject: [PATCH] deps: patch V8 to 7.0.276.32 Refs: https://github.com/v8/v8/compare/7.0.276.28...7.0.276.32 PR-URL: https://github.com/nodejs/node/pull/23851 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> --- deps/v8/include/v8-version.h | 2 +- deps/v8/infra/testing/PRESUBMIT.py | 4 +- deps/v8/infra/testing/builders.pyl | 1337 ++++++++++++++++- deps/v8/src/debug/debug-coverage.cc | 39 + deps/v8/src/debug/debug-evaluate.cc | 7 +- deps/v8/src/debug/debug.cc | 15 +- .../interpreter/bytecode-array-accessor.cc | 13 + .../src/interpreter/bytecode-array-accessor.h | 2 + deps/v8/src/value-serializer.cc | 14 +- .../debugger/regress/regress-crbug-882664.js | 41 + deps/v8/test/mjsunit/code-coverage-block.js | 44 +- 11 files changed, 1471 insertions(+), 47 deletions(-) create mode 100644 deps/v8/test/debugger/regress/regress-crbug-882664.js diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 500576281862bb..360d80865ca427 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 7 #define V8_MINOR_VERSION 0 #define V8_BUILD_NUMBER 276 -#define V8_PATCH_LEVEL 28 +#define V8_PATCH_LEVEL 32 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/infra/testing/PRESUBMIT.py b/deps/v8/infra/testing/PRESUBMIT.py index e145534e6ea15c..d8047bc244c1ac 100644 --- a/deps/v8/infra/testing/PRESUBMIT.py +++ b/deps/v8/infra/testing/PRESUBMIT.py @@ -115,9 +115,9 @@ def _check_test(error_msg, test): if not all(isinstance(x, basestring) for x in test_args): errors += error_msg('If specified, all test_args must be strings') - # Limit shards to 10 to avoid erroneous resource exhaustion. + # Limit shards to 12 to avoid erroneous resource exhaustion. errors += _check_int_range( - error_msg, test, 'shards', lower_bound=1, upper_bound=10) + error_msg, test, 'shards', lower_bound=1, upper_bound=12) variant = test.get('variant', 'default') if not variant or not isinstance(variant, basestring): diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl index b2cd7618170c39..bf24d2c9954131 100644 --- a/deps/v8/infra/testing/builders.pyl +++ b/deps/v8/infra/testing/builders.pyl @@ -8,10 +8,10 @@ # come last. Test definitions must have keys in the following order, but omit # optional fields: # * name (required) +# * suffix # * variant # * test_args # * shards -# * suffix # * swarming_dimensions # * swarming_task_attrs # @@ -39,7 +39,10 @@ 'os': 'Android', }, 'tests': [ - {'name': 'mjsunit', 'variant': 'default', 'shards': 2}, + {'name': 'benchmarks', 'variant': 'default'}, + {'name': 'v8testing', 'variant': 'default', 'shards': 4}, + {'name': 'mozilla', 'variant': 'default'}, + {'name': 'test262_variants', 'variant': 'default', 'shards': 6}, ], }, ############################################################################## @@ -82,10 +85,15 @@ {'name': 'mozilla', 'variant': 'extra'}, {'name': 'test262_variants', 'shards': 2}, {'name': 'test262_variants', 'variant': 'extra', 'shards': 2}, - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra'}, ], }, + 'v8_linux_noembed_rel_ng_triggered': { + 'tests': [ + {'name': 'v8testing', 'shards': 2}, + ], + }, 'v8_linux_noi18n_rel_ng_triggered': { 'tests': [ {'name': 'mozilla', 'variant': 'default'}, @@ -120,14 +128,69 @@ {'name': 'optimize_for_size'}, {'name': 'test262_variants', 'shards': 4}, {'name': 'test262_variants', 'variant': 'extra', 'shards': 2}, - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'suffix': 'isolates', 'test_args': ['--isolates'], 'shards': 2}, {'name': 'v8testing', 'variant': 'extra'}, ], }, + 'v8_linux_optional_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cpu': 'x86-64-avx2', + }, + 'tests': [ + # Code serializer. + {'name': 'benchmarks', 'variant': 'code_serializer', 'shards': 1}, + {'name': 'd8testing', 'variant': 'code_serializer', 'shards': 1}, + {'name': 'mozilla', 'variant': 'code_serializer', 'shards': 1}, + {'name': 'test262_variants', 'variant': 'code_serializer', 'shards': 1}, + # No SSE3. + { + 'name': 'mozilla', + 'suffix': 'nosse3', + 'test_args': [ + '--extra-flags', + '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx', + ], + }, + { + 'name': 'test262', + 'suffix': 'nosse3', + 'test_args': [ + '--extra-flags', + '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx', + ], + }, + { + 'name': 'v8testing', + 'suffix': 'nosse3', + 'test_args': [ + '--extra-flags', + '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx', + ], + 'shards': 3, + }, + # No SSE4. + { + 'name': 'mozilla', + 'suffix': 'nosse4', + 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'], + }, + { + 'name': 'test262', + 'suffix': 'nosse4', + 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'], + }, + { + 'name': 'v8testing', + 'suffix': 'nosse4', + 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'], + 'shards': 3, + }, + ], + }, 'v8_linux_verify_csa_rel_ng_triggered': { 'tests': [ - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, ], }, ############################################################################## @@ -141,12 +204,17 @@ {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, ], }, + 'v8_linux_arm_lite_rel_ng_triggered': { + 'tests': [ + {'name': 'v8testing', 'variant': 'default', 'shards': 4}, + ], + }, 'v8_linux_arm_rel_ng_triggered': { 'tests': [ {'name': 'mjsunit_sp_frame_access'}, - {'name': 'mozilla'}, - {'name': 'test262'}, - {'name': 'v8testing', 'shards': 7}, + {'name': 'mozilla', 'shards': 2}, + {'name': 'test262', 'shards': 2}, + {'name': 'v8testing', 'shards': 8}, {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, ], }, @@ -214,12 +282,23 @@ {'name': 'test262_variants', 'shards': 4}, {'name': 'test262_variants', 'variant': 'extra', 'shards': 2}, {'name': 'v8initializers'}, - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra'}, {'name': 'v8testing', 'variant': 'minor_mc'}, {'name': 'v8testing', 'variant': 'slow_path'}, ], }, + # TODO(machenbach): Experimental builder with incomplete configs. Should be + # similar to v8_linux64_rel_ng_triggered after testing. + 'v8_linux64_rel_xg': { + 'swarming_dimensions' : { + 'cpu': 'x86-64-avx2', + }, + 'tests': [ + {'name': 'v8initializers'}, + {'name': 'v8testing', 'shards': 2}, + ], + }, 'v8_linux64_tsan_rel': { 'tests': [ {'name': 'benchmarks'}, @@ -242,7 +321,7 @@ }, 'v8_linux64_verify_csa_rel_ng_triggered': { 'tests': [ - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, ], }, ############################################################################## @@ -258,16 +337,34 @@ }, 'v8_linux_arm64_gc_stress_dbg': { 'tests': [ - {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 8}, + {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 10}, ], }, 'v8_linux_arm64_rel_ng_triggered': { 'tests': [ {'name': 'mjsunit_sp_frame_access'}, - {'name': 'mozilla'}, - {'name': 'test262'}, + {'name': 'mozilla', 'shards': 2}, + {'name': 'test262', 'shards': 2}, {'name': 'v8testing', 'shards': 9}, - {'name': 'v8testing', 'variant': 'extra', 'shards': 4}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 6}, + ], + }, + ############################################################################## + # Odroids with native arm + 'v8_odroid_arm_rel_ng_triggered': { + 'swarming_dimensions' : { + 'cores': '8', + 'cpu': 'armv7l-32-ODROID-XU4', + 'os': 'Ubuntu-16.04', + }, + 'swarming_task_attrs': { + # Use same prio as CI due to limited resources. + 'priority': 25, + }, + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'optimize_for_size'}, + {'name': 'v8testing', 'shards': 2}, ], }, ############################################################################## @@ -298,7 +395,7 @@ }, 'tests': [ {'name': 'test262'}, - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, ], }, ############################################################################## @@ -331,7 +428,7 @@ 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, ], }, 'v8_win64_rel_ng_triggered': { @@ -341,7 +438,7 @@ }, 'tests': [ {'name': 'test262'}, - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra'}, ], }, @@ -385,44 +482,319 @@ 'tests': [ {'name': 'mozilla'}, {'name': 'test262'}, - {'name': 'v8testing'}, + {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra'}, ], }, ############################################################################## ### luci.v8.ci ############################################################################## - # Linux32 + # Main. + 'V8 Fuzzer': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'jsfunfuzz'}, + ], + }, + 'V8 Linux': { + 'swarming_dimensions': { + 'cpu': 'x86-64-avx2', + }, + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'benchmarks', 'variant': 'extra'}, + {'name': 'gcmole'}, + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'mozilla', 'variant': 'extra'}, + {'name': 'optimize_for_size'}, + {'name': 'test262_variants', 'shards': 2}, + {'name': 'test262_variants', 'variant': 'extra'}, + {'name': 'v8initializers'}, + {'name': 'v8testing'}, + {'name': 'v8testing', 'suffix': 'isolates', 'test_args': ['--isolates']}, + {'name': 'v8testing', 'variant': 'extra'}, + # Nosse3. + { + 'name': 'mozilla', + 'suffix': 'nosse3', + 'test_args': ['--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx'] + }, + { + 'name': 'v8testing', + 'suffix': 'nosse3', + 'test_args': ['--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx'] + }, + # Nosse4. + { + 'name': 'mozilla', + 'suffix': 'nosse4', + 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'] + }, + { + 'name': 'v8testing', + 'suffix': 'nosse4', + 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'] + }, + ], + }, + 'V8 Linux - arm64 - sim - MSAN': { + 'tests': [ + {'name': 'test262', 'shards': 3}, + {'name': 'v8testing', 'shards': 4}, + ], + }, 'V8 Linux - debug': { + 'swarming_dimensions': { + 'cpu': 'x86-64-avx2', + }, 'tests': [ + {'name': 'benchmarks'}, {'name': 'benchmarks', 'variant': 'code_serializer', 'shards': 1}, + {'name': 'benchmarks', 'variant': 'extra'}, {'name': 'd8testing', 'variant': 'code_serializer', 'shards': 1}, + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, {'name': 'mozilla', 'variant': 'code_serializer', 'shards': 1}, + {'name': 'mozilla', 'variant': 'extra'}, + {'name': 'optimize_for_size'}, + {'name': 'test262_variants', 'shards': 6}, {'name': 'test262_variants', 'variant': 'code_serializer', 'shards': 1}, + {'name': 'test262_variants', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing', 'shards': 3}, + { + 'name': 'v8testing', + 'suffix': 'isolates', + 'test_args': ['--isolates'], + 'shards': 4 + }, + {'name': 'v8testing', 'variant': 'extra'}, + # Nosse3. + { + 'name': 'mozilla', + 'suffix': 'nosse3', + 'test_args': ['--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx'] + }, + { + 'name': 'test262', + 'suffix': 'nosse3', + 'test_args': ['--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx'] + }, + { + 'name': 'v8testing', + 'suffix': 'nosse3', + 'test_args': ['--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx'], + 'shards': 3 + }, + # Nosse4. + { + 'name': 'mozilla', + 'suffix': 'nosse4', + 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'] + }, + { + 'name': 'test262', + 'suffix': 'nosse4', + 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'] + }, + { + 'name': 'v8testing', + 'suffix': 'nosse4', + 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'], + 'shards': 3 + }, + ], + }, + 'V8 Linux - noembed': { + 'tests': [ + {'name': 'v8testing'}, + ], + }, + 'V8 Linux - noembed - debug': { + 'tests': [ + {'name': 'v8testing', 'shards': 3}, + ], + }, + 'V8 Linux - full debug': { + 'tests': [ + {'name': 'v8testing', 'variant': 'default'}, ], }, 'V8 Linux - gc stress': { 'tests': [ - {'name': 'mjsunit', 'variant': 'slow_path', 'shards': 2}, + { + 'name': 'd8testing', + 'test_args': ['--gc-stress'], + 'shards': 5, + }, + { + 'name': 'mjsunit', + 'variant': 'slow_path', + 'test_args': ['--gc-stress'], + 'shards': 2, + }, + ], + }, + 'V8 Linux - interpreted regexp': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'v8testing'}, + ], + }, + 'V8 Linux - noi18n - debug': { + 'tests': [ + {'name': 'mozilla', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default'}, + {'name': 'v8testing', 'variant': 'default'}, + ], + }, + 'V8 Linux - nosnap': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, + {'name': 'v8testing', 'variant': 'default', 'shards': 3}, + ], + }, + 'V8 Linux - nosnap - debug': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default', 'shards': 12}, + ], + }, + 'V8 Linux - predictable': { + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'd8testing'}, + {'name': 'mozilla'}, + ], + }, + 'V8 Linux - presubmit': { + 'tests': [ + {'name': 'presubmit'}, + ], + }, + 'V8 Linux - shared': { + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + ], + }, + 'V8 Linux - verify csa': { + 'tests': [ + {'name': 'v8testing'}, + ], + }, + 'V8 Linux gcc 4.8': { + 'tests': [ + {'name': 'v8testing'}, ], }, - ############################################################################## - # Linux64 'V8 Linux64': { + 'swarming_dimensions': { + 'cpu': 'x86-64-avx2', + }, 'tests': [ + {'name': 'benchmarks'}, + {'name': 'benchmarks', 'variant': 'extra'}, + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'mozilla', 'variant': 'extra'}, + {'name': 'optimize_for_size'}, + {'name': 'test262_variants', 'shards': 2}, + {'name': 'test262_variants', 'variant': 'extra'}, + {'name': 'v8initializers'}, + {'name': 'v8testing'}, + {'name': 'v8testing', 'variant': 'extra'}, {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1}, + # Noavx. + { + 'name': 'mozilla', + 'suffix': 'noavx', + 'test_args': ['--extra-flags', '--noenable-avx'] + }, + { + 'name': 'test262', + 'suffix': 'noavx', + 'test_args': ['--extra-flags', '--noenable-avx'] + }, + { + 'name': 'v8testing', + 'suffix': 'noavx', + 'test_args': ['--extra-flags', '--noenable-avx'] + }, + ], + }, + 'V8 Linux64 - cfi': { + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'mozilla'}, + {'name': 'optimize_for_size'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + ], + }, + 'V8 Linux64 - custom snapshot - debug': { + 'tests': [ + {'name': 'mjsunit', 'test_args': ['--no-harness']}, ], }, 'V8 Linux64 - debug': { + 'swarming_dimensions': { + 'cpu': 'x86-64-avx2', + }, 'tests': [ + {'name': 'benchmarks'}, + {'name': 'benchmarks', 'variant': 'extra'}, + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'mozilla', 'variant': 'extra'}, + {'name': 'optimize_for_size'}, + {'name': 'test262_variants', 'shards': 5}, + {'name': 'test262_variants', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing', 'shards': 2}, + {'name': 'v8testing', 'variant': 'extra'}, {'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1}, {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, + # Noavx. + { + 'name': 'mozilla', + 'suffix': 'noavx', + 'test_args': ['--extra-flags', '--noenable-avx'] + }, + { + 'name': 'test262', + 'suffix': 'noavx', + 'test_args': ['--extra-flags', '--noenable-avx'] + }, + { + 'name': 'v8testing', + 'suffix': 'noavx', + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 + }, ], }, 'V8 Linux64 - debug - fyi': { 'tests': [ # Infra staging. - {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 3}, {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2}, # Stress sampling. {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1}, @@ -431,20 +803,935 @@ }, 'V8 Linux64 - fyi': { 'tests': [ - {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1}, - {'name': 'test262_variants', 'variant': 'infra_staging', 'shards': 2}, + # Infra staging. {'name': 'v8testing', 'variant': 'infra_staging', 'shards': 1}, + # Stress sampling. + {'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1}, {'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1}, ], }, + 'V8 Linux64 - gcov coverage': { + 'tests': [ + {'name': 'v8testing'}, + ], + }, + 'V8 Linux64 - internal snapshot': { + 'tests': [ + {'name': 'v8testing'}, + ], + }, + 'V8 Linux64 - verify csa': { + 'tests': [ + {'name': 'v8testing'}, + ], + }, 'V8 Linux64 ASAN': { 'tests': [ + {'name': 'test262_variants', 'shards': 5}, + {'name': 'v8testing', 'shards': 2}, + {'name': 'v8testing', 'variant': 'extra'}, {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, ], }, + 'V8 Linux64 GC Stress - custom snapshot': { + 'tests': [ + { + 'name': 'mjsunit', + 'test_args': ['--gc-stress', '--no-harness'], + 'shards': 3, + }, + ], + }, 'V8 Linux64 TSAN': { 'tests': [ + {'name': 'benchmarks'}, + {'name': 'mozilla'}, + {'name': 'test262', 'shards': 3}, + {'name': 'v8testing', 'shards': 5}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, ], }, + 'V8 Linux64 TSAN - concurrent marking': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + { + 'name': 'benchmarks', + 'test_args': ['--extra-flags=--stress-incremental-marking'], + }, + { + 'name': 'mozilla', + 'test_args': ['--extra-flags=--stress-incremental-marking'], + }, + { + 'name': 'test262', + 'test_args': ['--extra-flags=--stress-incremental-marking'], + 'shards': 4, + }, + { + 'name': 'v8testing', + 'test_args': ['--extra-flags=--stress-incremental-marking'], + 'shards': 4, + }, + ], + }, + 'V8 Linux64 TSAN - isolates': { + 'tests': [ + {'name': 'v8testing', 'test_args': ['--isolates'], 'shards': 5}, + ], + }, + 'V8 Linux64 UBSan': { + 'tests': [ + {'name': 'v8testing'}, + ], + }, + 'V8 Linux64 UBSanVptr': { + 'tests': [ + {'name': 'v8testing'}, + ], + }, + 'V8 Mac64': { + 'swarming_dimensions': { + 'cpu': 'x86-64', + 'os': 'Mac-10.13', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + {'name': 'v8testing', 'variant': 'extra'}, + ], + }, + 'V8 Mac64 - debug': { + 'swarming_dimensions': { + 'cpu': 'x86-64', + 'os': 'Mac-10.13', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 3}, + {'name': 'v8testing', 'variant': 'extra'}, + ], + }, + 'V8 Mac64 ASAN': { + 'swarming_dimensions': { + 'cpu': 'x86-64', + 'os': 'Mac-10.13', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 5}, + ], + }, + 'V8 Mac64 GC Stress': { + 'swarming_dimensions': { + 'cpu': 'x86-64', + 'os': 'Mac-10.13', + }, + 'tests': [ + {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 4}, + ], + }, + 'V8 Win32': { + 'swarming_dimensions': { + 'cpu': 'x86-64', + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + ], + }, + 'V8 Win32 - debug': { + 'swarming_dimensions': { + 'cpu': 'x86-64', + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 5}, + ], + }, + 'V8 Win32 - nosnap - shared': { + 'swarming_dimensions': { + 'cpu': 'x86-64', + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default', 'shards': 2}, + ], + }, + 'V8 Win64': { + 'swarming_dimensions': { + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + {'name': 'v8testing', 'variant': 'extra'}, + ], + }, + 'V8 Win64 - debug': { + 'swarming_dimensions': { + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 4}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, + ], + }, + 'V8 Win64 - msvc': { + 'swarming_dimensions': { + 'os': 'Windows-7-SP1', + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + ], + }, + 'V8 Win64 ASAN': { + 'swarming_dimensions': { + 'os': 'Windows-10', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 5}, + ], + }, + ############################################################################## + # Ports. + 'V8 Android Arm64 - N5X': { + 'swarming_dimensions': { + 'device_os': 'MMB29Q', + 'device_type': 'bullhead', + 'os': 'Android', + }, + 'tests': [ + {'name': 'mozilla', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 5}, + {'name': 'v8testing', 'variant': 'default', 'shards': 3}, + ], + }, + 'V8 Arm': { + 'swarming_dimensions': { + 'cores': '2', + 'cpu': 'armv7l', + }, + 'swarming_task_attrs': { + 'expiration': 21600, + 'hard_timeout': 5400, + }, + 'tests': [ + {'name': 'benchmarks'}, + {'name': 'optimize_for_size'}, + {'name': 'v8testing', 'shards': 2}, + # Odroid. + { + 'name': 'benchmarks', + 'suffix': 'ODROID', + 'swarming_dimensions': { + 'cores': '8', + 'os': 'Ubuntu-16.04', + 'cpu': 'armv7l-32-ODROID-XU4', + } + }, + { + 'name': 'optimize_for_size', + 'suffix': 'ODROID', + 'swarming_dimensions': { + 'cores': '8', + 'os': 'Ubuntu-16.04', + 'cpu': 'armv7l-32-ODROID-XU4', + } + }, + { + 'name': 'v8testing', + 'suffix': 'ODROID', + 'shards': 2, + 'swarming_dimensions': { + 'cores': '8', + 'os': 'Ubuntu-16.04', + 'cpu': 'armv7l-32-ODROID-XU4', + } + }, + ], + }, + 'V8 Arm - debug': { + 'swarming_dimensions': { + 'cores': '2', + 'cpu': 'armv7l', + }, + 'swarming_task_attrs': { + 'expiration': 21600, + 'hard_timeout': 3600, + }, + 'tests': [ + { + 'name': 'optimize_for_size', + 'variant': 'default', + 'test_args': ['--extra-flags=--verify-heap-skip-remembered-set'], + 'shards': 2 + }, + { + 'name': 'v8testing', + 'variant': 'default', + 'test_args': ['--extra-flags=--verify-heap-skip-remembered-set'], + 'shards': 3 + }, + # Odroid. + { + 'name': 'optimize_for_size', + 'suffix': 'ODROID', + 'variant': 'default', + 'test_args': ['--extra-flags=--verify-heap-skip-remembered-set'], + 'shards': 2, + 'swarming_dimensions': { + 'cores': '8', + 'os': 'Ubuntu-16.04', + 'cpu': 'armv7l-32-ODROID-XU4', + } + }, + { + 'name': 'v8testing', + 'suffix': 'ODROID', + 'variant': 'default', + 'test_args': ['--extra-flags=--verify-heap-skip-remembered-set'], + 'shards': 3, + 'swarming_dimensions': { + 'cores': '8', + 'os': 'Ubuntu-16.04', + 'cpu': 'armv7l-32-ODROID-XU4', + } + }, + ], + }, + 'V8 Arm GC Stress': { + 'swarming_dimensions': { + 'cores': '2', + 'cpu': 'armv7l', + }, + 'swarming_task_attrs': { + 'expiration': 21600, + 'hard_timeout': 7200, + }, + 'tests': [ + { + 'name': 'd8testing', + 'variant': 'default', + 'test_args': ['--gc-stress', '--extra-flags=--verify-heap-skip-remembered-set'], + 'shards': 3 + }, + { + 'name': 'd8testing', + 'suffix': 'ODROID', + 'variant': 'default', + 'test_args': ['--gc-stress', '--extra-flags=--verify-heap-skip-remembered-set'], + 'shards': 3, + 'swarming_dimensions': { + 'cores': '8', + 'os': 'Ubuntu-16.04', + 'cpu': 'armv7l-32-ODROID-XU4', + } + }, + ], + }, + 'V8 Linux - arm - sim': { + 'tests': [ + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 4}, + {'name': 'v8testing', 'variant': 'extra'}, + # Armv8-a. + { + 'name': 'mozilla', + 'suffix': 'armv8-a', + 'test_args': ['--extra-flags', '--enable-armv8'] + }, + { + 'name': 'test262', + 'suffix': 'armv8-a', + 'test_args': ['--extra-flags', '--enable-armv8'] + }, + { + 'name': 'v8testing', + 'suffix': 'armv8-a', + 'test_args': ['--extra-flags', '--enable-armv8'], + 'shards': 4 + }, + # Novfp3. + {'name': 'mozilla', 'suffix': 'novfp3', 'test_args': ['--novfp3']}, + {'name': 'test262', 'suffix': 'novfp3', 'test_args': ['--novfp3']}, + { + 'name': 'v8testing', + 'suffix': 'novfp3', + 'test_args': ['--novfp3'], + 'shards': 4 + }, + ], + }, + 'V8 Linux - arm - sim - debug': { + 'tests': [ + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 7}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, + # Armv8-a. + { + 'name': 'mozilla', + 'suffix': 'armv8-a', + 'test_args': ['--extra-flags', '--enable-armv8'] + }, + { + 'name': 'test262', + 'suffix': 'armv8-a', + 'test_args': ['--extra-flags', '--enable-armv8'] + }, + { + 'name': 'v8testing', + 'suffix': 'armv8-a', + 'test_args': ['--extra-flags', '--enable-armv8'], + 'shards': 7 + }, + # Novfp3. + { + 'name': 'mozilla', + 'suffix': 'novfp3', + 'variant': 'default', + 'test_args': ['--novfp3'] + }, + { + 'name': 'test262', + 'suffix': 'novfp3', + 'variant': 'default', + 'test_args': ['--novfp3'] + }, + { + 'name': 'v8testing', + 'suffix': 'novfp3', + 'variant': 'default', + 'test_args': ['--novfp3'], + 'shards': 7 + }, + ], + }, + 'V8 Linux - arm - sim - lite': { + 'tests': [ + {'name': 'v8testing', 'variant': 'default', 'shards': 2}, + ], + }, + 'V8 Linux - arm - sim - lite - debug': { + 'tests': [ + {'name': 'v8testing', 'variant': 'default', 'shards': 4}, + ], + }, + 'V8 Linux - arm64 - sim': { + 'tests': [ + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 3}, + {'name': 'v8testing', 'variant': 'extra'}, + ], + }, + 'V8 Linux - arm64 - sim - debug': { + 'tests': [ + {'name': 'mjsunit_sp_frame_access'}, + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 10}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 6}, + ], + }, + 'V8 Linux - arm64 - sim - gc stress': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 7200, + 'priority': 35, + }, + 'tests': [ + { + 'name': 'd8testing', + 'test_args': ['--gc-stress', '--extra-flags=--verify-heap-skip-remembered-set'], + 'shards': 5 + }, + ], + }, + 'V8 Linux - mips64el - sim': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 4}, + ], + }, + 'V8 Linux - mipsel - sim': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 4}, + ], + }, + 'V8 Linux - ppc64 - sim': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'v8testing', 'shards': 3}, + ], + }, + 'V8 Linux - s390x - sim': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'v8testing', 'shards': 3}, + ], + }, + 'V8 Mips - big endian - nosnap': { + 'swarming_dimensions': { + 'cpu': 'mips-32', + 'os': 'Debian-8.7', + }, + 'swarming_task_attrs': { + 'expiration': 18000, + 'hard_timeout': 18000, + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default', 'shards': 2}, + ], + }, + ############################################################################## + # Clusterfuzz. + 'V8 NumFuzz': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + { + 'name': 'numfuzz', + 'suffix': 'deopt', + 'test_args': ['--total-timeout-sec=2100', '--stress-deopt=1'] + }, + ], + }, + 'V8 NumFuzz - TSAN': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'd8testing_random_gc', 'shards': 2}, + { + 'name': 'numfuzz', + 'suffix': 'marking', + 'test_args': ['--total-timeout-sec=2100', '--stress-marking=1'] + }, + { + 'name': 'numfuzz', + 'suffix': 'endurance', + 'test_args': [ + '--total-timeout-sec=1200', + '--combine-tests', + '--combine-min=10', + '--combine-max=30', + '--stress-delay-tasks=1', + '--stress-compaction=2', + '--stress-gc=6', + '--stress-marking=6', + '--stress-scavenge=4', + '--stress-thread-pool-size=1', + ], + }, + { + 'name': 'numfuzz', + 'suffix': 'delay', + 'test_args': ['--total-timeout-sec=2100', '--stress-delay-tasks=1'] + }, + { + 'name': 'numfuzz', + 'suffix': 'threads', + 'test_args': ['--total-timeout-sec=2100', '--stress-thread-pool-size=1'] + }, + { + 'name': 'numfuzz', + 'suffix': 'combined', + 'test_args': [ + '--total-timeout-sec=2100', + '--stress-delay-tasks=4', + '--stress-deopt=2', + '--stress-compaction=2', + '--stress-gc=4', + '--stress-marking=4', + '--stress-scavenge=4', + '--stress-thread-pool-size=2', + ], + 'shards': 4 + }, + { + 'name': 'numfuzz', + 'suffix': 'scavenge', + 'test_args': ['--total-timeout-sec=2100', '--stress-scavenge=1'] + }, + ], + }, + 'V8 NumFuzz - debug': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + {'name': 'd8testing_random_gc'}, + { + 'name': 'numfuzz', + 'suffix': 'marking', + 'test_args': ['--total-timeout-sec=2100', '--stress-marking=1'], + 'shards': 2 + }, + { + 'name': 'numfuzz', + 'suffix': 'endurance', + 'test_args': [ + '--total-timeout-sec=1200', + '--combine-tests', + '--combine-min=30', + '--combine-max=50', + '--stress-delay-tasks=1', + '--stress-deopt=2', + '--stress-compaction=2', + '--stress-gc=6', + '--stress-marking=6', + '--stress-scavenge=4', + '--stress-thread-pool-size=1', + ], + }, + { + 'name': 'numfuzz', + 'suffix': 'delay', + 'test_args': ['--total-timeout-sec=2100', '--stress-delay-tasks=1'] + }, + { + 'name': 'numfuzz', + 'suffix': 'threads', + 'test_args': ['--total-timeout-sec=2100', '--stress-thread-pool-size=1'] + }, + { + 'name': 'numfuzz', + 'suffix': 'combined', + 'test_args': [ + '--total-timeout-sec=2100', + '--stress-delay-tasks=4', + '--stress-deopt=2', + '--stress-compaction=2', + '--stress-gc=4', + '--stress-marking=4', + '--stress-scavenge=4', + '--stress-thread-pool-size=2', + ], + 'shards': 3 + }, + { + 'name': 'numfuzz', + 'suffix': 'scavenge', + 'test_args': ['--total-timeout-sec=2100', '--stress-scavenge=1'] + }, + { + 'name': 'numfuzz', + 'suffix': 'deopt', + 'test_args': ['--total-timeout-sec=2100', '--stress-deopt=1'], + 'shards': 2 + }, + ], + }, + 'V8 NumFuzz - nosnap': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + { + 'name': 'numfuzz', + 'suffix': 'interrupt-budget', + 'test_args': [ + '--total-timeout-sec=2100', + '--stress-interrupt-budget=10', + '--stress-deopt=5', + ] + }, + ], + }, + 'V8 NumFuzz - nosnap debug': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 3600, + 'priority': 35, + }, + 'tests': [ + { + 'name': 'numfuzz', + 'suffix': 'interrupt-budget', + 'test_args': [ + '--total-timeout-sec=2100', + '--stress-interrupt-budget=10', + '--stress-deopt=5', + ] + }, + ], + }, + ############################################################################## + # Clusterfuzz. + 'V8 Linux - beta branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'presubmit'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + ], + }, + 'V8 Linux - beta branch - debug': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'presubmit'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 3}, + ], + }, + 'V8 Linux - stable branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'presubmit'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + ], + }, + 'V8 Linux - stable branch - debug': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'presubmit'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 3}, + ], + }, + 'V8 Linux64 - beta branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + ], + }, + 'V8 Linux64 - beta branch - debug': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 3}, + ], + }, + 'V8 Linux64 - stable branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing'}, + ], + }, + 'V8 Linux64 - stable branch - debug': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 3}, + ], + }, + 'V8 arm - sim - beta branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 2}, + ], + }, + 'V8 arm - sim - beta branch - debug': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 3}, + ], + }, + 'V8 arm - sim - stable branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 2}, + ], + }, + 'V8 arm - sim - stable branch - debug': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'mozilla'}, + {'name': 'test262'}, + {'name': 'v8testing', 'shards': 3}, + ], + }, + 'V8 mips64el - sim - beta branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'unittests'}, + ], + }, + 'V8 mips64el - sim - stable branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'unittests'}, + ], + }, + 'V8 mipsel - sim - beta branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'v8testing', 'shards': 4}, + ], + }, + 'V8 mipsel - sim - stable branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'v8testing', 'shards': 4}, + ], + }, + 'V8 ppc64 - sim - beta branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'unittests'}, + ], + }, + 'V8 ppc64 - sim - stable branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'unittests'}, + ], + }, + 'V8 s390x - sim - beta branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'unittests'}, + ], + }, + 'V8 s390x - sim - stable branch': { + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 5400, + 'priority': 35, + }, + 'tests': [ + {'name': 'unittests'}, + ], + }, } diff --git a/deps/v8/src/debug/debug-coverage.cc b/deps/v8/src/debug/debug-coverage.cc index a71c9e572b4ed8..f8b716f7c910e9 100644 --- a/deps/v8/src/debug/debug-coverage.cc +++ b/deps/v8/src/debug/debug-coverage.cc @@ -171,6 +171,12 @@ class CoverageBlockIterator final { return function_->blocks[read_index_ + 1]; } + CoverageBlock& GetPreviousBlock() { + DCHECK(IsActive()); + DCHECK_GT(read_index_, 0); + return function_->blocks[read_index_ - 1]; + } + CoverageBlock& GetParent() { DCHECK(IsActive()); return nesting_stack_.back(); @@ -325,6 +331,30 @@ void MergeNestedRanges(CoverageFunction* function) { } } +void FilterAliasedSingletons(CoverageFunction* function) { + CoverageBlockIterator iter(function); + + iter.Next(); // Advance once since we reference the previous block later. + + while (iter.Next()) { + CoverageBlock& previous_block = iter.GetPreviousBlock(); + CoverageBlock& block = iter.GetBlock(); + + bool is_singleton = block.end == kNoSourcePosition; + bool aliases_start = block.start == previous_block.start; + + if (is_singleton && aliases_start) { + // The previous block must have a full range since duplicate singletons + // have already been merged. + DCHECK_NE(previous_block.end, kNoSourcePosition); + // Likewise, the next block must have another start position since + // singletons are sorted to the end. + DCHECK_IMPLIES(iter.HasNext(), iter.GetNextBlock().start != block.start); + iter.DeleteBlock(); + } + } +} + void FilterUncoveredRanges(CoverageFunction* function) { CoverageBlockIterator iter(function); @@ -397,6 +427,15 @@ void CollectBlockCoverage(CoverageFunction* function, SharedFunctionInfo* info, // Remove duplicate singleton ranges, keeping the max count. MergeDuplicateSingletons(function); + // Remove singleton ranges with the same start position as a full range and + // throw away their counts. + // Singleton ranges are only intended to split existing full ranges and should + // never expand into a full range. Consider 'if (cond) { ... } else { ... }' + // as a problematic example; if the then-block produces a continuation + // singleton, it would incorrectly expand into the else range. + // For more context, see https://crbug.com/v8/8237. + FilterAliasedSingletons(function); + // Rewrite all singletons (created e.g. by continuations and unconditional // control flow) to ranges. RewritePositionSingletonsToRanges(function); diff --git a/deps/v8/src/debug/debug-evaluate.cc b/deps/v8/src/debug/debug-evaluate.cc index 5466ca050b3efb..583b41f1b2879c 100644 --- a/deps/v8/src/debug/debug-evaluate.cc +++ b/deps/v8/src/debug/debug-evaluate.cc @@ -995,12 +995,7 @@ void DebugEvaluate::ApplySideEffectChecks( for (interpreter::BytecodeArrayIterator it(bytecode_array); !it.done(); it.Advance()) { interpreter::Bytecode bytecode = it.current_bytecode(); - if (BytecodeRequiresRuntimeCheck(bytecode)) { - interpreter::Bytecode debugbreak = - interpreter::Bytecodes::GetDebugBreak(bytecode); - bytecode_array->set(it.current_offset(), - interpreter::Bytecodes::ToByte(debugbreak)); - } + if (BytecodeRequiresRuntimeCheck(bytecode)) it.ApplyDebugBreak(); } } diff --git a/deps/v8/src/debug/debug.cc b/deps/v8/src/debug/debug.cc index a7114b14347c6b..3a3a48b699a017 100644 --- a/deps/v8/src/debug/debug.cc +++ b/deps/v8/src/debug/debug.cc @@ -279,15 +279,12 @@ void BreakIterator::SkipToPosition(int position) { void BreakIterator::SetDebugBreak() { DebugBreakType debug_break_type = GetDebugBreakType(); if (debug_break_type == DEBUGGER_STATEMENT) return; + HandleScope scope(isolate()); DCHECK(debug_break_type >= DEBUG_BREAK_SLOT); - BytecodeArray* bytecode_array = debug_info_->DebugBytecodeArray(); - interpreter::Bytecode bytecode = - interpreter::Bytecodes::FromByte(bytecode_array->get(code_offset())); - if (interpreter::Bytecodes::IsDebugBreak(bytecode)) return; - interpreter::Bytecode debugbreak = - interpreter::Bytecodes::GetDebugBreak(bytecode); - bytecode_array->set(code_offset(), - interpreter::Bytecodes::ToByte(debugbreak)); + Handle<BytecodeArray> bytecode_array(debug_info_->DebugBytecodeArray(), + isolate()); + interpreter::BytecodeArrayAccessor(bytecode_array, code_offset()) + .ApplyDebugBreak(); } void BreakIterator::ClearDebugBreak() { @@ -2127,6 +2124,8 @@ void Debug::ClearSideEffectChecks(Handle<DebugInfo> debug_info) { Handle<BytecodeArray> original(debug_info->OriginalBytecodeArray(), isolate_); for (interpreter::BytecodeArrayIterator it(debug_bytecode); !it.done(); it.Advance()) { + // Restore from original. This may copy only the scaling prefix, which is + // correct, since we patch scaling prefixes to debug breaks if exists. debug_bytecode->set(it.current_offset(), original->get(it.current_offset())); } diff --git a/deps/v8/src/interpreter/bytecode-array-accessor.cc b/deps/v8/src/interpreter/bytecode-array-accessor.cc index ef6bdd30a171f0..3ec2cc595b170f 100644 --- a/deps/v8/src/interpreter/bytecode-array-accessor.cc +++ b/deps/v8/src/interpreter/bytecode-array-accessor.cc @@ -28,6 +28,19 @@ void BytecodeArrayAccessor::SetOffset(int offset) { UpdateOperandScale(); } +void BytecodeArrayAccessor::ApplyDebugBreak() { + // Get the raw bytecode from the bytecode array. This may give us a + // scaling prefix, which we can patch with the matching debug-break + // variant. + interpreter::Bytecode bytecode = + interpreter::Bytecodes::FromByte(bytecode_array_->get(bytecode_offset_)); + if (interpreter::Bytecodes::IsDebugBreak(bytecode)) return; + interpreter::Bytecode debugbreak = + interpreter::Bytecodes::GetDebugBreak(bytecode); + bytecode_array_->set(bytecode_offset_, + interpreter::Bytecodes::ToByte(debugbreak)); +} + void BytecodeArrayAccessor::UpdateOperandScale() { if (OffsetInBounds()) { uint8_t current_byte = bytecode_array()->get(bytecode_offset_); diff --git a/deps/v8/src/interpreter/bytecode-array-accessor.h b/deps/v8/src/interpreter/bytecode-array-accessor.h index 443929aefe075a..e36eed8ade96ae 100644 --- a/deps/v8/src/interpreter/bytecode-array-accessor.h +++ b/deps/v8/src/interpreter/bytecode-array-accessor.h @@ -70,6 +70,8 @@ class V8_EXPORT_PRIVATE BytecodeArrayAccessor { void SetOffset(int offset); + void ApplyDebugBreak(); + Bytecode current_bytecode() const; int current_bytecode_size() const; int current_offset() const { return bytecode_offset_; } diff --git a/deps/v8/src/value-serializer.cc b/deps/v8/src/value-serializer.cc index 26ab746e8cc626..0633d19a2ae559 100644 --- a/deps/v8/src/value-serializer.cc +++ b/deps/v8/src/value-serializer.cc @@ -517,12 +517,14 @@ Maybe<bool> ValueSerializer::WriteJSReceiver(Handle<JSReceiver> receiver) { case JS_TYPED_ARRAY_TYPE: case JS_DATA_VIEW_TYPE: return WriteJSArrayBufferView(JSArrayBufferView::cast(*receiver)); - case WASM_MODULE_TYPE: - if (!FLAG_wasm_disable_structured_cloning) { + case WASM_MODULE_TYPE: { + auto enabled_features = wasm::WasmFeaturesFromIsolate(isolate_); + if (!FLAG_wasm_disable_structured_cloning || enabled_features.threads) { // Only write WebAssembly modules if not disabled by a flag. return WriteWasmModule(Handle<WasmModuleObject>::cast(receiver)); } break; + } case WASM_MEMORY_TYPE: { auto enabled_features = wasm::WasmFeaturesFromIsolate(isolate_); if (enabled_features.threads) { @@ -1753,7 +1755,9 @@ MaybeHandle<JSArrayBufferView> ValueDeserializer::ReadJSArrayBufferView( } MaybeHandle<JSObject> ValueDeserializer::ReadWasmModuleTransfer() { - if (FLAG_wasm_disable_structured_cloning || expect_inline_wasm()) { + auto enabled_features = wasm::WasmFeaturesFromIsolate(isolate_); + if ((FLAG_wasm_disable_structured_cloning && !enabled_features.threads) || + expect_inline_wasm()) { return MaybeHandle<JSObject>(); } @@ -1775,7 +1779,9 @@ MaybeHandle<JSObject> ValueDeserializer::ReadWasmModuleTransfer() { } MaybeHandle<JSObject> ValueDeserializer::ReadWasmModule() { - if (FLAG_wasm_disable_structured_cloning || !expect_inline_wasm()) { + auto enabled_features = wasm::WasmFeaturesFromIsolate(isolate_); + if ((FLAG_wasm_disable_structured_cloning && !enabled_features.threads) || + !expect_inline_wasm()) { return MaybeHandle<JSObject>(); } diff --git a/deps/v8/test/debugger/regress/regress-crbug-882664.js b/deps/v8/test/debugger/regress/regress-crbug-882664.js new file mode 100644 index 00000000000000..399cfba9e27c48 --- /dev/null +++ b/deps/v8/test/debugger/regress/regress-crbug-882664.js @@ -0,0 +1,41 @@ +// 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. + +function provoke_scaling_prefix() { + var a = [0]; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; a[0]++; + return a; +} + +Debug = debug.Debug; + +function success(expectation, source) { + const result = Debug.evaluateGlobal(source, true).value(); + assertEquals(expectation, result); +} + +success([216], "provoke_scaling_prefix()"); diff --git a/deps/v8/test/mjsunit/code-coverage-block.js b/deps/v8/test/mjsunit/code-coverage-block.js index 2ecd1b0d1e15dd..8cbb2969f7d050 100644 --- a/deps/v8/test/mjsunit/code-coverage-block.js +++ b/deps/v8/test/mjsunit/code-coverage-block.js @@ -847,7 +847,49 @@ Util.escape("foo.bar"); // 0400 [{"start":0,"end":449,"count":1}, {"start":64,"end":351,"count":1}, {"start":112,"end":203,"count":0}, - {"start":303,"end":350,"count":0}] + {"start":268,"end":350,"count":0}] +); + +TestCoverage( +"https://crbug.com/v8/8237", +` +!function() { // 0000 + if (true) // 0050 + while (false) return; else nop(); // 0100 +}(); // 0150 +!function() { // 0200 + if (true) l0: { break l0; } else // 0250 + if (nop()) { } // 0300 +}(); // 0350 +!function() { // 0400 + if (true) { if (false) { return; } // 0450 + } else if (nop()) { } }(); // 0500 +!function(){ // 0550 + if(true)while(false)return;else nop() // 0600 +}(); // 0650 +!function(){ // 0700 + if(true) l0:{break l0}else if (nop()){} // 0750 +}(); // 0800 +!function(){ // 0850 + if(true){if(false){return}}else // 0900 + if(nop()){} // 0950 +}(); // 1000 +`, +[{"start":0,"end":1049,"count":1}, + {"start":1,"end":151,"count":1}, + {"start":118,"end":137,"count":0}, + {"start":201,"end":351,"count":1}, + {"start":277,"end":318,"count":0}, + {"start":401,"end":525,"count":1}, + {"start":475,"end":486,"count":0}, + {"start":503,"end":523,"count":0}, + {"start":551,"end":651,"count":1}, + {"start":622,"end":639,"count":0}, + {"start":701,"end":801,"count":1}, + {"start":773,"end":791,"count":0}, + {"start":851,"end":1001,"count":1}, + {"start":920,"end":928,"count":0}, + {"start":929,"end":965,"count":0}] ); %DebugToggleBlockCoverage(false);