diff --git a/common.gypi b/common.gypi index 4113515bd1a592..b6e8ddd8bd349a 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.15', + 'v8_embedder_string': '-node.12', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/.vpython b/deps/v8/.vpython index 3b7cb32468e1f5..d4a07677ca9a22 100644 --- a/deps/v8/.vpython +++ b/deps/v8/.vpython @@ -24,6 +24,21 @@ python_version: "2.7" +# The default set of platforms vpython checks does not yet include mac-arm64. +# Setting `verify_pep425_tag` to the list of platforms we explicitly must support +# allows us to ensure that vpython specs stay mac-arm64-friendly +verify_pep425_tag: [ + {python: "cp27", abi: "cp27mu", platform: "manylinux1_x86_64"}, + {python: "cp27", abi: "cp27mu", platform: "linux_arm64"}, + {python: "cp27", abi: "cp27mu", platform: "linux_armv6l"}, + + {python: "cp27", abi: "cp27m", platform: "macosx_10_10_intel"}, + {python: "cp27", abi: "cp27m", platform: "macosx_11_0_arm64"}, + + {python: "cp27", abi: "cp27m", platform: "win32"}, + {python: "cp27", abi: "cp27m", platform: "win_amd64"} +] + # Needed by third_party/catapult/devil/devil, which is imported by # build/android/test_runner.py when running performance tests. wheel: < diff --git a/deps/v8/BUILD.bazel b/deps/v8/BUILD.bazel index e70b2f4b2df05b..23bce0f4bdcbfc 100644 --- a/deps/v8/BUILD.bazel +++ b/deps/v8/BUILD.bazel @@ -165,7 +165,6 @@ config_setting( # v8_control_flow_integrity # v8_enable_virtual_memory_cage # cppgc_enable_caged_heap -# cppgc_enable_check_assignments_in_prefinalizers # cppgc_enable_object_names # cppgc_enable_verify_heap # cppgc_enable_young_generation @@ -894,6 +893,8 @@ filegroup( "src/torque/instance-type-generator.cc", "src/torque/instructions.cc", "src/torque/instructions.h", + "src/torque/kythe-data.cc", + "src/torque/kythe-data.h", "src/torque/parameter-difference.h", "src/torque/server-data.cc", "src/torque/server-data.h", @@ -1218,6 +1219,7 @@ filegroup( "src/flags/flag-definitions.h", "src/flags/flags.cc", "src/flags/flags.h", + "src/handles/global-handles-inl.h", "src/handles/global-handles.cc", "src/handles/global-handles.h", "src/handles/handles-inl.h", @@ -1588,6 +1590,7 @@ filegroup( "src/objects/lookup-inl.h", "src/objects/lookup.cc", "src/objects/lookup.h", + "src/objects/managed-inl.h", "src/objects/managed.cc", "src/objects/managed.h", "src/objects/map-inl.h", @@ -1619,6 +1622,8 @@ filegroup( "src/objects/objects-definitions.h", "src/objects/oddball-inl.h", "src/objects/oddball.h", + "src/objects/option-utils.h", + "src/objects/option-utils.cc", "src/objects/ordered-hash-table-inl.h", "src/objects/ordered-hash-table.cc", "src/objects/ordered-hash-table.h", @@ -1708,6 +1713,7 @@ filegroup( "src/objects/value-serializer.cc", "src/objects/value-serializer.h", "src/objects/visitors.cc", + "src/objects/visitors-inl.h", "src/objects/visitors.h", "src/parsing/expression-scope.h", "src/parsing/func-name-inferrer.cc", @@ -2727,6 +2733,7 @@ filegroup( "src/bigint/bigint-internal.cc", "src/bigint/bigint-internal.h", "src/bigint/bigint.h", + "src/bigint/bitwise.cc", "src/bigint/digit-arithmetic.h", "src/bigint/div-barrett.cc", "src/bigint/div-burnikel.cc", @@ -2909,11 +2916,11 @@ v8_torque( "exported-macros-assembler.h", "factory.cc", "factory.inc", - "field-offsets.h", "instance-types.h", "interface-descriptors.inc", "objects-body-descriptors-inl.inc", "objects-printer.cc", + "visitor-lists.h", ], args = select({ ":is_v8_annotate_torque_ir": [ "-annotate-ir" ], diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 5c7d931b279b26..f491f2a4e64c6b 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -293,10 +293,6 @@ declare_args() { # Enables additional heap verification phases and checks. cppgc_enable_verify_heap = "" - # Enable assignment checks for Members/Persistents during prefinalizer invocations. - # TODO(v8:11749): Enable by default after fixing any existing issues in Blink. - cppgc_enable_check_assignments_in_prefinalizers = false - # Enable allocations during prefinalizer invocations. cppgc_allow_allocations_in_prefinalizers = false @@ -351,7 +347,9 @@ declare_args() { # parameter count of function with JS linkage. # TODO(v8:11112): Remove once all architectures support the flag and it is # enabled unconditionally. - v8_include_receiver_in_argc = false + v8_include_receiver_in_argc = + v8_current_cpu == "x86" || v8_current_cpu == "x64" || + v8_current_cpu == "arm" || v8_current_cpu == "arm64" } # Derived defaults. @@ -474,6 +472,13 @@ if (build_with_chromium && v8_current_cpu == "arm64" && v8_control_flow_integrity = true } +# Enable the virtual memory cage on 64-bit Chromium builds. +if (build_with_chromium && + (v8_current_cpu == "arm64" || v8_current_cpu == "x64")) { + # The cage is incompatible with lsan. + v8_enable_virtual_memory_cage = !is_lsan +} + assert(!v8_disable_write_barriers || v8_enable_single_generation, "Disabling write barriers works only with single generation") @@ -789,10 +794,6 @@ config("features") { defines += [ "CPPGC_VERIFY_HEAP" ] } - if (cppgc_enable_check_assignments_in_prefinalizers) { - defines += [ "CPPGC_CHECK_ASSIGNMENTS_IN_PREFINALIZERS" ] - } - if (cppgc_allow_allocations_in_prefinalizers) { defines += [ "CPPGC_ALLOW_ALLOCATIONS_IN_PREFINALIZERS" ] } @@ -1219,7 +1220,12 @@ config("toolchain") { } if (is_clang) { - cflags += [ "-Wmissing-field-initializers" ] + cflags += [ + "-Wmissing-field-initializers", + + # TODO(v8:12245): Fix shadowing instances and remove. + "-Wno-shadow", + ] if (v8_current_cpu != "mips" && v8_current_cpu != "mipsel") { # We exclude MIPS because the IsMipsArchVariant macro causes trouble. @@ -1255,7 +1261,144 @@ config("toolchain") { } if (!is_clang && is_win) { - cflags += [ "/wd4506" ] # Benign "no definition for inline function" + cflags += [ + "/wd4506", # Benign "no definition for inline function" + + # Warnings permanently disabled: + + # C4091: 'typedef ': ignored on left of 'X' when no variable is + # declared. + # This happens in a number of Windows headers. Dumb. + "/wd4091", + + # C4127: conditional expression is constant + # This warning can in theory catch dead code and other problems, but + # triggers in far too many desirable cases where the conditional + # expression is either set by macros or corresponds some legitimate + # compile-time constant expression (due to constant template args, + # conditionals comparing the sizes of different types, etc.). Some of + # these can be worked around, but it's not worth it. + "/wd4127", + + # C4251: 'identifier' : class 'type' needs to have dll-interface to be + # used by clients of class 'type2' + # This is necessary for the shared library build. + "/wd4251", + + # C4275: non dll-interface class used as base for dll-interface class + # This points out a potential (but rare) problem with referencing static + # fields of a non-exported base, through the base's non-exported inline + # functions, or directly. The warning is subtle enough that people just + # suppressed it when they saw it, so it's not worth it. + "/wd4275", + + # C4312 is a VS 2015 64-bit warning for integer to larger pointer. + # TODO(brucedawson): fix warnings, crbug.com/554200 + "/wd4312", + + # C4324 warns when padding is added to fulfill alignas requirements, + # but can trigger in benign cases that are difficult to individually + # suppress. + "/wd4324", + + # C4351: new behavior: elements of array 'array' will be default + # initialized + # This is a silly "warning" that basically just alerts you that the + # compiler is going to actually follow the language spec like it's + # supposed to, instead of not following it like old buggy versions did. + # There's absolutely no reason to turn this on. + "/wd4351", + + # C4355: 'this': used in base member initializer list + # It's commonly useful to pass |this| to objects in a class' initializer + # list. While this warning can catch real bugs, most of the time the + # constructors in question don't attempt to call methods on the passed-in + # pointer (until later), and annotating every legit usage of this is + # simply more hassle than the warning is worth. + "/wd4355", + + # C4503: 'identifier': decorated name length exceeded, name was + # truncated + # This only means that some long error messages might have truncated + # identifiers in the presence of lots of templates. It has no effect on + # program correctness and there's no real reason to waste time trying to + # prevent it. + "/wd4503", + + # Warning C4589 says: "Constructor of abstract class ignores + # initializer for virtual base class." Disable this warning because it + # is flaky in VS 2015 RTM. It triggers on compiler generated + # copy-constructors in some cases. + "/wd4589", + + # C4611: interaction between 'function' and C++ object destruction is + # non-portable + # This warning is unavoidable when using e.g. setjmp/longjmp. MSDN + # suggests using exceptions instead of setjmp/longjmp for C++, but + # Chromium code compiles without exception support. We therefore have to + # use setjmp/longjmp for e.g. JPEG decode error handling, which means we + # have to turn off this warning (and be careful about how object + # destruction happens in such cases). + "/wd4611", + + # Warnings to evaluate and possibly fix/reenable later: + + "/wd4100", # Unreferenced formal function parameter. + "/wd4121", # Alignment of a member was sensitive to packing. + "/wd4244", # Conversion: possible loss of data. + "/wd4505", # Unreferenced local function has been removed. + "/wd4510", # Default constructor could not be generated. + "/wd4512", # Assignment operator could not be generated. + "/wd4610", # Class can never be instantiated, constructor required. + "/wd4838", # Narrowing conversion. Doesn't seem to be very useful. + "/wd4995", # 'X': name was marked as #pragma deprecated + "/wd4996", # Deprecated function warning. + + # These are variable shadowing warnings that are new in VS2015. We + # should work through these at some point -- they may be removed from + # the RTM release in the /W4 set. + "/wd4456", + "/wd4457", + "/wd4458", + "/wd4459", + + # All of our compilers support the extensions below. + "/wd4200", # nonstandard extension used: zero-sized array in struct/union + "/wd4201", # nonstandard extension used: nameless struct/union + "/wd4204", # nonstandard extension used : non-constant aggregate + # initializer + + "/wd4221", # nonstandard extension used : 'identifier' : cannot be + # initialized using address of automatic variable + + # http://crbug.com/588506 - Conversion suppressions waiting on Clang + # -Wconversion. + "/wd4245", # 'conversion' : conversion from 'type1' to 'type2', + # signed/unsigned mismatch + + "/wd4267", # 'var' : conversion from 'size_t' to 'type', possible loss of + # data + + "/wd4305", # 'identifier' : truncation from 'type1' to 'type2' + "/wd4389", # 'operator' : signed/unsigned mismatch + + "/wd4702", # unreachable code + + # http://crbug.com/848979 - MSVC is more conservative than Clang with + # regards to variables initialized and consumed in different branches. + "/wd4701", # Potentially uninitialized local variable 'name' used + "/wd4703", # Potentially uninitialized local pointer variable 'name' used + + # http://crbug.com/848979 - Remaining Clang permitted warnings. + "/wd4661", # 'identifier' : no suitable definition provided for explicit + # template instantiation request + + "/wd4706", # assignment within conditional expression + # MSVC is stricter and requires a boolean expression. + + "/wd4715", # 'function' : not all control paths return a value' + # MSVC does not analyze switch (enum) for completeness. + ] } if (!is_clang && !is_win) { @@ -1702,11 +1845,11 @@ template("run_torque") { "$destination_folder/exported-macros-assembler.h", "$destination_folder/factory.cc", "$destination_folder/factory.inc", - "$destination_folder/field-offsets.h", "$destination_folder/instance-types.h", "$destination_folder/interface-descriptors.inc", "$destination_folder/objects-body-descriptors-inl.inc", "$destination_folder/objects-printer.cc", + "$destination_folder/visitor-lists.h", ] foreach(file, torque_files) { @@ -2751,6 +2894,7 @@ v8_header_set("v8_internal_headers") { "src/extensions/ignition-statistics-extension.h", "src/extensions/statistics-extension.h", "src/extensions/trigger-failure-extension.h", + "src/handles/global-handles-inl.h", "src/handles/global-handles.h", "src/handles/handles-inl.h", "src/handles/handles.h", @@ -3004,6 +3148,7 @@ v8_header_set("v8_internal_headers") { "src/objects/lookup-cache.h", "src/objects/lookup-inl.h", "src/objects/lookup.h", + "src/objects/managed-inl.h", "src/objects/managed.h", "src/objects/map-inl.h", "src/objects/map-updater.h", @@ -3029,6 +3174,7 @@ v8_header_set("v8_internal_headers") { "src/objects/objects.h", "src/objects/oddball-inl.h", "src/objects/oddball.h", + "src/objects/option-utils.h", "src/objects/ordered-hash-table-inl.h", "src/objects/ordered-hash-table.h", "src/objects/osr-optimized-code-cache-inl.h", @@ -3097,6 +3243,7 @@ v8_header_set("v8_internal_headers") { "src/objects/transitions.h", "src/objects/type-hints.h", "src/objects/value-serializer.h", + "src/objects/visitors-inl.h", "src/objects/visitors.h", "src/parsing/expression-scope.h", "src/parsing/func-name-inferrer.h", @@ -3467,7 +3614,8 @@ v8_header_set("v8_internal_headers") { (current_cpu == "x64" && (is_linux || is_chromeos || is_mac))) { sources += [ "src/trap-handler/handler-inside-posix.h" ] } - if (current_cpu == "x64" && (is_linux || is_chromeos || is_mac)) { + if (current_cpu == "x64" && + (is_linux || is_chromeos || is_mac || is_win)) { sources += [ "src/trap-handler/trap-handler-simulator.h" ] } } @@ -4072,6 +4220,7 @@ v8_source_set("v8_base_without_compiler") { "src/objects/module.cc", "src/objects/object-type.cc", "src/objects/objects.cc", + "src/objects/option-utils.cc", "src/objects/ordered-hash-table.cc", "src/objects/osr-optimized-code-cache.cc", "src/objects/property-descriptor.cc", @@ -4388,16 +4537,22 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/arm64/regexp-macro-assembler-arm64.cc", ] if (v8_enable_webassembly) { - # Trap handling is enabled on arm64 Mac and in simulators on x64 on Linux - # and Mac. + # Trap handling is enabled on arm64 Mac and in simulators on x64 on Linux, + # Mac, and Windows. if ((current_cpu == "arm64" && is_mac) || (current_cpu == "x64" && (is_linux || is_chromeos || is_mac))) { sources += [ "src/trap-handler/handler-inside-posix.cc", "src/trap-handler/handler-outside-posix.cc", ] + } else if (current_cpu == "x64" && is_win) { + sources += [ + "src/trap-handler/handler-inside-win.cc", + "src/trap-handler/handler-outside-win.cc", + ] } - if (current_cpu == "x64" && (is_linux || is_chromeos || is_mac)) { + if (current_cpu == "x64" && + (is_linux || is_chromeos || is_mac || is_win)) { sources += [ "src/trap-handler/handler-outside-simulator.cc" ] } } @@ -4675,6 +4830,8 @@ v8_source_set("torque_base") { "src/torque/instance-type-generator.cc", "src/torque/instructions.cc", "src/torque/instructions.h", + "src/torque/kythe-data.cc", + "src/torque/kythe-data.h", "src/torque/parameter-difference.h", "src/torque/server-data.cc", "src/torque/server-data.h", @@ -5106,6 +5263,7 @@ v8_source_set("v8_bigint") { "src/bigint/bigint-internal.cc", "src/bigint/bigint-internal.h", "src/bigint/bigint.h", + "src/bigint/bitwise.cc", "src/bigint/digit-arithmetic.h", "src/bigint/div-burnikel.cc", "src/bigint/div-helpers.cc", diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 8059e3b8c3992c..587b7e53759ce5 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -49,10 +49,10 @@ vars = { 'reclient_version': 're_client_version:0.40.0.40ff5a5', # GN CIPD package version. - 'gn_version': 'git_revision:69ec4fca1fa69ddadae13f9e6b7507efa0675263', + 'gn_version': 'git_revision:0153d369bbccc908f4da4993b1ba82728055926a', # luci-go CIPD package version. - 'luci_go': 'git_revision:7b62727dc713b47d7a7ce9bca27500cb8e82ebd7', + 'luci_go': 'git_revision:a373a19da0fbbbe81b2b684e3797260294393e40', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_build-tools_version @@ -73,7 +73,7 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_platform-tools_version # and whatever else without interference from each other. - 'android_sdk_platform-tools_version': 'qi_k82nm6j9nz4dQosOoqXew4_TFAy8rcGOHDLptx1sC', + 'android_sdk_platform-tools_version': 'g7n_-r6yJd_SGRklujGB1wEt8iyr77FZTUJVS9w6O34C', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_platforms_version # and whatever else without interference from each other. @@ -85,16 +85,16 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_tools-lint_version # and whatever else without interference from each other. - 'android_sdk_cmdline-tools_version': 'ZT3JmI6GMG4YVcZ1OtECRVMOLLJAWAdPbi-OclubJLMC', + 'android_sdk_cmdline-tools_version': 'AuYa11pULKT8AI14_owabJrkZoRGuovL-nvwmiONlYEC', } deps = { 'base/trace_event/common': - Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '715537d6007ca71837f48bcb04fc3d482aed2507', + Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '68d816952258c9d817bba656ee2664b35507f01b', 'build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + '17d097b0ffdc297f04afb54e9e3abff3f1203f06', + Var('chromium_url') + '/chromium/src/build.git' + '@' + 'ebad8533842661f66b9b905e0ee9890a32f628d5', 'buildtools': - Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '7ea3a871db68ae2cbbeaf5433a3192a799ef3c11', + Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + 'a9bc3e283182a586998338a665c7eae17406ec54', 'buildtools/clang_format/script': Var('chromium_url') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + '99803d74e35962f63a775f29477882afd4d57d94', 'buildtools/linux64': { @@ -120,9 +120,9 @@ deps = { 'buildtools/third_party/libc++/trunk': Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '79a2e924d96e2fc1e4b937c42efd08898fa472d7', 'buildtools/third_party/libc++abi/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '17de75220a90f23a16f9f87fbc5c00dce475b726', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '9959b06ccd7291269796e85c7c8f7b432af414bd', 'buildtools/third_party/libunwind/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '44ea7aba6a34a9250e7793418d83f209a480caf4', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'a002c725cf03e16d3bc47dd9b7962aa22f7ee1d9', 'buildtools/win': { 'packages': [ { @@ -148,14 +148,14 @@ deps = { 'test/mozilla/data': Var('chromium_url') + '/v8/deps/third_party/mozilla-tests.git' + '@' + 'f6c578a10ea707b1a8ab0b88943fe5115ce2b9be', 'test/test262/data': - Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + '50f3fca7a0eac6b6e8e5e9aee7af3c2a05831261', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + '50dd431dffe5cf86e9064a652d6b01dbbe542cf0', 'test/test262/harness': Var('chromium_url') + '/external/github.com/test262-utils/test262-harness-py.git' + '@' + '278bcfaed0dcaa13936831fb1769d15e7c1e3b2b', 'third_party/aemu-linux-x64': { 'packages': [ { 'package': 'fuchsia/third_party/aemu/linux-amd64', - 'version': 'QewYN5289B8deg5Mn6clWEv58UqpocHGKeob2F0T87kC' + 'version': 'FAd7QuRV-mCjbKgg2SO4BBlRCvGIsI672THjo3tEIZAC' }, ], 'condition': 'host_os == "linux" and checkout_fuchsia', @@ -176,7 +176,7 @@ deps = { 'condition': 'checkout_android', }, 'third_party/android_platform': { - 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '6e5dc9acd241c308385f970c384d9e083b2b6e56', + 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '7a11b799efba1cd679b4f5d14889465e9e1fb1f4', 'condition': 'checkout_android', }, 'third_party/android_sdk/public': { @@ -218,7 +218,7 @@ deps = { 'dep_type': 'cipd', }, 'third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '2331f088546de8f58dcc02daf8212254aaeb2d4c', + 'url': Var('chromium_url') + '/catapult.git' + '@' + 'c0b9d253fbf9a729be51d3890fa78be4b5eb3352', 'condition': 'checkout_android', }, 'third_party/colorama/src': { @@ -226,20 +226,20 @@ deps = { 'condition': 'checkout_android', }, 'third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '728566654bb1d2c78cdbe6b642c0d68c6f658ca7', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '0e2fb336b2e7ddbbb9c5ab70eab25f82f55dff2b', 'third_party/fuchsia-sdk': { 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + '18896843130c33372c455c153ad07d2217bd2085', 'condition': 'checkout_fuchsia', }, 'third_party/google_benchmark/src': { - 'url': Var('chromium_url') + '/external/github.com/google/benchmark.git' + '@' + 'c23a0012523bc3e12c9323f398dcc433c4f19f05', + 'url': Var('chromium_url') + '/external/github.com/google/benchmark.git' + '@' + '0baacde3618ca617da95375e0af13ce1baadea47', }, 'third_party/googletest/src': - Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '955c7f837efad184ec63e771c42542d37545eaef', + Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '3b49be074d5c1340eeb447e6a8e78427051e675a', 'third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'ece15d049f2d360721716089372e3749fb89e0f4', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '3f443830bd52d3aa5fab3c1aa2b6d0848bb5039d', 'third_party/instrumented_libraries': - Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + '47226fa33ef5c9b48668c74128f25ef82f10e7af', + Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + '5df06a49fc485f3371e8ca2f4957dac4840ba3bb', 'third_party/ittapi': { # Force checkout ittapi libraries to pass v8 header includes check on # bots that has check_v8_header_includes enabled. @@ -283,9 +283,9 @@ deps = { 'condition': 'checkout_android', }, 'third_party/zlib': - Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '77c132322fe81a1f5518b326e18c99ebd3281627', + Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + 'dfa96e81458fb3b39676e45f7e9e000dff789b05', 'tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '664e4259b150e07f1a1e440459f59fbc68edb82f', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'c06edd1f455183fc89e9f8c2cf745db8f564d8ea', 'tools/clang/dsymutil': { 'packages': [ { @@ -321,7 +321,18 @@ include_rules = [ '+include', '+unicode', '+third_party/fdlibm', - '+third_party/ittapi/include' + '+third_party/ittapi/include', + # Abseil features are allow-listed. Please use your best judgement when adding + # to this set -- if in doubt, email v8-dev@. For general guidance, refer to + # the Chromium guidelines (though note that some requirements in V8 may be + # different to Chromium's): + # https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++11.md + '+absl/types/optional.h', + '+absl/types/variant.h', + '+absl/status', + # Some abseil features are explicitly banned. + '-absl/types/any.h', # Requires RTTI. + '-absl/types/flags', # Requires RTTI. ] # checkdeps.py shouldn't check for includes in these directories: @@ -483,7 +494,7 @@ hooks = [ '--no_resume', '--no_auth', '--bucket', 'chromium-instrumented-libraries', - '-s', 'third_party/instrumented_libraries/binaries/msan-chained-origins-trusty.tgz.sha1', + '-s', 'third_party/instrumented_libraries/binaries/msan-chained-origins-xenial.tgz.sha1', ], }, { @@ -494,7 +505,7 @@ hooks = [ '--no_resume', '--no_auth', '--bucket', 'chromium-instrumented-libraries', - '-s', 'third_party/instrumented_libraries/binaries/msan-no-origins-trusty.tgz.sha1', + '-s', 'third_party/instrumented_libraries/binaries/msan-no-origins-xenial.tgz.sha1', ], }, { diff --git a/deps/v8/ENG_REVIEW_OWNERS b/deps/v8/ENG_REVIEW_OWNERS index e5040c45ad1de7..3943c49432ce82 100644 --- a/deps/v8/ENG_REVIEW_OWNERS +++ b/deps/v8/ENG_REVIEW_OWNERS @@ -5,3 +5,4 @@ adamk@chromium.org danno@chromium.org hpayer@chromium.org +verwaest@chromium.org diff --git a/deps/v8/RISCV_OWNERS b/deps/v8/RISCV_OWNERS index 8f8e15a40a0cd3..e3e11fdf4947db 100644 --- a/deps/v8/RISCV_OWNERS +++ b/deps/v8/RISCV_OWNERS @@ -1,3 +1,4 @@ brice.dobry@futurewei.com peng.w@rioslab.org qiuji@iscas.ac.cn +yahan@iscas.ac.cn diff --git a/deps/v8/base/trace_event/common/trace_event_common.h b/deps/v8/base/trace_event/common/trace_event_common.h index 62f3c2ec07325d..9384adeb69f65d 100644 --- a/deps/v8/base/trace_event/common/trace_event_common.h +++ b/deps/v8/base/trace_event/common/trace_event_common.h @@ -144,12 +144,15 @@ // class MyData : public base::trace_event::ConvertableToTraceFormat { // public: // MyData() {} +// +// MyData(const MyData&) = delete; +// MyData& operator=(const MyData&) = delete; +// // void AppendAsTraceFormat(std::string* out) const override { // out->append("{\"foo\":1}"); // } // private: // ~MyData() override {} -// DISALLOW_COPY_AND_ASSIGN(MyData); // }; // // TRACE_EVENT1("foo", "bar", "data", diff --git a/deps/v8/include/cppgc/internal/persistent-node.h b/deps/v8/include/cppgc/internal/persistent-node.h index b5dba476a47900..1fea667848b30d 100644 --- a/deps/v8/include/cppgc/internal/persistent-node.h +++ b/deps/v8/include/cppgc/internal/persistent-node.h @@ -75,16 +75,16 @@ class PersistentNode final { TraceCallback trace_ = nullptr; }; -class V8_EXPORT PersistentRegion { +class V8_EXPORT PersistentRegionBase { using PersistentNodeSlots = std::array; public: - PersistentRegion() = default; + PersistentRegionBase() = default; // Clears Persistent fields to avoid stale pointers after heap teardown. - ~PersistentRegion(); + ~PersistentRegionBase(); - PersistentRegion(const PersistentRegion&) = delete; - PersistentRegion& operator=(const PersistentRegion&) = delete; + PersistentRegionBase(const PersistentRegionBase&) = delete; + PersistentRegionBase& operator=(const PersistentRegionBase&) = delete; PersistentNode* AllocateNode(void* owner, TraceCallback trace) { if (!free_list_head_) { @@ -126,8 +126,39 @@ class V8_EXPORT PersistentRegion { friend class CrossThreadPersistentRegion; }; -// CrossThreadPersistent uses PersistentRegion but protects it using this lock -// when needed. +// Variant of PersistentRegionBase that checks whether the allocation and +// freeing happens only on the thread that created the region. +class V8_EXPORT PersistentRegion final : public PersistentRegionBase { + public: + PersistentRegion(); + // Clears Persistent fields to avoid stale pointers after heap teardown. + ~PersistentRegion() = default; + + PersistentRegion(const PersistentRegion&) = delete; + PersistentRegion& operator=(const PersistentRegion&) = delete; + + V8_INLINE PersistentNode* AllocateNode(void* owner, TraceCallback trace) { +#if V8_ENABLE_CHECKS + CheckIsCreationThread(); +#endif // V8_ENABLE_CHECKS + return PersistentRegionBase::AllocateNode(owner, trace); + } + + V8_INLINE void FreeNode(PersistentNode* node) { +#if V8_ENABLE_CHECKS + CheckIsCreationThread(); +#endif // V8_ENABLE_CHECKS + PersistentRegionBase::FreeNode(node); + } + + private: + void CheckIsCreationThread(); + + int creation_thread_id_; +}; + +// CrossThreadPersistent uses PersistentRegionBase but protects it using this +// lock when needed. class V8_EXPORT PersistentRegionLock final { public: PersistentRegionLock(); @@ -136,9 +167,10 @@ class V8_EXPORT PersistentRegionLock final { static void AssertLocked(); }; -// Variant of PersistentRegion that checks whether the PersistentRegionLock is -// locked. -class V8_EXPORT CrossThreadPersistentRegion final : protected PersistentRegion { +// Variant of PersistentRegionBase that checks whether the PersistentRegionLock +// is locked. +class V8_EXPORT CrossThreadPersistentRegion final + : protected PersistentRegionBase { public: CrossThreadPersistentRegion() = default; // Clears Persistent fields to avoid stale pointers after heap teardown. @@ -150,12 +182,12 @@ class V8_EXPORT CrossThreadPersistentRegion final : protected PersistentRegion { V8_INLINE PersistentNode* AllocateNode(void* owner, TraceCallback trace) { PersistentRegionLock::AssertLocked(); - return PersistentRegion::AllocateNode(owner, trace); + return PersistentRegionBase::AllocateNode(owner, trace); } V8_INLINE void FreeNode(PersistentNode* node) { PersistentRegionLock::AssertLocked(); - PersistentRegion::FreeNode(node); + PersistentRegionBase::FreeNode(node); } void Trace(Visitor*); diff --git a/deps/v8/include/cppgc/internal/pointer-policies.h b/deps/v8/include/cppgc/internal/pointer-policies.h index cdf0bb693d6996..7c4f4a0862a67f 100644 --- a/deps/v8/include/cppgc/internal/pointer-policies.h +++ b/deps/v8/include/cppgc/internal/pointer-policies.h @@ -51,7 +51,17 @@ struct NoWriteBarrierPolicy { static void AssigningBarrier(const void*, const void*) {} }; -class V8_EXPORT EnabledCheckingPolicy { +class V8_EXPORT SameThreadEnabledCheckingPolicyBase { + protected: + void CheckPointerImpl(const void* ptr, bool points_to_payload, + bool check_off_heap_assignments); + + const HeapBase* heap_ = nullptr; +}; + +template +class V8_EXPORT SameThreadEnabledCheckingPolicy + : private SameThreadEnabledCheckingPolicyBase { protected: template void CheckPointer(const T* ptr) { @@ -61,23 +71,20 @@ class V8_EXPORT EnabledCheckingPolicy { } private: - void CheckPointerImpl(const void* ptr, bool points_to_payload); - template > struct CheckPointersImplTrampoline { - static void Call(EnabledCheckingPolicy* policy, const T* ptr) { - policy->CheckPointerImpl(ptr, false); + static void Call(SameThreadEnabledCheckingPolicy* policy, const T* ptr) { + policy->CheckPointerImpl(ptr, false, kCheckOffHeapAssignments); } }; template struct CheckPointersImplTrampoline { - static void Call(EnabledCheckingPolicy* policy, const T* ptr) { - policy->CheckPointerImpl(ptr, IsGarbageCollectedTypeV); + static void Call(SameThreadEnabledCheckingPolicy* policy, const T* ptr) { + policy->CheckPointerImpl(ptr, IsGarbageCollectedTypeV, + kCheckOffHeapAssignments); } }; - - const HeapBase* heap_ = nullptr; }; class DisabledCheckingPolicy { @@ -86,8 +93,12 @@ class DisabledCheckingPolicy { }; #if V8_ENABLE_CHECKS -using DefaultMemberCheckingPolicy = EnabledCheckingPolicy; -using DefaultPersistentCheckingPolicy = EnabledCheckingPolicy; +// Off heap members are not connected to object graph and thus cannot ressurect +// dead objects. +using DefaultMemberCheckingPolicy = + SameThreadEnabledCheckingPolicy; +using DefaultPersistentCheckingPolicy = + SameThreadEnabledCheckingPolicy; #else using DefaultMemberCheckingPolicy = DisabledCheckingPolicy; using DefaultPersistentCheckingPolicy = DisabledCheckingPolicy; diff --git a/deps/v8/include/cppgc/internal/write-barrier.h b/deps/v8/include/cppgc/internal/write-barrier.h index 28184dc9c83078..67f039c6584513 100644 --- a/deps/v8/include/cppgc/internal/write-barrier.h +++ b/deps/v8/include/cppgc/internal/write-barrier.h @@ -214,6 +214,11 @@ struct WriteBarrierTypeForCagedHeapPolicy::ValueModeDispatch< static V8_INLINE WriteBarrier::Type Get(const void* slot, const void* value, WriteBarrier::Params& params, HeapHandleCallback) { +#if !defined(CPPGC_YOUNG_GENERATION) + if (V8_LIKELY(!WriteBarrier::IsAnyIncrementalOrConcurrentMarking())) { + return SetAndReturnType(params); + } +#endif // !CPPGC_YOUNG_GENERATION bool within_cage = TryGetCagedHeap(slot, value, params); if (!within_cage) { return WriteBarrier::Type::kNone; @@ -317,7 +322,10 @@ struct WriteBarrierTypeForNonCagedHeapPolicy::ValueModeDispatch< HeapHandleCallback callback) { // The following check covers nullptr as well as sentinel pointer. if (object <= static_cast(kSentinelPointer)) { - return WriteBarrier::Type::kNone; + return SetAndReturnType(params); + } + if (V8_LIKELY(!WriteBarrier::IsAnyIncrementalOrConcurrentMarking())) { + return SetAndReturnType(params); } if (IsMarking(object, ¶ms.heap)) { return SetAndReturnType(params); diff --git a/deps/v8/include/cppgc/persistent.h b/deps/v8/include/cppgc/persistent.h index b83a464576e78c..182fb08549a86d 100644 --- a/deps/v8/include/cppgc/persistent.h +++ b/deps/v8/include/cppgc/persistent.h @@ -45,7 +45,7 @@ class PersistentBase { mutable const void* raw_ = nullptr; mutable PersistentNode* node_ = nullptr; - friend class PersistentRegion; + friend class PersistentRegionBase; }; // The basic class from which all Persistent classes are generated. diff --git a/deps/v8/include/v8-callbacks.h b/deps/v8/include/v8-callbacks.h index f424a24d8bdfff..870df6a8211139 100644 --- a/deps/v8/include/v8-callbacks.h +++ b/deps/v8/include/v8-callbacks.h @@ -308,6 +308,9 @@ using WasmSimdEnabledCallback = bool (*)(Local context); // --- Callback for checking if WebAssembly exceptions are enabled --- using WasmExceptionsEnabledCallback = bool (*)(Local context); +// --- Callback for checking if WebAssembly dynamic tiering is enabled --- +using WasmDynamicTieringEnabledCallback = bool (*)(Local context); + // --- Callback for checking if the SharedArrayBuffer constructor is enabled --- using SharedArrayBufferConstructorEnabledCallback = bool (*)(Local context); diff --git a/deps/v8/include/v8-fast-api-calls.h b/deps/v8/include/v8-fast-api-calls.h index 90cbe680bacc20..cf90695785393b 100644 --- a/deps/v8/include/v8-fast-api-calls.h +++ b/deps/v8/include/v8-fast-api-calls.h @@ -277,6 +277,17 @@ class CTypeInfo { Flags flags = Flags::kNone) : type_(type), sequence_type_(sequence_type), flags_(flags) {} + typedef uint32_t Identifier; + explicit constexpr CTypeInfo(Identifier identifier) + : CTypeInfo(static_cast(identifier >> 16), + static_cast((identifier >> 8) & 255), + static_cast(identifier & 255)) {} + constexpr Identifier GetId() const { + return static_cast(type_) << 16 | + static_cast(sequence_type_) << 8 | + static_cast(flags_); + } + constexpr Type GetType() const { return type_; } constexpr SequenceType GetSequenceType() const { return sequence_type_; } constexpr Flags GetFlags() const { return flags_; } @@ -324,6 +335,14 @@ struct FastApiTypedArray : public FastApiTypedArrayBase { return tmp; } + bool getStorageIfAligned(T** elements) const { + if (reinterpret_cast(data_) % alignof(T) != 0) { + return false; + } + *elements = reinterpret_cast(data_); + return true; + } + private: // This pointer should include the typed array offset applied. // It's not guaranteed that it's aligned to sizeof(T), it's only @@ -816,23 +835,54 @@ static constexpr CTypeInfo kTypeInfoFloat64 = * returns true on success. `type_info` will be used for conversions. */ template -bool V8_EXPORT V8_WARN_UNUSED_RESULT TryCopyAndConvertArrayToCppBuffer( - Local src, T* dst, uint32_t max_length); +V8_DEPRECATE_SOON( + "Use TryToCopyAndConvertArrayToCppBuffer()") +bool V8_EXPORT V8_WARN_UNUSED_RESULT + TryCopyAndConvertArrayToCppBuffer(Local src, T* dst, + uint32_t max_length); template <> +V8_DEPRECATE_SOON( + "Use TryToCopyAndConvertArrayToCppBuffer()") inline bool V8_WARN_UNUSED_RESULT -TryCopyAndConvertArrayToCppBuffer<&kTypeInfoInt32, int32_t>( - Local src, int32_t* dst, uint32_t max_length) { - return CopyAndConvertArrayToCppBufferInt32(src, dst, max_length); + TryCopyAndConvertArrayToCppBuffer<&kTypeInfoInt32, int32_t>( + Local src, int32_t* dst, uint32_t max_length) { + return false; } template <> +V8_DEPRECATE_SOON( + "Use TryToCopyAndConvertArrayToCppBuffer()") inline bool V8_WARN_UNUSED_RESULT -TryCopyAndConvertArrayToCppBuffer<&kTypeInfoFloat64, double>( - Local src, double* dst, uint32_t max_length) { - return CopyAndConvertArrayToCppBufferFloat64(src, dst, max_length); + TryCopyAndConvertArrayToCppBuffer<&kTypeInfoFloat64, double>( + Local src, double* dst, uint32_t max_length) { + return false; } +template +bool V8_EXPORT V8_WARN_UNUSED_RESULT TryToCopyAndConvertArrayToCppBuffer( + Local src, T* dst, uint32_t max_length); + +template <> +bool V8_EXPORT V8_WARN_UNUSED_RESULT TryToCopyAndConvertArrayToCppBuffer< + internal::CTypeInfoBuilder::Build().GetId(), int32_t>( + Local src, int32_t* dst, uint32_t max_length); + +template <> +bool V8_EXPORT V8_WARN_UNUSED_RESULT TryToCopyAndConvertArrayToCppBuffer< + internal::CTypeInfoBuilder::Build().GetId(), uint32_t>( + Local src, uint32_t* dst, uint32_t max_length); + +template <> +bool V8_EXPORT V8_WARN_UNUSED_RESULT TryToCopyAndConvertArrayToCppBuffer< + internal::CTypeInfoBuilder::Build().GetId(), float>( + Local src, float* dst, uint32_t max_length); + +template <> +bool V8_EXPORT V8_WARN_UNUSED_RESULT TryToCopyAndConvertArrayToCppBuffer< + internal::CTypeInfoBuilder::Build().GetId(), double>( + Local src, double* dst, uint32_t max_length); + } // namespace v8 #endif // INCLUDE_V8_FAST_API_CALLS_H_ diff --git a/deps/v8/include/v8-forward.h b/deps/v8/include/v8-forward.h index ae16fe64b21477..db3a2017b7e5ee 100644 --- a/deps/v8/include/v8-forward.h +++ b/deps/v8/include/v8-forward.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef INCLUDE_V8_LOCAL_HANDLES_H_ -#define INCLUDE_V8_LOCAL_HANDLES_H_ +#ifndef INCLUDE_V8_FORWARD_H_ +#define INCLUDE_V8_FORWARD_H_ // This header is intended to be used by headers that pass around V8 types, // either by pointer or using Local. The full definitions can be included @@ -27,6 +27,7 @@ class Context; class DataView; class Data; class Date; +class Extension; class External; class FixedArray; class Float32Array; @@ -63,6 +64,7 @@ class StringObject; class Symbol; class SymbolObject; class Template; +class TryCatch; class TypedArray; class Uint16Array; class Uint32; @@ -76,4 +78,4 @@ class WasmModuleObject; } // namespace v8 -#endif // INCLUDE_V8_LOCAL_HANDLES_H_ +#endif // INCLUDE_V8_FORWARD_H_ diff --git a/deps/v8/include/v8-initialization.h b/deps/v8/include/v8-initialization.h index 3b609292f62ca1..7c9f26b89279d0 100644 --- a/deps/v8/include/v8-initialization.h +++ b/deps/v8/include/v8-initialization.h @@ -195,22 +195,38 @@ class V8_EXPORT V8 { * This must be invoked after the platform was initialized but before V8 is * initialized. The virtual memory cage is torn down during platform shutdown. * Returns true on success, false otherwise. + * + * TODO(saelo) Once it is no longer optional to create the virtual memory + * cage when compiling with V8_VIRTUAL_MEMORY_CAGE, the cage initialization + * will likely happen as part of V8::Initialize, at which point this function + * should be removed. */ static bool InitializeVirtualMemoryCage(); /** - * Provides access to the data page allocator for the virtual memory cage. + * Provides access to the virtual memory cage page allocator. + * + * This allocator allocates pages inside the virtual memory cage. It can for + * example be used to obtain virtual memory for ArrayBuffer backing stores, + * which must be located inside the cage. + * + * It should be assumed that an attacker can corrupt data inside the cage, + * and so in particular the contents of pages returned by this allocator, + * arbitrarily and concurrently. Due to this, it is recommended to to only + * place pure data buffers in pages obtained through this allocator. * - * This allocator allocates pages inside the data cage part of the virtual - * memory cage in which data buffers such as ArrayBuffer backing stores must - * be allocated. Objects in this region should generally consists purely of - * data and not contain any pointers. It should be assumed that an attacker - * can corrupt data inside the cage, and so in particular the contents of - * pages returned by this allocator, arbitrarily and concurrently. + * This function must only be called after initializing the virtual memory + * cage and V8. + */ + static PageAllocator* GetVirtualMemoryCagePageAllocator(); + + /** + * Returns the size of the virtual memory cage in bytes. * - * The virtual memory cage must have been initialized before. + * If the cage has not been initialized, or if the initialization failed, + * this returns zero. */ - static PageAllocator* GetVirtualMemoryCageDataPageAllocator(); + static size_t GetVirtualMemoryCageSizeInBytes(); #endif /** diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index 4a84fc066a848b..e1aee508bbceac 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -495,15 +495,10 @@ constexpr bool VirtualMemoryCageIsEnabled() { } #ifdef V8_VIRTUAL_MEMORY_CAGE -// Size of the pointer compression cage located at the start of the virtual -// memory cage. -constexpr size_t kVirtualMemoryCagePointerCageSize = - Internals::kPtrComprCageReservationSize; - // Size of the virtual memory cage, excluding the guard regions surrounding it. constexpr size_t kVirtualMemoryCageSize = size_t{1} << 40; // 1 TB -static_assert(kVirtualMemoryCageSize > kVirtualMemoryCagePointerCageSize, +static_assert(kVirtualMemoryCageSize > Internals::kPtrComprCageReservationSize, "The virtual memory cage must be larger than the pointer " "compression cage contained within it."); @@ -525,19 +520,21 @@ static_assert((kVirtualMemoryCageGuardRegionSize % "The size of the virtual memory cage guard region must be a " "multiple of its required alignment."); -// Minimum possible size of the virtual memory cage, excluding the guard regions -// surrounding it. Used by unit tests. -constexpr size_t kVirtualMemoryCageMinimumSize = - 2 * kVirtualMemoryCagePointerCageSize; +// Minimum size of the virtual memory cage, excluding the guard regions +// surrounding it. If the cage reservation fails, its size is currently halved +// until either the reservation succeeds or the minimum size is reached. A +// minimum of 32GB allows the 4GB pointer compression region as well as the +// ArrayBuffer partition and two 10GB WASM memory cages to fit into the cage. +constexpr size_t kVirtualMemoryCageMinimumSize = size_t{32} << 30; // 32 GB // For now, even if the virtual memory cage is enabled, we still allow backing // stores to be allocated outside of it as fallback. This will simplify the // initial rollout. However, if the heap sandbox is also enabled, we already use // the "enforcing mode" of the virtual memory cage. This is useful for testing. #ifdef V8_HEAP_SANDBOX -constexpr bool kAllowBackingStoresOutsideDataCage = false; +constexpr bool kAllowBackingStoresOutsideCage = false; #else -constexpr bool kAllowBackingStoresOutsideDataCage = true; +constexpr bool kAllowBackingStoresOutsideCage = true; #endif // V8_HEAP_SANDBOX #endif // V8_VIRTUAL_MEMORY_CAGE @@ -572,14 +569,6 @@ class BackingStoreBase {}; } // namespace internal -V8_EXPORT bool CopyAndConvertArrayToCppBufferInt32(Local src, - int32_t* dst, - uint32_t max_length); - -V8_EXPORT bool CopyAndConvertArrayToCppBufferFloat64(Local src, - double* dst, - uint32_t max_length); - } // namespace v8 #endif // INCLUDE_V8_INTERNAL_H_ diff --git a/deps/v8/include/v8-isolate.h b/deps/v8/include/v8-isolate.h index dc4af456b5e76f..39276b34a9d5b2 100644 --- a/deps/v8/include/v8-isolate.h +++ b/deps/v8/include/v8-isolate.h @@ -1482,6 +1482,9 @@ class V8_EXPORT Isolate { void SetWasmExceptionsEnabledCallback(WasmExceptionsEnabledCallback callback); + void SetWasmDynamicTieringEnabledCallback( + WasmDynamicTieringEnabledCallback callback); + void SetSharedArrayBufferConstructorEnabledCallback( SharedArrayBufferConstructorEnabledCallback callback); diff --git a/deps/v8/include/v8-locker.h b/deps/v8/include/v8-locker.h index b90fc5ed917d12..360022b7d9932c 100644 --- a/deps/v8/include/v8-locker.h +++ b/deps/v8/include/v8-locker.h @@ -64,7 +64,7 @@ class Isolate; * given thread. This can be useful if you have code that can be called either * from code that holds the lock or from code that does not. The Unlocker is * not recursive so you can not have several Unlockers on the stack at once, and - * you can not use an Unlocker in a thread that is not inside a Locker's scope. + * you cannot use an Unlocker in a thread that is not inside a Locker's scope. * * An unlocker will unlock several lockers if it has to and reinstate the * correct depth of locking on its destruction, e.g.: @@ -122,8 +122,13 @@ class V8_EXPORT Locker { static bool IsLocked(Isolate* isolate); /** - * Returns whether v8::Locker is being used by this V8 instance. + * Returns whether any v8::Locker has ever been used in this process. + * TODO(cbruni, chromium:1240851): Fix locking checks on a per-thread basis. + * The current implementation is quite confusing and leads to unexpected + * results if anybody uses v8::Locker in the current process. */ + static bool WasEverUsed(); + V8_DEPRECATE_SOON("Use WasEverUsed instead") static bool IsActive(); // Disallow copying and assigning. diff --git a/deps/v8/include/v8-message.h b/deps/v8/include/v8-message.h index 566d830e0da94f..be427e79cf21e0 100644 --- a/deps/v8/include/v8-message.h +++ b/deps/v8/include/v8-message.h @@ -7,6 +7,8 @@ #include +#include + #include "v8-local-handle.h" // NOLINT(build/include_directory) #include "v8-maybe.h" // NOLINT(build/include_directory) #include "v8config.h" // NOLINT(build/include_directory) @@ -210,8 +212,9 @@ class V8_EXPORT Message { bool IsSharedCrossOrigin() const; bool IsOpaque() const; - // TODO(1245381): Print to a string instead of on a FILE. + V8_DEPRECATE_SOON("Use the version that takes a std::ostream&.") static void PrintCurrentStackTrace(Isolate* isolate, FILE* out); + static void PrintCurrentStackTrace(Isolate* isolate, std::ostream& out); static const int kNoLineNumberInfo = 0; static const int kNoColumnInfo = 0; diff --git a/deps/v8/include/v8-template.h b/deps/v8/include/v8-template.h index b05639cfc1d543..96fcab6074cd14 100644 --- a/deps/v8/include/v8-template.h +++ b/deps/v8/include/v8-template.h @@ -27,6 +27,7 @@ class Signature; F(ArrayProto_forEach, array_for_each_iterator) \ F(ArrayProto_keys, array_keys_iterator) \ F(ArrayProto_values, array_values_iterator) \ + F(ArrayPrototype, initial_array_prototype) \ F(AsyncIteratorPrototype, initial_async_iterator_prototype) \ F(ErrorPrototype, initial_error_prototype) \ F(IteratorPrototype, initial_iterator_prototype) \ diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index b39e2dc20821f5..6078b78bd43d15 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -9,9 +9,9 @@ // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. #define V8_MAJOR_VERSION 9 -#define V8_MINOR_VERSION 5 -#define V8_BUILD_NUMBER 172 -#define V8_PATCH_LEVEL 25 +#define V8_MINOR_VERSION 6 +#define V8_BUILD_NUMBER 180 +#define V8_PATCH_LEVEL 14 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index f80c637634d41c..e3afd9787b9e93 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -88,11 +88,10 @@ 'V8 Win64 - debug': 'debug_x64_minimal_symbols', 'V8 Win64 - msvc': 'release_x64_msvc', # Mac. - 'V8 Mac64': 'release_x64', - 'V8 Mac64 - debug': 'debug_x64', + 'V8 Mac64 - builder': 'release_x64', + 'V8 Mac64 - debug builder': 'debug_x64', 'V8 Official Mac ARM64': 'release_arm64', 'V8 Official Mac ARM64 Debug': 'debug_arm64', - 'V8 Mac64 GC Stress': 'debug_x64', 'V8 Mac64 ASAN': 'release_x64_asan_no_lsan', 'V8 Mac - arm64 - release builder': 'release_arm64', 'V8 Mac - arm64 - debug builder': 'debug_arm64', @@ -108,6 +107,7 @@ 'V8 Linux gcc': 'release_x86_gcc', # FYI. 'V8 iOS - sim': 'release_x64_ios_simulator', + 'V8 Linux64 - arm64 - sim - heap sandbox - debug - builder': 'debug_x64_heap_sandbox_arm64_sim', 'V8 Linux64 - cppgc-non-default - debug - builder': 'debug_x64_non_default_cppgc', 'V8 Linux64 - debug - perfetto - builder': 'debug_x64_perfetto', 'V8 Linux64 - disable runtime call stats': 'release_x64_disable_runtime_call_stats', @@ -232,6 +232,7 @@ 'v8_linux64_gcov_coverage': 'release_x64_gcc_coverage', 'v8_linux64_header_includes_dbg': 'debug_x64_header_includes', 'v8_linux64_heap_sandbox_dbg_ng': 'debug_x64_heap_sandbox', + 'v8_linux_arm64_sim_heap_sandbox_dbg_ng': 'debug_x64_heap_sandbox_arm64_sim', 'v8_linux64_fyi_rel_ng': 'release_x64_test_features_trybot', 'v8_linux64_nodcheck_rel_ng': 'release_x64', 'v8_linux64_perfetto_dbg_ng': 'debug_x64_perfetto', @@ -573,6 +574,8 @@ 'debug_bot', 'x64', 'v8_check_header_includes'], 'debug_x64_heap_sandbox': [ 'debug_bot', 'x64', 'v8_enable_heap_sandbox'], + 'debug_x64_heap_sandbox_arm64_sim': [ + 'debug_bot', 'simulate_arm64', 'v8_enable_heap_sandbox'], 'debug_x64_minimal_symbols': [ 'debug_bot', 'x64', 'minimal_symbols'], 'debug_x64_non_default_cppgc': [ @@ -805,7 +808,7 @@ }, 'reclient': { - 'gn_args': 'use_rbe=true', + 'gn_args': 'use_rbe=true use_remoteexec=true', }, 'release': { diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl index abdadb9af9c93b..f17f651212954b 100644 --- a/deps/v8/infra/testing/builders.pyl +++ b/deps/v8/infra/testing/builders.pyl @@ -593,6 +593,14 @@ {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 12}, ], }, + 'v8_linux_arm64_sim_heap_sandbox_dbg_ng_triggered': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 14}, + ], + }, 'v8_linux_arm64_rel_ng_triggered': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -1889,6 +1897,19 @@ }, ], }, + 'V8 Linux64 - arm64 - sim - heap sandbox - debug': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'swarming_task_attrs': { + 'expiration': 14400, + 'hard_timeout': 7200, + 'priority': 35, + }, + 'tests': [ + {'name': 'v8testing', 'shards': 14}, + ], + }, 'V8 Linux - loong64 - sim': { 'swarming_dimensions': { 'os': 'Ubuntu-18.04', @@ -2027,136 +2048,15 @@ '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_dimensions': { - 'os': 'Ubuntu-18.04', - }, - 'swarming_task_attrs': { - 'expiration': 13800, - 'hard_timeout': 4200, - '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': '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 - staging': { - 'swarming_dimensions': { - 'os': 'Ubuntu-18.04', - }, - 'swarming_task_attrs': { - 'expiration': 13800, - 'hard_timeout': 4200, - 'priority': 35, - }, - 'tests': [ - { - 'name': 'numfuzz', - 'suffix': 'deopt', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-deopt=1'] - }, - ], - }, - 'V8 NumFuzz - TSAN - staging': { - 'swarming_dimensions': { - 'os': 'Ubuntu-18.04', - }, - 'swarming_task_attrs': { - 'expiration': 13800, - 'hard_timeout': 4200, - 'priority': 35, - }, - 'tests': [ - {'name': 'd8testing_random_gc', 'shards': 2}, - { - 'name': 'numfuzz', - 'suffix': 'marking', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-marking=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'delay', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-delay-tasks=1'] - }, - { - 'name': 'numfuzz', - 'suffix': 'threads', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-thread-pool-size=1'] - }, { 'name': 'numfuzz', 'suffix': 'stack', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-stack-size=1'] + 'test_args': ['--total-timeout-sec=2100', '--stress-stack-size=1'] }, { 'name': 'numfuzz', 'suffix': 'combined', 'test_args': [ - '--infra-staging', '--total-timeout-sec=2100', '--stress-delay-tasks=4', '--stress-deopt=2', @@ -2172,11 +2072,11 @@ { 'name': 'numfuzz', 'suffix': 'scavenge', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-scavenge=1'] + 'test_args': ['--total-timeout-sec=2100', '--stress-scavenge=1'] }, ], }, - 'V8 NumFuzz - debug - staging': { + 'V8 NumFuzz - debug': { 'swarming_dimensions': { 'os': 'Ubuntu-18.04', }, @@ -2190,29 +2090,28 @@ { 'name': 'numfuzz', 'suffix': 'marking', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-marking=1'], + 'test_args': ['--total-timeout-sec=2100', '--stress-marking=1'], 'shards': 2 }, { 'name': 'numfuzz', 'suffix': 'delay', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-delay-tasks=1'] + 'test_args': ['--total-timeout-sec=2100', '--stress-delay-tasks=1'] }, { 'name': 'numfuzz', 'suffix': 'threads', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-thread-pool-size=1'] + 'test_args': ['--total-timeout-sec=2100', '--stress-thread-pool-size=1'] }, { 'name': 'numfuzz', 'suffix': 'stack', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-stack-size=1'] + 'test_args': ['--total-timeout-sec=2100', '--stress-stack-size=1'] }, { 'name': 'numfuzz', 'suffix': 'combined', 'test_args': [ - '--infra-staging', '--total-timeout-sec=2100', '--stress-delay-tasks=4', '--stress-deopt=2', @@ -2228,12 +2127,12 @@ { 'name': 'numfuzz', 'suffix': 'scavenge', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-scavenge=1'] + 'test_args': ['--total-timeout-sec=2100', '--stress-scavenge=1'] }, { 'name': 'numfuzz', 'suffix': 'deopt', - 'test_args': ['--infra-staging', '--total-timeout-sec=2100', '--stress-deopt=1'], + 'test_args': ['--total-timeout-sec=2100', '--stress-deopt=1'], 'shards': 2 }, ], @@ -2242,33 +2141,18 @@ 'swarming_dimensions': { 'os': 'Ubuntu-18.04', }, - 'swarming_task_attrs': { - 'expiration': 13800, - 'hard_timeout': 4200, - 'priority': 35, - }, 'tests': [ { 'name': 'numfuzz', 'suffix': 'deopt', 'test_args': ['--total-timeout-sec=900', '--stress-deopt=1'] }, - { - 'name': 'numfuzz', - 'suffix': 'deopt-staging', - 'test_args': ['--infra-staging', '--total-timeout-sec=900', '--stress-deopt=1'] - }, ], }, 'v8_numfuzz_tsan_ng_triggered': { 'swarming_dimensions': { 'os': 'Ubuntu-18.04', }, - 'swarming_task_attrs': { - 'expiration': 13800, - 'hard_timeout': 4200, - 'priority': 35, - }, 'tests': [ { 'name': 'numfuzz', @@ -2287,23 +2171,13 @@ }, { 'name': 'numfuzz', - 'suffix': 'combined', - 'test_args': [ - '--total-timeout-sec=900', - '--stress-delay-tasks=4', - '--stress-deopt=2', - '--stress-compaction=2', - '--stress-gc=4', - '--stress-marking=4', - '--stress-scavenge=4', - '--stress-thread-pool-size=2', - ], + 'suffix': 'stack', + 'test_args': ['--total-timeout-sec=900', '--stress-stack-size=1'] }, { 'name': 'numfuzz', - 'suffix': 'combined-staging', + 'suffix': 'combined', 'test_args': [ - '--infra-staging', '--total-timeout-sec=900', '--stress-delay-tasks=4', '--stress-deopt=2', @@ -2312,6 +2186,7 @@ '--stress-marking=4', '--stress-scavenge=4', '--stress-thread-pool-size=2', + '--stress-stack-size=1', ], }, { @@ -2325,13 +2200,7 @@ 'swarming_dimensions': { 'os': 'Ubuntu-18.04', }, - 'swarming_task_attrs': { - 'expiration': 13800, - 'hard_timeout': 4200, - 'priority': 35, - }, 'tests': [ - {'name': 'd8testing_random_gc'}, { 'name': 'numfuzz', 'suffix': 'marking', @@ -2349,23 +2218,13 @@ }, { 'name': 'numfuzz', - 'suffix': 'combined', - 'test_args': [ - '--total-timeout-sec=900', - '--stress-delay-tasks=4', - '--stress-deopt=2', - '--stress-compaction=2', - '--stress-gc=4', - '--stress-marking=4', - '--stress-scavenge=4', - '--stress-thread-pool-size=2', - ], + 'suffix': 'stack', + 'test_args': ['--total-timeout-sec=900', '--stress-stack-size=1'] }, { 'name': 'numfuzz', - 'suffix': 'combined-staging', + 'suffix': 'combined', 'test_args': [ - '--infra-staging', '--total-timeout-sec=900', '--stress-delay-tasks=4', '--stress-deopt=2', @@ -2374,6 +2233,7 @@ '--stress-marking=4', '--stress-scavenge=4', '--stress-thread-pool-size=2', + '--stress-stack-size=1', ], }, { diff --git a/deps/v8/samples/shell.cc b/deps/v8/samples/shell.cc index 933f1385422f04..ab8abeb71e36f0 100644 --- a/deps/v8/samples/shell.cc +++ b/deps/v8/samples/shell.cc @@ -381,8 +381,8 @@ void ReportException(v8::Isolate* isolate, v8::TryCatch* try_catch) { stack_trace_string->IsString() && stack_trace_string.As()->Length() > 0) { v8::String::Utf8Value stack_trace(isolate, stack_trace_string); - const char* stack_trace_string = ToCString(stack_trace); - fprintf(stderr, "%s\n", stack_trace_string); + const char* err = ToCString(stack_trace); + fprintf(stderr, "%s\n", err); } } } diff --git a/deps/v8/src/api/api-inl.h b/deps/v8/src/api/api-inl.h index c5c774800b77ac..c033c3d2e8f947 100644 --- a/deps/v8/src/api/api-inl.h +++ b/deps/v8/src/api/api-inl.h @@ -264,12 +264,12 @@ void CopyDoubleElementsToTypedBuffer(T* dst, uint32_t length, } } -template +template bool CopyAndConvertArrayToCppBuffer(Local src, T* dst, uint32_t max_length) { static_assert( - std::is_same< - T, typename i::CTypeInfoTraitsGetType()>::ctype>::value, + std::is_same::ctype>::value, "Type mismatch between the expected CTypeInfo::Type and the destination " "array"); @@ -299,11 +299,20 @@ bool CopyAndConvertArrayToCppBuffer(Local src, T* dst, } } +// Deprecated; to be removed. template inline bool V8_EXPORT TryCopyAndConvertArrayToCppBuffer(Local src, T* dst, uint32_t max_length) { - return CopyAndConvertArrayToCppBuffer(src, dst, max_length); + return CopyAndConvertArrayToCppBufferGetId(), T>(src, dst, + max_length); +} + +template +inline bool V8_EXPORT TryToCopyAndConvertArrayToCppBuffer(Local src, + T* dst, + uint32_t max_length) { + return CopyAndConvertArrayToCppBuffer(src, dst, max_length); } namespace internal { diff --git a/deps/v8/src/api/api.cc b/deps/v8/src/api/api.cc index 8dcfe8a5a67415..f79d0482ed3f1b 100644 --- a/deps/v8/src/api/api.cc +++ b/deps/v8/src/api/api.cc @@ -7,6 +7,7 @@ #include // For min #include // For isnan. #include +#include #include #include // For move #include @@ -107,7 +108,6 @@ #include "src/profiler/heap-snapshot-generator-inl.h" #include "src/profiler/profile-generator-inl.h" #include "src/profiler/tick-sample.h" -#include "src/regexp/regexp-stack.h" #include "src/regexp/regexp-utils.h" #include "src/runtime/runtime.h" #include "src/snapshot/code-serializer.h" @@ -407,7 +407,7 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { } private: - PageAllocator* page_allocator_ = internal::GetPlatformDataCagePageAllocator(); + PageAllocator* page_allocator_ = internal::GetArrayBufferPageAllocator(); const size_t page_size_ = page_allocator_->AllocatePageSize(); }; @@ -947,7 +947,7 @@ void HandleScope::Initialize(Isolate* isolate) { // We make an exception if the serializer is enabled, which means that the // Isolate is exclusively used to create a snapshot. Utils::ApiCheck( - !v8::Locker::IsActive() || + !v8::Locker::WasEverUsed() || internal_isolate->thread_manager()->IsLockedByCurrentThread() || internal_isolate->serializer_enabled(), "HandleScope::HandleScope", @@ -2533,7 +2533,7 @@ MaybeLocal