diff --git a/.gitignore b/.gitignore index 4482ec08f6..b35b5d0b1b 100644 --- a/.gitignore +++ b/.gitignore @@ -68,6 +68,7 @@ /third_party/jsoncpp/source !/third_party/colorama /third_party/colorama/src +!/third_party/glibc !/third_party/googletest /third_party/googletest/src !/third_party/test262-harness diff --git a/.vpython3 b/.vpython3 index 50fab3bb51..1187542f5e 100644 --- a/.vpython3 +++ b/.vpython3 @@ -47,7 +47,7 @@ wheel: < wheel: < name: "infra/python/wheels/coverage/${vpython_platform}" - version: "version:5.5.chromium.2" + version: "version:5.5.chromium.3" > wheel: < @@ -74,3 +74,8 @@ wheel: < name: "infra/python/wheels/protobuf-py3" version: "version:3.19.3" > + +wheel: < + name: "infra/python/wheels/requests-py2_py3" + version: "version:2.13.0" +> diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py index 6d79c46245..793beda795 100644 --- a/.ycm_extra_conf.py +++ b/.ycm_extra_conf.py @@ -42,7 +42,6 @@ import sys # Flags from YCM's default config. flags = [ '-DUSE_CLANG_COMPLETER', -'-std=gnu++14', '-x', 'c++', ] @@ -143,25 +142,27 @@ def GetClangCommandFromNinjaForFilename(v8_root, filename): # Parse flags that are important for YCM's purposes. for flag in clang_line.split(' '): if flag.startswith('-I'): - # Relative paths need to be resolved, because they're relative to the - # output dir, not the source. - if flag[2] == '/': - v8_flags.append(flag) - else: - abs_path = os.path.normpath(os.path.join(out_dir, flag[2:])) - v8_flags.append('-I' + abs_path) - elif flag.startswith('-std'): + v8_flags.append(MakeIncludePathAbsolute(flag, "-I", out_dir)) + elif flag.startswith('-isystem'): + v8_flags.append(MakeIncludePathAbsolute(flag, "-isystem", out_dir)) + elif flag.startswith('-std') or flag.startswith( + '-pthread') or flag.startswith('-no'): v8_flags.append(flag) - elif flag.startswith('-') and flag[1] in 'DWFfmO': - if flag == '-Wno-deprecated-register' or flag == '-Wno-header-guard': - # These flags causes libclang (3.3) to crash. Remove it until things - # are fixed. - continue + elif flag.startswith('-') and flag[1] in 'DWFfmgOX': v8_flags.append(flag) - return v8_flags +def MakeIncludePathAbsolute(flag, prefix, out_dir): + # Relative paths need to be resolved, because they're relative to the + # output dir, not the source. + if flag[len(prefix)] == '/': + return flag + else: + abs_path = os.path.normpath(os.path.join(out_dir, flag[len(prefix):])) + return prefix + abs_path + + def FlagsForFile(filename): """This is the main entry point for YCM. Its interface is fixed. @@ -180,3 +181,9 @@ def FlagsForFile(filename): 'flags': final_flags, 'do_cache': True } + + +def Settings(**kwargs): + if kwargs['language'] == 'cfamily': + return FlagsForFile(kwargs['filename']) + return {} diff --git a/AUTHORS b/AUTHORS index 6ac1e3a1a2..7a3bf83ea4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -44,6 +44,7 @@ CodeWeavers, Inc. <*@codeweavers.com> Alibaba, Inc. <*@alibaba-inc.com> SiFive, Inc. <*@sifive.com> +Aapo Alasuutari Aaron Bieber Aaron O'Mullan Abdulla Kamar @@ -60,6 +61,7 @@ Allan Sandfeld Jensen Amos Lim Andreas Anyuru Andrei Kashcha +Andreu Botella Andrew Paprocki Anna Henningsen Antoine du Hamel @@ -113,6 +115,7 @@ Fedor Indutny Felix Geisendörfer Feng Yu Filipe David Manana +Frank Lemanschik Franziska Hinkelmann Gao Sheng Geoffrey Garside @@ -136,6 +139,7 @@ Ingvar Stepanyan Ioseb Dzmanashvili Isiah Meadows Jaime Bernardo +Jake Hughes James M Snell James Pike Jan Krems @@ -150,6 +154,7 @@ Jiaxun Yang Joel Stanley Johan Bergström Jonathan Liu +Juan Arboleda Julien Brianceau JunHo Seo Junha Park @@ -208,6 +213,7 @@ Peter Rybin Peter Varga Peter Wong PhistucK +Pierrick Bouvier Rafal Krypa Raul Tambre Ray Glover @@ -254,6 +260,7 @@ Vlad Burlik Vladimir Krivosheev Vladimir Shutoff Wael Almattar +WANG Xuerui Wei Wu Wenlu Wang Wenming Yang @@ -279,3 +286,4 @@ Zheng Liu Zhongping Wang 柳荣一 Yang Xiang +Kotaro Ohsugi diff --git a/BUILD.bazel b/BUILD.bazel index 4e89f90e7e..9730021294 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -39,6 +39,7 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression # v8_enable_trace_baseline_exec # v8_enable_trace_feedback_updates # v8_enable_atomic_object_field_writes +# v8_enable_conservative_stack_scanning # v8_enable_concurrent_marking # v8_enable_ignition_dispatch_counting # v8_enable_builtins_profiling @@ -131,6 +132,8 @@ v8_flag(name = "v8_enable_snapshot_code_comments") v8_flag(name = "v8_enable_snapshot_native_code_counters") +v8_flag(name = "v8_enable_static_roots") + v8_flag(name = "v8_enable_trace_maps") v8_flag(name = "v8_enable_v8_checks") @@ -315,6 +318,7 @@ v8_config( "v8_enable_slow_dchecks": "ENABLE_SLOW_DCHECKS", "v8_enable_runtime_call_stats": "V8_RUNTIME_CALL_STATS", "v8_enable_snapshot_native_code_counters": "V8_SNAPSHOT_NATIVE_CODE_COUNTERS", + "v8_enable_static_roots": "V8_STATIC_ROOTS", "v8_enable_trace_maps": "V8_TRACE_MAPS", "v8_enable_v8_checks": "V8_ENABLE_CHECKS", "v8_enable_verify_csa": "ENABLE_VERIFY_CSA", @@ -324,7 +328,6 @@ v8_config( }, defines = [ "GOOGLE3", - "ENABLE_DEBUGGER_SUPPORT", "V8_ADVANCED_BIGINT_ALGORITHMS", "V8_CONCURRENT_MARKING", ] + select({ @@ -891,6 +894,7 @@ filegroup( "src/builtins/typed-array-sort.tq", "src/builtins/typed-array-subarray.tq", "src/builtins/typed-array-to-reversed.tq", + "src/builtins/typed-array-to-sorted.tq", "src/builtins/typed-array-values.tq", "src/builtins/typed-array-with.tq", "src/builtins/typed-array.tq", @@ -925,6 +929,7 @@ filegroup( "src/objects/js-objects.tq", "src/objects/js-promise.tq", "src/objects/js-proxy.tq", + "src/objects/js-raw-json.tq", "src/objects/js-regexp-string-iterator.tq", "src/objects/js-regexp.tq", "src/objects/js-shadow-realm.tq", @@ -960,6 +965,7 @@ filegroup( "src/objects/templates.tq", "src/objects/torque-defined-classes.tq", "src/objects/turbofan-types.tq", + "src/objects/turboshaft-types.tq", "test/torque/test-torque.tq", "third_party/v8/builtins/array-sort.tq", ] + select({ @@ -980,6 +986,7 @@ filegroup( "src/objects/js-collator.tq", "src/objects/js-date-time-format.tq", "src/objects/js-display-names.tq", + "src/objects/js-duration-format.tq", "src/objects/js-list-format.tq", "src/objects/js-locale.tq", "src/objects/js-number-format.tq", @@ -1241,6 +1248,7 @@ filegroup( "src/common/message-template.h", "src/common/operation.h", "src/common/ptr-compr-inl.h", + "src/common/ptr-compr.cc", "src/common/ptr-compr.h", "src/compiler-dispatcher/lazy-compile-dispatcher.cc", "src/compiler-dispatcher/lazy-compile-dispatcher.h", @@ -1267,8 +1275,6 @@ filegroup( "src/debug/debug-scopes.h", "src/debug/debug-stack-trace-iterator.cc", "src/debug/debug-stack-trace-iterator.h", - "src/debug/debug-type-profile.cc", - "src/debug/debug-type-profile.h", "src/debug/debug.cc", "src/debug/debug.h", "src/debug/interface-types.h", @@ -1380,6 +1386,8 @@ filegroup( "src/handles/global-handles-inl.h", "src/handles/global-handles.cc", "src/handles/global-handles.h", + "src/handles/traced-handles.cc", + "src/handles/traced-handles.h", "src/handles/handles-inl.h", "src/handles/handles.cc", "src/handles/handles.h", @@ -1425,6 +1433,8 @@ filegroup( "src/heap/cppgc-js/cpp-marking-state-inl.h", "src/heap/cppgc-js/cpp-snapshot.cc", "src/heap/cppgc-js/cpp-snapshot.h", + "src/heap/cppgc-js/cross-heap-remembered-set.cc", + "src/heap/cppgc-js/cross-heap-remembered-set.h", "src/heap/cppgc-js/unified-heap-marking-state.cc", "src/heap/cppgc-js/unified-heap-marking-state.h", "src/heap/cppgc-js/unified-heap-marking-state-inl.h", @@ -1435,6 +1445,9 @@ filegroup( "src/heap/embedder-tracing.cc", "src/heap/embedder-tracing.h", "src/heap/embedder-tracing-inl.h", + "src/heap/evacuation-verifier.cc", + "src/heap/evacuation-verifier.h", + "src/heap/evacuation-verifier-inl.h", "src/heap/factory-base.cc", "src/heap/factory-base.h", "src/heap/factory-base-inl.h", @@ -1452,8 +1465,6 @@ filegroup( "src/heap/gc-tracer.cc", "src/heap/gc-tracer-inl.h", "src/heap/gc-tracer.h", - "src/heap/global-handle-marking-visitor.cc", - "src/heap/global-handle-marking-visitor.h", "src/heap/heap-allocator-inl.h", "src/heap/heap-allocator.cc", "src/heap/heap-allocator.h", @@ -1497,6 +1508,8 @@ filegroup( "src/heap/marking-barrier.cc", "src/heap/marking-barrier.h", "src/heap/marking-barrier-inl.h", + "src/heap/marking-state.h", + "src/heap/marking-state-inl.h", "src/heap/marking-visitor-inl.h", "src/heap/marking-visitor.h", "src/heap/marking-worklist-inl.h", @@ -1529,6 +1542,9 @@ filegroup( "src/heap/paged-spaces.h", "src/heap/parallel-work-item.h", "src/heap/parked-scope.h", + "src/heap/pretenuring-handler-inl.h", + "src/heap/pretenuring-handler.cc", + "src/heap/pretenuring-handler.h", "src/heap/progress-bar.h", "src/heap/read-only-heap-inl.h", "src/heap/read-only-heap.cc", @@ -1555,6 +1571,8 @@ filegroup( "src/heap/stress-scavenge-observer.h", "src/heap/sweeper.cc", "src/heap/sweeper.h", + "src/heap/traced-handles-marking-visitor.cc", + "src/heap/traced-handles-marking-visitor.h", "src/heap/weak-object-worklists.cc", "src/heap/weak-object-worklists.h", "src/ic/call-optimization.cc", @@ -1753,6 +1771,9 @@ filegroup( "src/objects/js-promise.h", "src/objects/js-proxy-inl.h", "src/objects/js-proxy.h", + "src/objects/js-raw-json-inl.h", + "src/objects/js-raw-json.h", + "src/objects/js-raw-json.cc", "src/objects/js-regexp-inl.h", "src/objects/js-regexp-string-iterator-inl.h", "src/objects/js-regexp-string-iterator.h", @@ -1900,6 +1921,8 @@ filegroup( "src/objects/transitions.h", "src/objects/turbofan-types-inl.h", "src/objects/turbofan-types.h", + "src/objects/turboshaft-types-inl.h", + "src/objects/turboshaft-types.h", "src/objects/type-hints.cc", "src/objects/type-hints.h", "src/objects/value-serializer.cc", @@ -1951,6 +1974,7 @@ filegroup( "src/profiler/heap-snapshot-generator-inl.h", "src/profiler/heap-snapshot-generator.cc", "src/profiler/heap-snapshot-generator.h", + "src/profiler/output-stream-writer.h", "src/profiler/profile-generator-inl.h", "src/profiler/profile-generator.cc", "src/profiler/profile-generator.h", @@ -1978,8 +2002,6 @@ filegroup( "src/regexp/experimental/experimental-interpreter.h", "src/regexp/experimental/experimental.cc", "src/regexp/experimental/experimental.h", - "src/regexp/property-sequences.cc", - "src/regexp/property-sequences.h", "src/regexp/regexp-ast.cc", "src/regexp/regexp-ast.h", "src/regexp/regexp-bytecode-generator-inl.h", @@ -2017,6 +2039,7 @@ filegroup( "src/roots/roots-inl.h", "src/roots/roots.cc", "src/roots/roots.h", + "src/roots/static-roots.h", "src/runtime/runtime-array.cc", "src/runtime/runtime-atomics.cc", "src/runtime/runtime-bigint.cc", @@ -2061,6 +2084,8 @@ filegroup( "src/sandbox/sandbox.h", "src/sandbox/sandboxed-pointer-inl.h", "src/sandbox/sandboxed-pointer.h", + "src/sandbox/bounded-size-inl.h", + "src/sandbox/bounded-size.h", "src/base/sanitizer/asan.h", "src/base/sanitizer/lsan-page-allocator.cc", "src/base/sanitizer/lsan-page-allocator.h", @@ -2527,8 +2552,8 @@ filegroup( "src/wasm/names-provider.cc", "src/wasm/names-provider.h", "src/wasm/object-access.h", - "src/wasm/signature-map.cc", - "src/wasm/signature-map.h", + "src/wasm/pgo.cc", + "src/wasm/pgo.h", "src/wasm/simd-shuffle.cc", "src/wasm/simd-shuffle.h", "src/wasm/stacks.cc", @@ -2606,6 +2631,9 @@ filegroup( "src/objects/js-display-names.cc", "src/objects/js-display-names.h", "src/objects/js-display-names-inl.h", + "src/objects/js-duration-format.cc", + "src/objects/js-duration-format.h", + "src/objects/js-duration-format-inl.h", "src/objects/js-list-format.cc", "src/objects/js-list-format.h", "src/objects/js-list-format-inl.h", @@ -2649,6 +2677,8 @@ filegroup( "src/compiler/all-nodes.h", "src/compiler/allocation-builder.h", "src/compiler/allocation-builder-inl.h", + "src/compiler/backend/bitcast-elider.cc", + "src/compiler/backend/bitcast-elider.h", "src/compiler/backend/code-generator.cc", "src/compiler/backend/code-generator.h", "src/compiler/backend/code-generator-impl.h", @@ -2861,7 +2891,10 @@ filegroup( "src/compiler/state-values-utils.h", "src/compiler/store-store-elimination.cc", "src/compiler/store-store-elimination.h", + "src/compiler/turboshaft/assembler.cc", "src/compiler/turboshaft/assembler.h", + "src/compiler/turboshaft/assert-types-reducer.h", + "src/compiler/turboshaft/branch-elimination-reducer.h", "src/compiler/turboshaft/decompression-optimization.cc", "src/compiler/turboshaft/decompression-optimization.h", "src/compiler/turboshaft/deopt-data.h", @@ -2870,17 +2903,36 @@ filegroup( "src/compiler/turboshaft/graph-builder.h", "src/compiler/turboshaft/graph.cc", "src/compiler/turboshaft/graph.h", + "src/compiler/turboshaft/index.h", "src/compiler/turboshaft/graph-visualizer.cc", "src/compiler/turboshaft/graph-visualizer.h", + "src/compiler/turboshaft/late-escape-analysis-reducer.h", + "src/compiler/turboshaft/late-escape-analysis-reducer.cc", + "src/compiler/turboshaft/layered-hash-map.h", + "src/compiler/turboshaft/machine-optimization-reducer.h", + "src/compiler/turboshaft/memory-optimization.cc", + "src/compiler/turboshaft/memory-optimization.h", "src/compiler/turboshaft/operations.cc", "src/compiler/turboshaft/operations.h", + "src/compiler/turboshaft/operation-matching.h", "src/compiler/turboshaft/optimization-phase.cc", "src/compiler/turboshaft/optimization-phase.h", "src/compiler/turboshaft/recreate-schedule.cc", "src/compiler/turboshaft/recreate-schedule.h", + "src/compiler/turboshaft/representations.cc", + "src/compiler/turboshaft/representations.h", + "src/compiler/turboshaft/select-lowering-reducer.h", "src/compiler/turboshaft/sidetable.h", + "src/compiler/turboshaft/simplify-tf-loops.cc", + "src/compiler/turboshaft/simplify-tf-loops.h", + "src/compiler/turboshaft/snapshot-table.h", + "src/compiler/turboshaft/type-inference-reducer.h", + "src/compiler/turboshaft/types.cc", + "src/compiler/turboshaft/types.h", + "src/compiler/turboshaft/utils.cc", "src/compiler/turboshaft/utils.h", - "src/compiler/turboshaft/value-numbering-assembler.h", + "src/compiler/turboshaft/value-numbering-reducer.h", + "src/compiler/turboshaft/variable-reducer.h", "src/compiler/type-cache.cc", "src/compiler/type-cache.h", "src/compiler/type-narrowing-reducer.cc", @@ -2891,6 +2943,7 @@ filegroup( "src/compiler/typer.h", "src/compiler/types.cc", "src/compiler/types.h", + "src/compiler/use-info.h", "src/compiler/value-numbering-reducer.cc", "src/compiler/value-numbering-reducer.h", "src/compiler/verifier.cc", @@ -2959,6 +3012,7 @@ filegroup( "src/builtins/builtins-microtask-queue-gen.cc", "src/builtins/builtins-number-gen.cc", "src/builtins/builtins-object-gen.cc", + "src/builtins/builtins-object-gen.h", "src/builtins/builtins-promise-gen.cc", "src/builtins/builtins-promise-gen.h", "src/builtins/builtins-proxy-gen.cc", @@ -3101,6 +3155,7 @@ filegroup( "src/heap/cppgc/stats-collector.h", "src/heap/cppgc/sweeper.cc", "src/heap/cppgc/sweeper.h", + "src/heap/cppgc/heap-config.h", "src/heap/cppgc/task-handle.h", "src/heap/cppgc/trace-event.h", "src/heap/cppgc/trace-trait.cc", @@ -3119,6 +3174,7 @@ filegroup( srcs = [ "src/heap/base/active-system-pages.cc", "src/heap/base/active-system-pages.h", + "src/heap/base/basic-slot-set.h", "src/heap/base/stack.cc", "src/heap/base/stack.h", "src/heap/base/worklist.cc", @@ -3127,16 +3183,16 @@ filegroup( # Note these cannot be v8_target_is_* selects because these contain # inline assembly that runs inside the executable. Since these are # linked directly into mksnapshot, they must use the actual target cpu. - "@v8//bazel/config:is_inline_asm_ia32": ["src/heap/base/asm/ia32/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_x64": ["src/heap/base/asm/x64/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_arm": ["src/heap/base/asm/arm/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_arm64": ["src/heap/base/asm/arm64/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_s390x": ["src/heap/base/asm/s390/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_riscv64": ["src/heap/base/asm/riscv64/push_registers_asm.cc"], - "@v8//bazel/config:is_inline_asm_ppc64le": ["src/heap/base/asm/ppc/push_registers_asm.cc"], - "@v8//bazel/config:is_msvc_asm_ia32": ["src/heap/base/asm/ia32/push_registers_masm.asm"], - "@v8//bazel/config:is_msvc_asm_x64": ["src/heap/base/asm/x64/push_registers_masm.asm"], - "@v8//bazel/config:is_msvc_asm_arm64": ["src/heap/base/asm/arm64/push_registers_masm.S"], + "@v8//bazel/config:is_inline_asm_ia32": ["src/heap/base/asm/ia32/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_x64": ["src/heap/base/asm/x64/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_arm": ["src/heap/base/asm/arm/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_arm64": ["src/heap/base/asm/arm64/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_s390x": ["src/heap/base/asm/s390/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_riscv64": ["src/heap/base/asm/riscv64/save_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_ppc64le": ["src/heap/base/asm/ppc/save_registers_asm.cc"], + "@v8//bazel/config:is_msvc_asm_ia32": ["src/heap/base/asm/ia32/save_registers_masm.asm"], + "@v8//bazel/config:is_msvc_asm_x64": ["src/heap/base/asm/x64/save_registers_masm.asm"], + "@v8//bazel/config:is_msvc_asm_arm64": ["src/heap/base/asm/arm64/save_registers_masm.S"], }), ) @@ -3182,6 +3238,8 @@ filegroup( "src/snapshot/embedded/platform-embedded-file-writer-mac.h", "src/snapshot/embedded/platform-embedded-file-writer-win.cc", "src/snapshot/embedded/platform-embedded-file-writer-win.h", + "src/snapshot/static-roots-gen.cc", + "src/snapshot/static-roots-gen.h", "src/snapshot/mksnapshot.cc", "src/snapshot/snapshot-empty.cc", ], @@ -3216,6 +3274,8 @@ filegroup( "src/inspector/v8-debugger.h", "src/inspector/v8-debugger-agent-impl.cc", "src/inspector/v8-debugger-agent-impl.h", + "src/inspector/v8-debugger-barrier.cc", + "src/inspector/v8-debugger-barrier.h", "src/inspector/v8-debugger-id.cc", "src/inspector/v8-debugger-id.h", "src/inspector/v8-debugger-script.cc", @@ -3516,12 +3576,14 @@ v8_mksnapshot( cc_library( name = "icu/generated_torque_headers", hdrs = [":icu/generated_torque_files"], + copts = ["-Wno-implicit-fallthrough"], strip_include_prefix = "icu", ) cc_library( name = "noicu/generated_torque_headers", hdrs = [":noicu/generated_torque_files"], + copts = ["-Wno-implicit-fallthrough"], strip_include_prefix = "noicu", ) @@ -3531,6 +3593,7 @@ v8_library( ":v8_libbase_files", ":v8_shared_internal_headers", ], + copts = ["-Wno-implicit-fallthrough"], ) cc_library( @@ -3539,6 +3602,7 @@ cc_library( "src/torque/kythe-data.h", "src/torque/torque-compiler.h", ], + copts = ["-Wno-implicit-fallthrough"], include_prefix = "third_party/v8", includes = ["."], ) @@ -3548,7 +3612,7 @@ cc_library( srcs = [ ":torque_base_files", ], - copts = select({ + copts = ["-Wno-implicit-fallthrough"] + select({ "@v8//bazel/config:is_posix": ["-fexceptions"], "//conditions:default": [], }), @@ -3565,6 +3629,7 @@ v8_library( ":v8_base_without_compiler_files", ":v8_common_libshared_files", ], + copts = ["-Wno-implicit-fallthrough"], icu_deps = [ ":icu/generated_torque_headers", "//external:icu", @@ -3590,6 +3655,7 @@ v8_library( name = "v8", srcs = [":v8_inspector_files"], hdrs = [":public_header_files"], + copts = ["-Wno-implicit-fallthrough"], icu_deps = [":icu/v8_libshared"], icu_srcs = [":icu/snapshot_files"], noicu_deps = [":noicu/v8_libshared"], @@ -3602,6 +3668,7 @@ v8_library( name = "wee8", srcs = [":wee8_files"], hdrs = [":public_wasm_c_api_header_files"], + copts = ["-Wno-implicit-fallthrough"], strip_include_prefix = "third_party", visibility = ["//visibility:public"], deps = [":noicu/v8"], @@ -3631,6 +3698,7 @@ v8_binary( "src/interpreter/bytecodes.cc", "src/interpreter/bytecodes.h", ], + copts = ["-Wno-implicit-fallthrough"], deps = ["v8_libbase"], ) @@ -3642,6 +3710,7 @@ v8_binary( ":v8_libbase_files", ":v8_shared_internal_headers", ], + copts = ["-Wno-implicit-fallthrough"], defines = [ "V8_INTL_SUPPORT", "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC", @@ -3660,7 +3729,7 @@ v8_binary( "src/torque/torque.cc", ":torque_base_files", ], - copts = select({ + copts = ["-Wno-implicit-fallthrough"] + select({ "@v8//bazel/config:is_posix": ["-fexceptions"], "//conditions:default": [], }), @@ -3675,6 +3744,7 @@ v8_binary( v8_binary( name = "mksnapshot", srcs = [":mksnapshot_files"], + copts = ["-Wno-implicit-fallthrough"], icu_deps = [":icu/v8_libshared"], linkopts = select({ "@v8//bazel/config:is_android": ["-llog"], @@ -3686,6 +3756,7 @@ v8_binary( v8_binary( name = "d8", srcs = [":d8_files"], + copts = ["-Wno-implicit-fallthrough"], icu_deps = [":icu/v8"], noicu_deps = [":noicu/v8"], ) diff --git a/BUILD.gn b/BUILD.gn index 43667839c5..19399e86e8 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -120,6 +120,9 @@ declare_args() { # as per the --native-code-counters flag. v8_enable_snapshot_native_code_counters = "" + # Use pre-generated static root pointer values from static-roots.h. + v8_enable_static_roots = false + # Enable code-generation-time checking of types in the CodeStubAssembler. v8_enable_verify_csa = false @@ -285,8 +288,11 @@ declare_args() { target_os == "fuchsia" # Enable control-flow integrity features, such as pointer authentication for - # ARM64. - v8_control_flow_integrity = false + # ARM64. Enable it by default for simulator builds and when native code + # supports it as well. + v8_control_flow_integrity = + v8_current_cpu == "arm64" && + (target_is_simulator || arm_control_flow_integrity != "none") # Enable heap reservation of size 4GB. Only possible for 64bit archs. cppgc_enable_caged_heap = @@ -307,9 +313,6 @@ declare_args() { # Sets -DV8_ENABLE_SANDBOX. v8_enable_sandbox = "" - # Enable all available sandbox features. Implies v8_enable_sandbox. - v8_enable_sandbox_future = false - # Expose the memory corruption API to JavaScript. Useful for testing the sandbox. # WARNING This will expose builtins that (by design) cause memory corruption. # Sets -DV8_EXPOSE_MEMORY_CORRUPTION_API @@ -373,6 +376,9 @@ declare_args() { # Compile V8 using zlib as dependency. # Sets -DV8_USE_ZLIB v8_use_zlib = true + + # Make ValueDeserializer crash if the data to deserialize is invalid. + v8_value_deserializer_hard_fail = false } # Derived defaults. @@ -418,6 +424,21 @@ if (v8_enable_pointer_compression == "") { v8_enable_pointer_compression = v8_current_cpu == "arm64" || v8_current_cpu == "x64" } + +# Toggle pointer compression for correctness fuzzing when building the +# clang_x64_pointer_compression toolchain. We'll correctness-compare the +# default build with the clang_x64_pointer_compression build. +if (v8_multi_arch_build && + rebase_path(get_label_info(":d8", "root_out_dir"), root_build_dir) == + "clang_x64_pointer_compression") { + v8_enable_pointer_compression = !v8_enable_pointer_compression +} + +# Ensure the sandbox is on/off in the same way as pointer compression for +# correctness fuzzing builds. +if (v8_multi_arch_build) { + v8_enable_sandbox = v8_enable_pointer_compression +} if (v8_enable_pointer_compression_shared_cage == "") { v8_enable_pointer_compression_shared_cage = v8_enable_pointer_compression } @@ -445,11 +466,26 @@ if (v8_enable_maglev == "") { } if (v8_builtins_profiling_log_file == "default") { v8_builtins_profiling_log_file = "" - if (is_debug == false) { - if (v8_current_cpu == "x64") { + + # Don't use existing profile when + # * generating a new one (i.e. v8_enable_builtins_profiling), + # * is_debug or dcheck_always_on because they add more checks to the + # builtins control flow which we don't want to generate, + # * v8_enable_webassembly because it changes the set of opcodes which affects + # graphs hashes, + # * !is_clang because it might affect argument evaluation order, which + # makes node IDs not predictable for subgraphs like Op1(Op2(), Op3()) and + # as a result different graph hash. + if (!v8_enable_builtins_profiling && is_clang && !is_debug && + !dcheck_always_on && v8_enable_webassembly) { + if ((v8_current_cpu == "x64" || v8_current_cpu == "arm64") && + v8_enable_pointer_compression && v8_enable_external_code_space) { + # Note, currently x64 profile can be applied to arm64 but not the other + # way round. v8_builtins_profiling_log_file = "tools/builtins-pgo/x64.profile" - } else if (v8_current_cpu == "arm64") { - v8_builtins_profiling_log_file = "tools/builtins-pgo/arm64.profile" + } else if (v8_current_cpu == "x86" || v8_current_cpu == "arm") { + # Note, x86 profile can be applied to arm but not the other way round. + v8_builtins_profiling_log_file = "tools/builtins-pgo/x86.profile" } } } @@ -481,31 +517,6 @@ assert(!v8_enable_trace_ignition || v8_enable_trace_unoptimized, assert(!v8_enable_trace_baseline_exec || v8_enable_trace_unoptimized, "Baseline tracing requires unoptimized tracing to be enabled.") -# Toggle pointer compression for correctness fuzzing when building the -# clang_x64_pointer_compression toolchain. We'll correctness-compare the -# default build with the clang_x64_pointer_compression build. -if (v8_multi_arch_build && - rebase_path(get_label_info(":d8", "root_out_dir"), root_build_dir) == - "clang_x64_pointer_compression") { - v8_enable_pointer_compression = !v8_enable_pointer_compression - v8_enable_pointer_compression_shared_cage = v8_enable_pointer_compression - v8_enable_external_code_space = v8_enable_pointer_compression -} - -# Ensure the sandbox is on/off in the same way as pointer compression for -# correctness fuzzing builds. -if (v8_multi_arch_build) { - v8_enable_sandbox = v8_enable_pointer_compression -} - -# Check if it is a Chromium build and activate PAC/BTI if needed. -# TODO(cavalcantii): have a single point of integration with PAC/BTI flags. -if (build_with_chromium && v8_current_cpu == "arm64" && - (arm_control_flow_integrity == "standard" || - arm_control_flow_integrity == "pac")) { - v8_control_flow_integrity = true -} - if (v8_enable_short_builtin_calls && (!v8_enable_pointer_compression && v8_current_cpu != "x64")) { # Disable short calls when pointer compression is not enabled, except x64, @@ -523,16 +534,26 @@ if (v8_enable_sandbox == "") { # once that is enabled everywhere by default. # TODO(chromium:1325784) the sandbox is not currently supported in Chromium # on Fuchsia. - v8_enable_sandbox = - build_with_chromium && v8_enable_pointer_compression_shared_cage && - v8_enable_external_code_space && target_os != "fuchsia" + v8_enable_sandbox = v8_enable_pointer_compression_shared_cage && + v8_enable_external_code_space && target_os != "fuchsia" } -# Enable all available sandbox features if sandbox future is enabled. -if (v8_enable_sandbox_future) { - v8_enable_sandbox = true +if (v8_enable_static_roots == "") { + # Static roots are only valid for builds with pointer compression and a + # shared ro heap. Also, non-wasm and non-i18n builds have fewer read-only + # roots. + v8_enable_static_roots = + v8_enable_pointer_compression && v8_enable_shared_ro_heap && + v8_enable_pointer_compression_shared_cage && v8_enable_webassembly && + v8_enable_i18n_support } +assert(!v8_enable_static_roots || + (v8_enable_pointer_compression && v8_enable_shared_ro_heap && + v8_enable_pointer_compression_shared_cage && + v8_enable_webassembly && v8_enable_i18n_support), + "Trying to enable static roots in a configuration that is not supported") + assert(!v8_disable_write_barriers || v8_enable_single_generation, "Disabling write barriers works only with single generation") @@ -1058,9 +1079,18 @@ config("features") { if (v8_enable_pointer_compression_8gb) { defines += [ "V8_COMPRESS_POINTERS_8GB" ] } + if (v8_enable_static_roots) { + defines += [ "V8_STATIC_ROOTS" ] + } if (v8_use_zlib) { defines += [ "V8_USE_ZLIB" ] } + if (v8_use_libm_trig_functions) { + defines += [ "V8_USE_LIBM_TRIG_FUNCTIONS" ] + } + if (v8_value_deserializer_hard_fail) { + defines += [ "V8_VALUE_DESERIALIZER_HARD_FAIL" ] + } } config("toolchain") { @@ -1104,64 +1134,17 @@ config("toolchain") { } if (v8_current_cpu == "arm64") { defines += [ "V8_TARGET_ARCH_ARM64" ] - if (current_cpu == "arm64") { - # This will enable PAC+BTI in code generation and static code. - if (v8_control_flow_integrity && - (!build_with_chromium || arm_control_flow_integrity == "standard")) { - cflags += [ "-mbranch-protection=standard" ] - asmflags = [ "-mmark-bti-property" ] - } else if (build_with_chromium && arm_control_flow_integrity == "pac") { - # This should enable PAC only in C++ code (and no CFI in runtime - # generated code). For details, see crbug.com/919548. - cflags += [ "-mbranch-protection=pac-ret" ] - asmflags = [ "-mbranch-protection=pac-ret" ] - } + if (current_cpu == "arm64" && v8_control_flow_integrity && is_clang) { + # Mark assembly code as BTI-compatible. + asmflags = [ "-mmark-bti-property" ] } } - # Mips64el/mipsel simulators. - if (target_is_simulator && - (v8_current_cpu == "mipsel" || v8_current_cpu == "mips64el")) { + # Mips64el simulators. + if (target_is_simulator && v8_current_cpu == "mips64el") { defines += [ "_MIPS_TARGET_SIMULATOR" ] } - if (v8_current_cpu == "mipsel" || v8_current_cpu == "mips") { - defines += [ "V8_TARGET_ARCH_MIPS" ] - if (v8_can_use_fpu_instructions) { - defines += [ "CAN_USE_FPU_INSTRUCTIONS" ] - } - if (v8_use_mips_abi_hardfloat) { - defines += [ - "__mips_hard_float=1", - "CAN_USE_FPU_INSTRUCTIONS", - ] - } else { - defines += [ "__mips_soft_float=1" ] - } - if (mips_arch_variant == "r6") { - defines += [ - "_MIPS_ARCH_MIPS32R6", - "FPU_MODE_FP64", - ] - if (mips_use_msa) { - defines += [ "_MIPS_MSA" ] - } - } else if (mips_arch_variant == "r2") { - defines += [ "_MIPS_ARCH_MIPS32R2" ] - if (mips_fpu_mode == "fp64") { - defines += [ "FPU_MODE_FP64" ] - } else if (mips_fpu_mode == "fpxx") { - defines += [ "FPU_MODE_FPXX" ] - } else if (mips_fpu_mode == "fp32") { - defines += [ "FPU_MODE_FP32" ] - } - } else if (mips_arch_variant == "r1") { - defines += [ "FPU_MODE_FP32" ] - } - - # TODO(infra): Add support for mips_arch_variant rx and loongson. - } - if (v8_current_cpu == "mips64el" || v8_current_cpu == "mips64") { defines += [ "V8_TARGET_ARCH_MIPS64" ] if (v8_can_use_fpu_instructions) { @@ -1335,6 +1318,7 @@ config("toolchain") { if (is_clang) { cflags += [ "-Wmissing-field-initializers", + "-Wunreachable-code", # Google3 enables this warning, so we should also enable it to find issue # earlier. See https://reviews.llvm.org/D56731 for details about this @@ -1345,11 +1329,6 @@ config("toolchain") { "-Wno-shadow", ] - if (v8_current_cpu != "mips" && v8_current_cpu != "mipsel") { - # We exclude MIPS because the IsMipsArchVariant macro causes trouble. - cflags += [ "-Wunreachable-code" ] - } - if (v8_current_cpu == "x64" || v8_current_cpu == "arm64" || v8_current_cpu == "mips64el" || v8_current_cpu == "riscv64") { cflags += [ "-Wshorten-64-to-32" ] @@ -1517,6 +1496,10 @@ config("toolchain") { "/wd4715", # 'function' : not all control paths return a value' # MSVC does not analyze switch (enum) for completeness. ] + + # TODO(https://crbug.com/1377771): Keep MSVC on C++17 until source code is + # made compatible with C++20. + cflags_cc = [ "/std:c++17" ] } if (!is_clang && !is_win) { @@ -1533,6 +1516,11 @@ config("toolchain") { # Disable gcc warnings for using enum constant in boolean context. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97266 "-Wno-int-in-bool-context", + + # Disable gcc deprecation warnings, which are firing on implicit capture + # of `this` in capture-by-value lambdas and preventing a build roll which + # enables C++20 (see https://crbug.com/1374227). + "-Wno-deprecated", ] } @@ -1609,8 +1597,7 @@ if (is_android && enable_java_templates) { if (v8_use_external_startup_data) { deps = [ "//v8" ] renaming_sources = [ "$root_out_dir/snapshot_blob.bin" ] - if (current_cpu == "arm" || current_cpu == "x86" || - current_cpu == "mipsel") { + if (current_cpu == "arm" || current_cpu == "x86") { renaming_destinations = [ "snapshot_blob_32.bin" ] } else { renaming_destinations = [ "snapshot_blob_64.bin" ] @@ -1620,90 +1607,95 @@ if (is_android && enable_java_templates) { } } -action("postmortem-metadata") { - # Only targets in this file and the top-level visibility target can - # depend on this. - visibility = [ - ":*", - "//:gn_visibility", - ] +if (v8_postmortem_support) { + action("postmortem-metadata") { + # Only targets in this file and the top-level visibility target can + # depend on this. + visibility = [ + ":*", + "//:gn_visibility", + ] - script = "tools/gen-postmortem-metadata.py" + script = "tools/gen-postmortem-metadata.py" - # NOSORT - sources = [ - "$target_gen_dir/torque-generated/instance-types.h", - "src/objects/allocation-site.h", - "src/objects/allocation-site-inl.h", - "src/objects/cell.h", - "src/objects/cell-inl.h", - "src/objects/code.h", - "src/objects/code-inl.h", - "src/objects/data-handler.h", - "src/objects/data-handler-inl.h", - "src/objects/descriptor-array.h", - "src/objects/descriptor-array-inl.h", - "src/objects/feedback-cell.h", - "src/objects/feedback-cell-inl.h", - "src/objects/fixed-array.h", - "src/objects/fixed-array-inl.h", - "src/objects/heap-number.h", - "src/objects/heap-number-inl.h", - "src/objects/heap-object.h", - "src/objects/heap-object-inl.h", - "src/objects/instance-type.h", - "src/objects/js-array-buffer.h", - "src/objects/js-array-buffer-inl.h", - "src/objects/js-array.h", - "src/objects/js-array-inl.h", - "src/objects/js-function-inl.h", - "src/objects/js-function.cc", - "src/objects/js-function.h", - "src/objects/js-objects.cc", - "src/objects/js-objects.h", - "src/objects/js-objects-inl.h", - "src/objects/js-promise.h", - "src/objects/js-promise-inl.h", - "src/objects/js-regexp.cc", - "src/objects/js-regexp.h", - "src/objects/js-regexp-inl.h", - "src/objects/js-regexp-string-iterator.h", - "src/objects/js-regexp-string-iterator-inl.h", - "src/objects/map.cc", - "src/objects/map.h", - "src/objects/map-inl.h", - "src/objects/megadom-handler.h", - "src/objects/megadom-handler-inl.h", - "src/objects/name.h", - "src/objects/name-inl.h", - "src/objects/objects.h", - "src/objects/objects-inl.h", - "src/objects/oddball.h", - "src/objects/oddball-inl.h", - "src/objects/primitive-heap-object.h", - "src/objects/primitive-heap-object-inl.h", - "src/objects/scope-info.h", - "src/objects/scope-info-inl.h", - "src/objects/script.h", - "src/objects/script-inl.h", - "src/objects/shared-function-info.cc", - "src/objects/shared-function-info.h", - "src/objects/shared-function-info-inl.h", - "src/objects/string.cc", - "src/objects/string-comparator.cc", - "src/objects/string-comparator.h", - "src/objects/string.h", - "src/objects/string-inl.h", - "src/objects/struct.h", - "src/objects/struct-inl.h", - ] + # NOSORT + sources = [ + "$target_gen_dir/torque-generated/instance-types.h", + "src/objects/allocation-site.h", + "src/objects/allocation-site-inl.h", + "src/objects/cell.h", + "src/objects/cell-inl.h", + "src/objects/code.h", + "src/objects/code-inl.h", + "src/objects/data-handler.h", + "src/objects/data-handler-inl.h", + "src/objects/descriptor-array.h", + "src/objects/descriptor-array-inl.h", + "src/objects/feedback-cell.h", + "src/objects/feedback-cell-inl.h", + "src/objects/fixed-array.h", + "src/objects/fixed-array-inl.h", + "src/objects/heap-number.h", + "src/objects/heap-number-inl.h", + "src/objects/heap-object.h", + "src/objects/heap-object-inl.h", + "src/objects/instance-type.h", + "src/objects/js-array-buffer.h", + "src/objects/js-array-buffer-inl.h", + "src/objects/js-array.h", + "src/objects/js-array-inl.h", + "src/objects/js-function-inl.h", + "src/objects/js-function.cc", + "src/objects/js-function.h", + "src/objects/js-objects.cc", + "src/objects/js-objects.h", + "src/objects/js-objects-inl.h", + "src/objects/js-promise.h", + "src/objects/js-promise-inl.h", + "src/objects/js-raw-json.cc", + "src/objects/js-raw-json.h", + "src/objects/js-raw-json-inl.h", + "src/objects/js-regexp.cc", + "src/objects/js-regexp.h", + "src/objects/js-regexp-inl.h", + "src/objects/js-regexp-string-iterator.h", + "src/objects/js-regexp-string-iterator-inl.h", + "src/objects/map.cc", + "src/objects/map.h", + "src/objects/map-inl.h", + "src/objects/megadom-handler.h", + "src/objects/megadom-handler-inl.h", + "src/objects/name.h", + "src/objects/name-inl.h", + "src/objects/objects.h", + "src/objects/objects-inl.h", + "src/objects/oddball.h", + "src/objects/oddball-inl.h", + "src/objects/primitive-heap-object.h", + "src/objects/primitive-heap-object-inl.h", + "src/objects/scope-info.h", + "src/objects/scope-info-inl.h", + "src/objects/script.h", + "src/objects/script-inl.h", + "src/objects/shared-function-info.cc", + "src/objects/shared-function-info.h", + "src/objects/shared-function-info-inl.h", + "src/objects/string.cc", + "src/objects/string-comparator.cc", + "src/objects/string-comparator.h", + "src/objects/string.h", + "src/objects/string-inl.h", + "src/objects/struct.h", + "src/objects/struct-inl.h", + ] - outputs = [ "$target_gen_dir/debug-support.cc" ] + outputs = [ "$target_gen_dir/debug-support.cc" ] - args = rebase_path(outputs, root_build_dir) + - rebase_path(sources, root_build_dir) + args = rebase_path(outputs, root_build_dir) + + rebase_path(sources, root_build_dir) - deps = [ ":run_torque" ] + deps = [ ":run_torque" ] + } } torque_files = [ @@ -1835,6 +1827,7 @@ torque_files = [ "src/builtins/typed-array-sort.tq", "src/builtins/typed-array-subarray.tq", "src/builtins/typed-array-to-reversed.tq", + "src/builtins/typed-array-to-sorted.tq", "src/builtins/typed-array-values.tq", "src/builtins/typed-array-with.tq", "src/builtins/typed-array.tq", @@ -1869,6 +1862,7 @@ torque_files = [ "src/objects/js-objects.tq", "src/objects/js-promise.tq", "src/objects/js-proxy.tq", + "src/objects/js-raw-json.tq", "src/objects/js-regexp-string-iterator.tq", "src/objects/js-regexp.tq", "src/objects/js-shadow-realm.tq", @@ -1904,6 +1898,7 @@ torque_files = [ "src/objects/templates.tq", "src/objects/torque-defined-classes.tq", "src/objects/turbofan-types.tq", + "src/objects/turboshaft-types.tq", "test/torque/test-torque.tq", "third_party/v8/builtins/array-sort.tq", ] @@ -1915,6 +1910,7 @@ if (v8_enable_i18n_support) { "src/objects/js-collator.tq", "src/objects/js-date-time-format.tq", "src/objects/js-display-names.tq", + "src/objects/js-duration-format.tq", "src/objects/js-list-format.tq", "src/objects/js-locale.tq", "src/objects/js-number-format.tq", @@ -2202,6 +2198,10 @@ template("run_mksnapshot") { "--turbo-profiling-input", rebase_path(v8_builtins_profiling_log_file, root_build_dir), ] + + # Replace this with --warn-about-builtin-profile-data to see the full + # list of builtins with incompatible profiles. + args += [ "--abort-on-bad-builtin-profile-data" ] } # This is needed to distinguish between generating code for the simulator @@ -2320,6 +2320,8 @@ action("v8_dump_build_config") { "v8_current_cpu=\"$v8_current_cpu\"", "v8_enable_atomic_object_field_writes=" + "$v8_enable_atomic_object_field_writes", + "v8_enable_conservative_stack_scanning=" + + "$v8_enable_conservative_stack_scanning", "v8_enable_concurrent_marking=$v8_enable_concurrent_marking", "v8_enable_single_generation=$v8_enable_single_generation", "v8_enable_i18n_support=$v8_enable_i18n_support", @@ -2332,6 +2334,7 @@ action("v8_dump_build_config") { "$v8_enable_pointer_compression_shared_cage", "v8_enable_sandbox=$v8_enable_sandbox", "v8_enable_shared_ro_heap=$v8_enable_shared_ro_heap", + "v8_disable_write_barriers=$v8_disable_write_barriers", "v8_enable_third_party_heap=$v8_enable_third_party_heap", "v8_enable_webassembly=$v8_enable_webassembly", "v8_dict_property_const_tracking=$v8_dict_property_const_tracking", @@ -2340,8 +2343,7 @@ action("v8_dump_build_config") { "v8_enable_cet_shadow_stack=$v8_enable_cet_shadow_stack", ] - if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel" || - v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") { + if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") { args += [ "mips_arch_variant=\"$mips_arch_variant\"", "mips_use_msa=$mips_use_msa", @@ -2446,6 +2448,7 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-microtask-queue-gen.cc", "src/builtins/builtins-number-gen.cc", "src/builtins/builtins-object-gen.cc", + "src/builtins/builtins-object-gen.h", "src/builtins/builtins-promise-gen.cc", "src/builtins/builtins-promise-gen.h", "src/builtins/builtins-proxy-gen.cc", @@ -2496,62 +2499,57 @@ v8_source_set("v8_initializers") { if (v8_current_cpu == "x86") { sources += [ - ### gcmole(arch:ia32) ### + ### gcmole(ia32) ### "src/builtins/ia32/builtins-ia32.cc", ] } else if (v8_current_cpu == "x64") { sources += [ - ### gcmole(arch:x64) ### + ### gcmole(x64) ### "src/builtins/x64/builtins-x64.cc", ] } else if (v8_current_cpu == "arm") { sources += [ - ### gcmole(arch:arm) ### + ### gcmole(arm) ### "src/builtins/arm/builtins-arm.cc", ] } else if (v8_current_cpu == "arm64") { sources += [ - ### gcmole(arch:arm64) ### + ### gcmole(arm64) ### "src/builtins/arm64/builtins-arm64.cc", ] - } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") { - sources += [ - ### gcmole(arch:mipsel) ### - "src/builtins/mips/builtins-mips.cc", - ] } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") { sources += [ - ### gcmole(arch:mips64el) ### + ### gcmole(mips64el) ### "src/builtins/mips64/builtins-mips64.cc", ] } else if (v8_current_cpu == "loong64") { sources += [ - ### gcmole(arch:loong64) ### + ### gcmole(loong64) ### "src/builtins/loong64/builtins-loong64.cc", ] } else if (v8_current_cpu == "ppc") { sources += [ - ### gcmole(arch:ppc) ### + ### gcmole(ppc) ### "src/builtins/ppc/builtins-ppc.cc", ] } else if (v8_current_cpu == "ppc64") { sources += [ - ### gcmole(arch:ppc64) ### + ### gcmole(ppc64) ### "src/builtins/ppc/builtins-ppc.cc", ] } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { sources += [ - ### gcmole(arch:s390) ### + ### gcmole(s390) ### "src/builtins/s390/builtins-s390.cc", ] } else if (v8_current_cpu == "riscv64") { sources += [ - ### gcmole(arch:riscv64) ### + ### gcmole(riscv64) ### "src/builtins/riscv/builtins-riscv.cc", ] } else if (v8_current_cpu == "riscv32") { sources += [ - ### gcmole(arch:riscv32) ### + ### gcmole(riscv32) ### "src/builtins/riscv/builtins-riscv.cc", ] } @@ -2861,6 +2859,7 @@ v8_header_set("v8_internal_headers") { "src/compiler/all-nodes.h", "src/compiler/allocation-builder-inl.h", "src/compiler/allocation-builder.h", + "src/compiler/backend/bitcast-elider.h", "src/compiler/backend/code-generator-impl.h", "src/compiler/backend/code-generator.h", "src/compiler/backend/frame-elider.h", @@ -2975,23 +2974,39 @@ v8_header_set("v8_internal_headers") { "src/compiler/state-values-utils.h", "src/compiler/store-store-elimination.h", "src/compiler/turboshaft/assembler.h", + "src/compiler/turboshaft/assert-types-reducer.h", + "src/compiler/turboshaft/branch-elimination-reducer.h", "src/compiler/turboshaft/decompression-optimization.h", "src/compiler/turboshaft/deopt-data.h", "src/compiler/turboshaft/fast-hash.h", "src/compiler/turboshaft/graph-builder.h", "src/compiler/turboshaft/graph-visualizer.h", "src/compiler/turboshaft/graph.h", + "src/compiler/turboshaft/index.h", + "src/compiler/turboshaft/late-escape-analysis-reducer.h", + "src/compiler/turboshaft/layered-hash-map.h", + "src/compiler/turboshaft/machine-optimization-reducer.h", + "src/compiler/turboshaft/memory-optimization.h", + "src/compiler/turboshaft/operation-matching.h", "src/compiler/turboshaft/operations.h", "src/compiler/turboshaft/optimization-phase.h", "src/compiler/turboshaft/recreate-schedule.h", + "src/compiler/turboshaft/representations.h", + "src/compiler/turboshaft/select-lowering-reducer.h", "src/compiler/turboshaft/sidetable.h", + "src/compiler/turboshaft/simplify-tf-loops.h", + "src/compiler/turboshaft/snapshot-table.h", + "src/compiler/turboshaft/type-inference-reducer.h", + "src/compiler/turboshaft/types.h", "src/compiler/turboshaft/utils.h", - "src/compiler/turboshaft/value-numbering-assembler.h", + "src/compiler/turboshaft/value-numbering-reducer.h", + "src/compiler/turboshaft/variable-reducer.h", "src/compiler/type-cache.h", "src/compiler/type-narrowing-reducer.h", "src/compiler/typed-optimization.h", "src/compiler/typer.h", "src/compiler/types.h", + "src/compiler/use-info.h", "src/compiler/value-numbering-reducer.h", "src/compiler/verifier.h", "src/compiler/write-barrier-kind.h", @@ -3007,7 +3022,6 @@ v8_header_set("v8_internal_headers") { "src/debug/debug-scope-iterator.h", "src/debug/debug-scopes.h", "src/debug/debug-stack-trace-iterator.h", - "src/debug/debug-type-profile.h", "src/debug/debug.h", "src/debug/interface-types.h", "src/debug/liveedit-diff.h", @@ -3078,6 +3092,7 @@ v8_header_set("v8_internal_headers") { "src/handles/maybe-handles.h", "src/handles/persistent-handles.h", "src/handles/shared-object-conveyor-handles.h", + "src/handles/traced-handles.h", "src/heap/allocation-observer.h", "src/heap/allocation-result.h", "src/heap/allocation-stats.h", @@ -3096,6 +3111,7 @@ v8_header_set("v8_internal_headers") { "src/heap/cppgc-js/cpp-marking-state-inl.h", "src/heap/cppgc-js/cpp-marking-state.h", "src/heap/cppgc-js/cpp-snapshot.h", + "src/heap/cppgc-js/cross-heap-remembered-set.h", "src/heap/cppgc-js/unified-heap-marking-state-inl.h", "src/heap/cppgc-js/unified-heap-marking-state.h", "src/heap/cppgc-js/unified-heap-marking-verifier.h", @@ -3104,6 +3120,8 @@ v8_header_set("v8_internal_headers") { "src/heap/embedder-tracing.h", "src/heap/evacuation-allocator-inl.h", "src/heap/evacuation-allocator.h", + "src/heap/evacuation-verifier-inl.h", + "src/heap/evacuation-verifier.h", "src/heap/factory-base-inl.h", "src/heap/factory-base.h", "src/heap/factory-inl.h", @@ -3115,7 +3133,6 @@ v8_header_set("v8_internal_headers") { "src/heap/gc-idle-time-handler.h", "src/heap/gc-tracer-inl.h", "src/heap/gc-tracer.h", - "src/heap/global-handle-marking-visitor.h", "src/heap/heap-allocator-inl.h", "src/heap/heap-allocator.h", "src/heap/heap-controller.h", @@ -3141,6 +3158,8 @@ v8_header_set("v8_internal_headers") { "src/heap/mark-compact.h", "src/heap/marking-barrier-inl.h", "src/heap/marking-barrier.h", + "src/heap/marking-state-inl.h", + "src/heap/marking-state.h", "src/heap/marking-visitor-inl.h", "src/heap/marking-visitor.h", "src/heap/marking-worklist-inl.h", @@ -3162,6 +3181,8 @@ v8_header_set("v8_internal_headers") { "src/heap/paged-spaces.h", "src/heap/parallel-work-item.h", "src/heap/parked-scope.h", + "src/heap/pretenuring-handler-inl.h", + "src/heap/pretenuring-handler.h", "src/heap/progress-bar.h", "src/heap/read-only-heap-inl.h", "src/heap/read-only-heap.h", @@ -3178,6 +3199,7 @@ v8_header_set("v8_internal_headers") { "src/heap/stress-marking-observer.h", "src/heap/stress-scavenge-observer.h", "src/heap/sweeper.h", + "src/heap/traced-handles-marking-visitor.h", "src/heap/weak-object-worklists.h", "src/ic/call-optimization.h", "src/ic/handler-configuration-inl.h", @@ -3320,6 +3342,8 @@ v8_header_set("v8_internal_headers") { "src/objects/js-promise.h", "src/objects/js-proxy-inl.h", "src/objects/js-proxy.h", + "src/objects/js-raw-json-inl.h", + "src/objects/js-raw-json.h", "src/objects/js-regexp-inl.h", "src/objects/js-regexp-string-iterator-inl.h", "src/objects/js-regexp-string-iterator.h", @@ -3437,6 +3461,8 @@ v8_header_set("v8_internal_headers") { "src/objects/transitions.h", "src/objects/turbofan-types-inl.h", "src/objects/turbofan-types.h", + "src/objects/turboshaft-types-inl.h", + "src/objects/turboshaft-types.h", "src/objects/type-hints.h", "src/objects/value-serializer.h", "src/objects/visitors-inl.h", @@ -3468,6 +3494,7 @@ v8_header_set("v8_internal_headers") { "src/profiler/heap-profiler.h", "src/profiler/heap-snapshot-generator-inl.h", "src/profiler/heap-snapshot-generator.h", + "src/profiler/output-stream-writer.h", "src/profiler/profile-generator-inl.h", "src/profiler/profile-generator.h", "src/profiler/profiler-listener.h", @@ -3482,7 +3509,6 @@ v8_header_set("v8_internal_headers") { "src/regexp/experimental/experimental-compiler.h", "src/regexp/experimental/experimental-interpreter.h", "src/regexp/experimental/experimental.h", - "src/regexp/property-sequences.h", "src/regexp/regexp-ast.h", "src/regexp/regexp-bytecode-generator-inl.h", "src/regexp/regexp-bytecode-generator.h", @@ -3504,8 +3530,11 @@ v8_header_set("v8_internal_headers") { "src/regexp/special-case.h", "src/roots/roots-inl.h", "src/roots/roots.h", + "src/roots/static-roots.h", "src/runtime/runtime-utils.h", "src/runtime/runtime.h", + "src/sandbox/bounded-size-inl.h", + "src/sandbox/bounded-size.h", "src/sandbox/external-pointer-inl.h", "src/sandbox/external-pointer-table-inl.h", "src/sandbox/external-pointer-table.h", @@ -3603,7 +3632,6 @@ v8_header_set("v8_internal_headers") { if (v8_enable_maglev) { sources += [ - "src/maglev/maglev-assembler-inl.h", "src/maglev/maglev-assembler.h", "src/maglev/maglev-basic-block.h", "src/maglev/maglev-code-gen-state.h", @@ -3624,9 +3652,13 @@ v8_header_set("v8_internal_headers") { "src/maglev/maglev-regalloc-data.h", "src/maglev/maglev-regalloc.h", "src/maglev/maglev-register-frame-array.h", - "src/maglev/maglev-vreg-allocator.h", "src/maglev/maglev.h", ] + if (v8_current_cpu == "arm64") { + sources += [ "src/maglev/arm64/maglev-assembler-arm64-inl.h" ] + } else if (v8_current_cpu == "x64") { + sources += [ "src/maglev/x64/maglev-assembler-x64-inl.h" ] + } } if (v8_enable_webassembly) { @@ -3676,7 +3708,7 @@ v8_header_set("v8_internal_headers") { "src/wasm/module-instantiate.h", "src/wasm/names-provider.h", "src/wasm/object-access.h", - "src/wasm/signature-map.h", + "src/wasm/pgo.h", "src/wasm/simd-shuffle.h", "src/wasm/stacks.h", "src/wasm/streaming-decoder.h", @@ -3733,6 +3765,8 @@ v8_header_set("v8_internal_headers") { "src/objects/js-date-time-format.h", "src/objects/js-display-names-inl.h", "src/objects/js-display-names.h", + "src/objects/js-duration-format-inl.h", + "src/objects/js-duration-format.h", "src/objects/js-list-format-inl.h", "src/objects/js-list-format.h", "src/objects/js-locale-inl.h", @@ -3785,7 +3819,8 @@ v8_header_set("v8_internal_headers") { } if (v8_current_cpu == "x86") { - sources += [ ### gcmole(arch:ia32) ### + sources += [ + ### gcmole(ia32) ### "src/baseline/ia32/baseline-assembler-ia32-inl.h", "src/baseline/ia32/baseline-compiler-ia32-inl.h", "src/codegen/ia32/assembler-ia32-inl.h", @@ -3803,7 +3838,8 @@ v8_header_set("v8_internal_headers") { "src/wasm/baseline/ia32/liftoff-assembler-ia32.h", ] } else if (v8_current_cpu == "x64") { - sources += [ ### gcmole(arch:x64) ### + sources += [ + ### gcmole(x64) ### "src/baseline/x64/baseline-assembler-x64-inl.h", "src/baseline/x64/baseline-compiler-x64-inl.h", "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.h", @@ -3839,7 +3875,8 @@ v8_header_set("v8_internal_headers") { } } } else if (v8_current_cpu == "arm") { - sources += [ ### gcmole(arch:arm) ### + sources += [ + ### gcmole(arm) ### "src/baseline/arm/baseline-assembler-arm-inl.h", "src/baseline/arm/baseline-compiler-arm-inl.h", "src/codegen/arm/assembler-arm-inl.h", @@ -3857,7 +3894,8 @@ v8_header_set("v8_internal_headers") { "src/wasm/baseline/arm/liftoff-assembler-arm.h", ] } else if (v8_current_cpu == "arm64") { - sources += [ ### gcmole(arch:arm64) ### + sources += [ + ### gcmole(arm64) ### "src/baseline/arm64/baseline-assembler-arm64-inl.h", "src/baseline/arm64/baseline-compiler-arm64-inl.h", "src/codegen/arm64/assembler-arm64-inl.h", @@ -3898,24 +3936,9 @@ v8_header_set("v8_internal_headers") { if (is_win) { sources += [ "src/diagnostics/unwinding-info-win64.h" ] } - } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") { - sources += [ ### gcmole(arch:mipsel) ### - "src/baseline/mips/baseline-assembler-mips-inl.h", - "src/baseline/mips/baseline-compiler-mips-inl.h", - "src/codegen/mips/assembler-mips-inl.h", - "src/codegen/mips/assembler-mips.h", - "src/codegen/mips/constants-mips.h", - "src/codegen/mips/macro-assembler-mips.h", - "src/codegen/mips/register-mips.h", - "src/codegen/mips/reglist-mips.h", - "src/compiler/backend/mips/instruction-codes-mips.h", - "src/execution/mips/frame-constants-mips.h", - "src/execution/mips/simulator-mips.h", - "src/regexp/mips/regexp-macro-assembler-mips.h", - "src/wasm/baseline/mips/liftoff-assembler-mips.h", - ] } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") { - sources += [ ### gcmole(arch:mips64el) ### + sources += [ + ### gcmole(mips64el) ### "src/baseline/mips64/baseline-assembler-mips64-inl.h", "src/baseline/mips64/baseline-compiler-mips64-inl.h", "src/codegen/mips64/assembler-mips64-inl.h", @@ -3931,7 +3954,8 @@ v8_header_set("v8_internal_headers") { "src/wasm/baseline/mips64/liftoff-assembler-mips64.h", ] } else if (v8_current_cpu == "loong64") { - sources += [ ### gcmole(arch:loong64) ### + sources += [ + ### gcmole(loong64) ### "src/baseline/loong64/baseline-assembler-loong64-inl.h", "src/baseline/loong64/baseline-compiler-loong64-inl.h", "src/codegen/loong64/assembler-loong64-inl.h", @@ -3947,7 +3971,8 @@ v8_header_set("v8_internal_headers") { "src/wasm/baseline/loong64/liftoff-assembler-loong64.h", ] } else if (v8_current_cpu == "ppc") { - sources += [ ### gcmole(arch:ppc) ### + sources += [ + ### gcmole(ppc) ### "src/codegen/ppc/assembler-ppc-inl.h", "src/codegen/ppc/assembler-ppc.h", "src/codegen/ppc/constants-ppc.h", @@ -3963,7 +3988,8 @@ v8_header_set("v8_internal_headers") { "src/wasm/baseline/ppc/liftoff-assembler-ppc.h", ] } else if (v8_current_cpu == "ppc64") { - sources += [ ### gcmole(arch:ppc64) ### + sources += [ + ### gcmole(ppc64) ### "src/baseline/ppc/baseline-assembler-ppc-inl.h", "src/baseline/ppc/baseline-compiler-ppc-inl.h", "src/codegen/ppc/assembler-ppc-inl.h", @@ -3981,7 +4007,8 @@ v8_header_set("v8_internal_headers") { "src/wasm/baseline/ppc/liftoff-assembler-ppc.h", ] } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { - sources += [ ### gcmole(arch:s390) ### + sources += [ + ### gcmole(s390) ### "src/baseline/s390/baseline-assembler-s390-inl.h", "src/baseline/s390/baseline-compiler-s390-inl.h", "src/codegen/s390/assembler-s390-inl.h", @@ -3999,7 +4026,8 @@ v8_header_set("v8_internal_headers") { "src/wasm/baseline/s390/liftoff-assembler-s390.h", ] } else if (v8_current_cpu == "riscv64") { - sources += [ ### gcmole(arch:riscv64) ### + sources += [ + ### gcmole(riscv64) ### "src/baseline/riscv/baseline-assembler-riscv-inl.h", "src/baseline/riscv/baseline-compiler-riscv-inl.h", "src/codegen/riscv/assembler-riscv-inl.h", @@ -4038,7 +4066,8 @@ v8_header_set("v8_internal_headers") { "src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h", ] } else if (v8_current_cpu == "riscv32") { - sources += [ ### gcmole(arch:riscv32) ### + sources += [ + ### gcmole(riscv32) ### "src/baseline/riscv/baseline-assembler-riscv-inl.h", "src/baseline/riscv/baseline-compiler-riscv-inl.h", "src/codegen/riscv/assembler-riscv.h", @@ -4100,6 +4129,7 @@ v8_compiler_sources = [ "src/compiler/access-info.cc", "src/compiler/add-type-assertions-reducer.cc", "src/compiler/all-nodes.cc", + "src/compiler/backend/bitcast-elider.cc", "src/compiler/backend/code-generator.cc", "src/compiler/backend/frame-elider.cc", "src/compiler/backend/gap-resolver.cc", @@ -4289,13 +4319,20 @@ v8_source_set("v8_turboshaft") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ + "src/compiler/turboshaft/assembler.cc", "src/compiler/turboshaft/decompression-optimization.cc", "src/compiler/turboshaft/graph-builder.cc", "src/compiler/turboshaft/graph-visualizer.cc", "src/compiler/turboshaft/graph.cc", + "src/compiler/turboshaft/late-escape-analysis-reducer.cc", + "src/compiler/turboshaft/memory-optimization.cc", "src/compiler/turboshaft/operations.cc", "src/compiler/turboshaft/optimization-phase.cc", "src/compiler/turboshaft/recreate-schedule.cc", + "src/compiler/turboshaft/representations.cc", + "src/compiler/turboshaft/simplify-tf-loops.cc", + "src/compiler/turboshaft/types.cc", + "src/compiler/turboshaft/utils.cc", ] public_deps = [ @@ -4424,6 +4461,7 @@ v8_source_set("v8_base_without_compiler") { "src/codegen/unoptimized-compilation-info.cc", "src/common/assert-scope.cc", "src/common/code-memory-access.cc", + "src/common/ptr-compr.cc", "src/compiler-dispatcher/lazy-compile-dispatcher.cc", "src/compiler-dispatcher/optimizing-compile-dispatcher.cc", "src/date/date.cc", @@ -4436,7 +4474,6 @@ v8_source_set("v8_base_without_compiler") { "src/debug/debug-scope-iterator.cc", "src/debug/debug-scopes.cc", "src/debug/debug-stack-trace-iterator.cc", - "src/debug/debug-type-profile.cc", "src/debug/debug.cc", "src/debug/liveedit-diff.cc", "src/debug/liveedit.cc", @@ -4486,6 +4523,7 @@ v8_source_set("v8_base_without_compiler") { "src/handles/local-handles.cc", "src/handles/persistent-handles.cc", "src/handles/shared-object-conveyor-handles.cc", + "src/handles/traced-handles.cc", "src/heap/allocation-observer.cc", "src/heap/array-buffer-sweeper.cc", "src/heap/base-space.cc", @@ -4499,17 +4537,18 @@ v8_source_set("v8_base_without_compiler") { "src/heap/concurrent-marking.cc", "src/heap/cppgc-js/cpp-heap.cc", "src/heap/cppgc-js/cpp-snapshot.cc", + "src/heap/cppgc-js/cross-heap-remembered-set.cc", "src/heap/cppgc-js/unified-heap-marking-state.cc", "src/heap/cppgc-js/unified-heap-marking-verifier.cc", "src/heap/cppgc-js/unified-heap-marking-visitor.cc", "src/heap/embedder-tracing.cc", + "src/heap/evacuation-verifier.cc", "src/heap/factory-base.cc", "src/heap/factory.cc", "src/heap/finalization-registry-cleanup-task.cc", "src/heap/free-list.cc", "src/heap/gc-idle-time-handler.cc", "src/heap/gc-tracer.cc", - "src/heap/global-handle-marking-visitor.cc", "src/heap/heap-allocator.cc", "src/heap/heap-controller.cc", "src/heap/heap-layout-tracer.cc", @@ -4536,6 +4575,7 @@ v8_source_set("v8_base_without_compiler") { "src/heap/object-stats.cc", "src/heap/objects-visiting.cc", "src/heap/paged-spaces.cc", + "src/heap/pretenuring-handler.cc", "src/heap/read-only-heap.cc", "src/heap/read-only-spaces.cc", "src/heap/safepoint.cc", @@ -4546,6 +4586,7 @@ v8_source_set("v8_base_without_compiler") { "src/heap/stress-marking-observer.cc", "src/heap/stress-scavenge-observer.cc", "src/heap/sweeper.cc", + "src/heap/traced-handles-marking-visitor.cc", "src/heap/weak-object-worklists.cc", "src/ic/call-optimization.cc", "src/ic/handler-configuration.cc", @@ -4608,12 +4649,14 @@ v8_source_set("v8_base_without_compiler") { "src/objects/js-collator.cc", "src/objects/js-date-time-format.cc", "src/objects/js-display-names.cc", + "src/objects/js-duration-format.cc", "src/objects/js-function.cc", "src/objects/js-list-format.cc", "src/objects/js-locale.cc", "src/objects/js-number-format.cc", "src/objects/js-objects.cc", "src/objects/js-plural-rules.cc", + "src/objects/js-raw-json.cc", "src/objects/js-regexp.cc", "src/objects/js-relative-time-format.cc", "src/objects/js-segment-iterator.cc", @@ -4682,7 +4725,6 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/experimental/experimental-compiler.cc", "src/regexp/experimental/experimental-interpreter.cc", "src/regexp/experimental/experimental.cc", - "src/regexp/property-sequences.cc", "src/regexp/regexp-ast.cc", "src/regexp/regexp-bytecode-generator.cc", "src/regexp/regexp-bytecode-peephole.cc", @@ -4798,14 +4840,27 @@ v8_source_set("v8_base_without_compiler") { "src/maglev/maglev-concurrent-dispatcher.cc", "src/maglev/maglev-graph-builder.cc", "src/maglev/maglev-graph-printer.cc", + "src/maglev/maglev-interpreter-frame-state.cc", "src/maglev/maglev-ir.cc", "src/maglev/maglev-regalloc.cc", "src/maglev/maglev.cc", ] + if (v8_current_cpu == "arm64") { + sources += [ + "src/maglev/arm64/maglev-assembler-arm64.cc", + "src/maglev/arm64/maglev-ir-arm64.cc", + ] + } else if (v8_current_cpu == "x64") { + sources += [ + "src/maglev/x64/maglev-assembler-x64.cc", + "src/maglev/x64/maglev-ir-x64.cc", + ] + } } if (v8_enable_webassembly) { - sources += [ ### gcmole(all) ### + sources += [ + ### gcmole(all) ### "src/asmjs/asm-js.cc", "src/asmjs/asm-parser.cc", "src/asmjs/asm-scanner.cc", @@ -4833,7 +4888,7 @@ v8_source_set("v8_base_without_compiler") { "src/wasm/module-decoder.cc", "src/wasm/module-instantiate.cc", "src/wasm/names-provider.cc", - "src/wasm/signature-map.cc", + "src/wasm/pgo.cc", "src/wasm/simd-shuffle.cc", "src/wasm/stacks.cc", "src/wasm/streaming-decoder.cc", @@ -4887,7 +4942,8 @@ v8_source_set("v8_base_without_compiler") { } if (v8_current_cpu == "x86") { - sources += [ ### gcmole(arch:ia32) ### + sources += [ + ### gcmole(ia32) ### "src/codegen/ia32/assembler-ia32.cc", "src/codegen/ia32/cpu-ia32.cc", "src/codegen/ia32/macro-assembler-ia32.cc", @@ -4902,7 +4958,8 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/ia32/regexp-macro-assembler-ia32.cc", ] } else if (v8_current_cpu == "x64") { - sources += [ ### gcmole(arch:x64) ### + sources += [ + ### gcmole(x64) ### "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.cc", "src/codegen/x64/assembler-x64.cc", "src/codegen/x64/cpu-x64.cc", @@ -4940,7 +4997,8 @@ v8_source_set("v8_base_without_compiler") { } } } else if (v8_current_cpu == "arm") { - sources += [ ### gcmole(arch:arm) ### + sources += [ + ### gcmole(arm) ### "src/codegen/arm/assembler-arm.cc", "src/codegen/arm/constants-arm.cc", "src/codegen/arm/cpu-arm.cc", @@ -4958,7 +5016,8 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/arm/regexp-macro-assembler-arm.cc", ] } else if (v8_current_cpu == "arm64") { - sources += [ ### gcmole(arch:arm64) ### + sources += [ + ### gcmole(arm64) ### "src/codegen/arm64/assembler-arm64.cc", "src/codegen/arm64/cpu-arm64.cc", "src/codegen/arm64/decoder-arm64.cc", @@ -5004,25 +5063,9 @@ v8_source_set("v8_base_without_compiler") { if (is_win) { sources += [ "src/diagnostics/unwinding-info-win64.cc" ] } - } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") { - sources += [ ### gcmole(arch:mipsel) ### - "src/codegen/mips/assembler-mips.cc", - "src/codegen/mips/constants-mips.cc", - "src/codegen/mips/cpu-mips.cc", - "src/codegen/mips/interface-descriptors-mips-inl.h", - "src/codegen/mips/macro-assembler-mips.cc", - "src/compiler/backend/mips/code-generator-mips.cc", - "src/compiler/backend/mips/instruction-scheduler-mips.cc", - "src/compiler/backend/mips/instruction-selector-mips.cc", - "src/deoptimizer/mips/deoptimizer-mips.cc", - "src/diagnostics/mips/disasm-mips.cc", - "src/diagnostics/mips/unwinder-mips.cc", - "src/execution/mips/frame-constants-mips.cc", - "src/execution/mips/simulator-mips.cc", - "src/regexp/mips/regexp-macro-assembler-mips.cc", - ] } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") { - sources += [ ### gcmole(arch:mips64el) ### + sources += [ + ### gcmole(mips64el) ### "src/codegen/mips64/assembler-mips64.cc", "src/codegen/mips64/constants-mips64.cc", "src/codegen/mips64/cpu-mips64.cc", @@ -5039,7 +5082,8 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/mips64/regexp-macro-assembler-mips64.cc", ] } else if (v8_current_cpu == "loong64") { - sources += [ ### gcmole(arch:loong64) ### + sources += [ + ### gcmole(loong64) ### "src/codegen/loong64/assembler-loong64.cc", "src/codegen/loong64/constants-loong64.cc", "src/codegen/loong64/cpu-loong64.cc", @@ -5056,7 +5100,8 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/loong64/regexp-macro-assembler-loong64.cc", ] } else if (v8_current_cpu == "ppc") { - sources += [ ### gcmole(arch:ppc) ### + sources += [ + ### gcmole(ppc) ### "src/codegen/ppc/assembler-ppc.cc", "src/codegen/ppc/constants-ppc.cc", "src/codegen/ppc/cpu-ppc.cc", @@ -5074,7 +5119,8 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/ppc/regexp-macro-assembler-ppc.cc", ] } else if (v8_current_cpu == "ppc64") { - sources += [ ### gcmole(arch:ppc64) ### + sources += [ + ### gcmole(ppc64) ### "src/codegen/ppc/assembler-ppc.cc", "src/codegen/ppc/constants-ppc.cc", "src/codegen/ppc/cpu-ppc.cc", @@ -5092,7 +5138,8 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/ppc/regexp-macro-assembler-ppc.cc", ] } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { - sources += [ ### gcmole(arch:s390) ### + sources += [ + ### gcmole(s390) ### "src/codegen/s390/assembler-s390.cc", "src/codegen/s390/constants-s390.cc", "src/codegen/s390/cpu-s390.cc", @@ -5110,7 +5157,8 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/s390/regexp-macro-assembler-s390.cc", ] } else if (v8_current_cpu == "riscv64") { - sources += [ ### gcmole(arch:riscv64) ### + sources += [ + ### gcmole(riscv64) ### "src/codegen/riscv/assembler-riscv.cc", "src/codegen/riscv/base-assembler-riscv.cc", "src/codegen/riscv/base-constants-riscv.cc", @@ -5136,7 +5184,8 @@ v8_source_set("v8_base_without_compiler") { "src/regexp/riscv/regexp-macro-assembler-riscv.cc", ] } else if (v8_current_cpu == "riscv32") { - sources += [ ### gcmole(arch:riscv32) ### + sources += [ + ### gcmole(riscv32) ### "src/codegen/riscv/assembler-riscv.cc", "src/codegen/riscv/base-assembler-riscv.cc", "src/codegen/riscv/base-constants-riscv.cc", @@ -5213,6 +5262,7 @@ v8_source_set("v8_base_without_compiler") { "src/objects/js-collator.cc", "src/objects/js-date-time-format.cc", "src/objects/js-display-names.cc", + "src/objects/js-duration-format.cc", "src/objects/js-list-format.cc", "src/objects/js-locale.cc", "src/objects/js-number-format.cc", @@ -5246,8 +5296,7 @@ v8_source_set("v8_base_without_compiler") { # Platforms that don't have CAS support need to link atomic library # to implement atomic memory access - if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel" || - v8_current_cpu == "mips64" || v8_current_cpu == "mips64el" || + if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el" || v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" || v8_current_cpu == "s390" || v8_current_cpu == "s390x" || v8_current_cpu == "riscv64" || v8_current_cpu == "riscv32") { @@ -5637,7 +5686,7 @@ v8_component("v8_libbase") { data_deps += [ "//build/win:runtime_libs" ] } - if (v8_current_cpu == "mips" || v8_current_cpu == "mips64") { + if (v8_current_cpu == "mips64") { # Add runtime libs for mips. data += [ "tools/mips_toolchain/sysroot/usr/lib/", @@ -5645,8 +5694,7 @@ v8_component("v8_libbase") { ] } - if (is_ubsan && (v8_current_cpu == "x86" || v8_current_cpu == "arm" || - v8_current_cpu == "mips")) { + if (is_ubsan && (v8_current_cpu == "x86" || v8_current_cpu == "arm")) { # Special UBSan 32-bit requirement. sources += [ "src/base/ubsan.cc" ] } @@ -5664,9 +5712,35 @@ v8_component("v8_libbase") { [ "//build/config/clang:llvm-symbolizer_data($host_toolchain)" ] } + if (v8_use_libm_trig_functions) { + deps += [ ":libm" ] + } + # TODO(infra): Add support for qnx, freebsd, openbsd, netbsd, and solaris. } +if (v8_use_libm_trig_functions) { + source_set("libm") { + sources = [ + "third_party/glibc/src/sysdeps/ieee754/dbl-64/branred.c", + "third_party/glibc/src/sysdeps/ieee754/dbl-64/branred.h", + "third_party/glibc/src/sysdeps/ieee754/dbl-64/dla.h", + "third_party/glibc/src/sysdeps/ieee754/dbl-64/endian.h", + "third_party/glibc/src/sysdeps/ieee754/dbl-64/mydefs.h", + "third_party/glibc/src/sysdeps/ieee754/dbl-64/s_sin.c", + "third_party/glibc/src/sysdeps/ieee754/dbl-64/sincostab.c", + "third_party/glibc/src/sysdeps/ieee754/dbl-64/trig.h", + "third_party/glibc/src/sysdeps/ieee754/dbl-64/usncs.h", + ] + configs += [ "//build/config/compiler:no_chromium_code" ] + configs -= [ "//build/config/compiler:chromium_code" ] + if (!is_debug) { + # Build code using -O3, see: crbug.com/1084371. + configs += [ "//build/config/compiler:optimize_speed" ] + } + } +} + v8_component("v8_libplatform") { sources = [ "//base/trace_event/common/trace_event_common.h", @@ -5797,6 +5871,7 @@ v8_source_set("v8_bigint") { v8_header_set("v8_heap_base_headers") { sources = [ "src/heap/base/active-system-pages.h", + "src/heap/base/basic-slot-set.h", "src/heap/base/stack.h", "src/heap/base/worklist.h", ] @@ -5815,33 +5890,31 @@ v8_source_set("v8_heap_base") { if (is_clang || !is_win) { if (current_cpu == "x64") { - sources += [ "src/heap/base/asm/x64/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/x64/save_registers_asm.cc" ] } else if (current_cpu == "x86") { - sources += [ "src/heap/base/asm/ia32/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/ia32/save_registers_asm.cc" ] } else if (current_cpu == "arm") { - sources += [ "src/heap/base/asm/arm/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/arm/save_registers_asm.cc" ] } else if (current_cpu == "arm64") { - sources += [ "src/heap/base/asm/arm64/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/arm64/save_registers_asm.cc" ] } else if (current_cpu == "ppc64") { - sources += [ "src/heap/base/asm/ppc/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/ppc/save_registers_asm.cc" ] } else if (current_cpu == "s390x") { - sources += [ "src/heap/base/asm/s390/push_registers_asm.cc" ] - } else if (current_cpu == "mipsel") { - sources += [ "src/heap/base/asm/mips/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/s390/save_registers_asm.cc" ] } else if (current_cpu == "mips64el") { - sources += [ "src/heap/base/asm/mips64/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/mips64/save_registers_asm.cc" ] } else if (current_cpu == "loong64") { - sources += [ "src/heap/base/asm/loong64/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/loong64/save_registers_asm.cc" ] } else if (current_cpu == "riscv64" || current_cpu == "riscv32") { - sources += [ "src/heap/base/asm/riscv/push_registers_asm.cc" ] + sources += [ "src/heap/base/asm/riscv/save_registers_asm.cc" ] } } else if (is_win) { if (current_cpu == "x64") { - sources += [ "src/heap/base/asm/x64/push_registers_masm.asm" ] + sources += [ "src/heap/base/asm/x64/save_registers_masm.asm" ] } else if (current_cpu == "x86") { - sources += [ "src/heap/base/asm/ia32/push_registers_masm.asm" ] + sources += [ "src/heap/base/asm/ia32/save_registers_masm.asm" ] } else if (current_cpu == "arm64") { - sources += [ "src/heap/base/asm/arm64/push_registers_masm.S" ] + sources += [ "src/heap/base/asm/arm64/save_registers_masm.S" ] } } @@ -5943,6 +6016,7 @@ v8_source_set("cppgc_base") { "src/heap/cppgc/globals.h", "src/heap/cppgc/heap-base.cc", "src/heap/cppgc/heap-base.h", + "src/heap/cppgc/heap-config.h", "src/heap/cppgc/heap-consistency.cc", "src/heap/cppgc/heap-growing.cc", "src/heap/cppgc/heap-growing.h", @@ -6176,6 +6250,8 @@ if (current_toolchain == v8_snapshot_toolchain) { "src/snapshot/embedded/platform-embedded-file-writer-win.h", "src/snapshot/mksnapshot.cc", "src/snapshot/snapshot-empty.cc", + "src/snapshot/static-roots-gen.cc", + "src/snapshot/static-roots-gen.h", ] if (v8_control_flow_integrity) { @@ -6340,7 +6416,7 @@ group("gn_all") { } group("v8_python_base") { - data = [ ".vpython" ] + data = [ ".vpython3" ] } group("v8_clusterfuzz") { diff --git a/COMMON_OWNERS b/COMMON_OWNERS index 39f241b3e9..b7dc8f2147 100644 --- a/COMMON_OWNERS +++ b/COMMON_OWNERS @@ -18,6 +18,7 @@ machenbach@chromium.org manoskouk@chromium.org mathias@chromium.org marja@chromium.org +mliedtke@chromium.org mlippautz@chromium.org mslekova@chromium.org nicohartmann@chromium.org diff --git a/DEPS b/DEPS index 70a1f94b82..aaf6abbde2 100644 --- a/DEPS +++ b/DEPS @@ -26,35 +26,46 @@ vars = { # most commonly useful for developers. Bots and developers that need to use # other images (e.g., qemu.arm64) can override this with additional images. 'checkout_fuchsia_boot_images': "qemu.x64", + 'checkout_fuchsia_product_bundles': '"{checkout_fuchsia_boot_images}" != ""', 'checkout_instrumented_libraries': False, 'checkout_ittapi': False, + + # Fetch the prebuilt binaries for llvm-cov and llvm-profdata. Needed to + # process the raw profiles produced by instrumented targets (built with + # the gn arg 'use_clang_coverage'). + 'checkout_clang_coverage_tools': False, + # Fetch clang-tidy into the same bin/ directory as our clang binary. 'checkout_clang_tidy': False, + 'chromium_url': 'https://chromium.googlesource.com', 'android_url': 'https://android.googlesource.com', 'download_gcmole': False, 'download_jsfunfuzz': False, 'download_prebuilt_bazel': False, 'check_v8_header_includes': False, - 'checkout_reclient': False, # By default, download the fuchsia sdk from the public sdk directory. 'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/gn/', # reclient CIPD package version - 'reclient_version': 're_client_version:0.69.0.458df98-gomaip', + 'reclient_version': 're_client_version:0.87.0.b6908b3-gomaip', # GN CIPD package version. - 'gn_version': 'git_revision:00b741b1568d56cf4e117dcb9f70cd42653b4c78', + 'gn_version': 'git_revision:70d6c60823c0233a0f35eccc25b2b640d2980bdc', + + # ninja CIPD package version + # https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/ninja + 'ninja_version': 'version:2@1.8.2.chromium.3', # luci-go CIPD package version. - 'luci_go': 'git_revision:3226112a79a7c2de84c3186191e24dd61680a77d', + 'luci_go': 'git_revision:bac571b5399502fa16ac48a1d3820e1117505085', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Fuchsia sdk # and whatever else without interference from each other. - 'fuchsia_version': 'version:9.20220902.1.1', + 'fuchsia_version': 'version:11.20221209.0.1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_build-tools_version @@ -87,16 +98,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': 'IPzAG-uU5zVMxohpg9-7-N0tQC1TCSW1VbrBFw7Ld04C', + 'android_sdk_cmdline-tools_version': 'oWlET2yQhaPKQ66tYNuSPaueU78Z9VlxpyxOoUjwRuIC', } deps = { 'base/trace_event/common': - Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '640fc6dc86d5e75e6c7e8006cb45fb46c91014e0', + Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '521ac34ebd795939c7e16b37d9d3ddb40e8ed556', 'build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + '24bb6108a40a44bda3a7fa88d906c0774034df08', + Var('chromium_url') + '/chromium/src/build.git' + '@' + '3d4b0c1e773d659da18710fc4984b8195f6d5aea', 'buildtools': - Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '46ab4c32d461f34456161fac6cd58d203c5083e9', + Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '202b660eb577da482fdec18173379df77147a394', 'buildtools/clang_format/script': Var('chromium_url') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + '8b525d2747f2584fc35d8c7e612e66f377858df7', 'buildtools/linux64': { @@ -120,11 +131,11 @@ deps = { 'condition': 'host_os == "mac"', }, 'buildtools/third_party/libc++/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '85a3363f04e1e0e7b85d62d5d9a419e039755262', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '52399655fdafdd14ade17ab12ddc9e955423aa5a', 'buildtools/third_party/libc++abi/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '6285577a9df73170c1496b78542a2c18fa2352fd', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '25a3d07096374aeeffa3dab8b582143dde5a9ca9', 'buildtools/third_party/libunwind/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '42aa6de5544ec1ccc27da640a044bd3f474ee75a', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '09a1f53060bc601b5ee821d7ab52071eed096fda', 'buildtools/win': { 'packages': [ { @@ -143,20 +154,20 @@ deps = { } ], 'dep_type': 'cipd', - 'condition': '(host_os == "linux" or host_os == "mac" or host_os == "win") and checkout_reclient', + 'condition': '(host_os == "linux" or host_os == "mac" or host_os == "win") and host_cpu != "s390" and host_cpu != "ppc"', }, 'test/benchmarks/data': Var('chromium_url') + '/v8/deps/third_party/benchmarks.git' + '@' + '05d7188267b4560491ff9155c5ee13e207ecd65f', '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' + '@' + '8dcc0e1955b1753271ed0812d1a2a15a23de069b', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'e6c6460a5b94e32e01ce9a9d236f3148d4648ce5', 'third_party/android_ndk': { 'url': Var('chromium_url') + '/android_ndk.git' + '@' + '8388a2be5421311dc75c5f937aae13d821a27f3d', 'condition': 'checkout_android', }, 'third_party/android_platform': { - 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '04b33506bfd9d0e866bd8bd62f4cbf323d84dc79', + 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '1bf9b932433ebb78828bf3c8cd0ccc86b9ef4787', 'condition': 'checkout_android', }, 'third_party/android_sdk/public': { @@ -198,7 +209,7 @@ deps = { 'dep_type': 'cipd', }, 'third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '7ee071132a536a6616589cc2411674d1b459b4da', + 'url': Var('chromium_url') + '/catapult.git' + '@' + '2f1cf6121c17b31d4607afbaec37f33b0526cfc4', 'condition': 'checkout_android', }, 'third_party/colorama/src': { @@ -206,7 +217,7 @@ deps = { 'condition': 'checkout_android', }, 'third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'a089281a82f9481e246dcc1292145d0e8635f51c', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'a964ca1296b9238d0797aa5f25597efa7b897515', 'third_party/fuchsia-sdk/sdk': { 'packages': [ { @@ -223,9 +234,9 @@ deps = { 'third_party/googletest/src': Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'af29db7ec28d6df1c7f0f745186884091e602e07', 'third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'bbdc7d8936bd9b896ff9c9822b697554b73c1c9d', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '1b7d391f0528fb3a4976b7541b387ee04f915f83', 'third_party/instrumented_libraries': - Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + 'e09c4b66b6e87116eb190651421f1a6e2f3b9c52', + Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + '09ba70cfb2c0d01c60684660e357ae200caf2968', 'third_party/ittapi': { # Force checkout ittapi libraries to pass v8 header includes check on # bots that has check_v8_header_includes enabled. @@ -233,13 +244,23 @@ deps = { 'condition': "checkout_ittapi or check_v8_header_includes", }, 'third_party/jinja2': - Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + 'ee69aa00ee8536f61db6a451f3858745cf587de6', + Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + '4633bf431193690c3491244f5a0acbe9ac776233', 'third_party/jsoncpp/source': Var('chromium_url') + '/external/github.com/open-source-parsers/jsoncpp.git'+ '@' + '42e892d96e47b1f6e29844cc705e148ec4856448', 'third_party/logdog/logdog': Var('chromium_url') + '/infra/luci/luci-py/client/libs/logdog' + '@' + '0b2078a90f7a638d576b3a7c407d136f2fb62399', 'third_party/markupsafe': - Var('chromium_url') + '/chromium/src/third_party/markupsafe.git' + '@' + '1b882ef6372b58bfd55a3285f37ed801be9137cd', + Var('chromium_url') + '/chromium/src/third_party/markupsafe.git' + '@' + '13f4e8c9e206567eeb13bf585406ddc574005748', + 'third_party/ninja': { + 'packages': [ + { + 'package': 'infra/3pp/tools/ninja/${{platform}}', + 'version': Var('ninja_version'), + } + ], + 'dep_type': 'cipd', + 'condition': 'host_cpu != "s390" and host_cpu != "ppc"' + }, 'third_party/perfetto': Var('android_url') + '/platform/external/perfetto.git' + '@' + '0eba417b2c72264fa825dc21067b9adc9b8adf70', 'third_party/protobuf': @@ -249,9 +270,9 @@ deps = { 'condition': 'checkout_android', }, 'third_party/zlib': - Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '9f4113d3bae3285a4511fd7c827baf64b4f9eb4b', + Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '18d27fa10b237fdfcbd8f0c65c19fe009981a3bc', 'tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '0a2285903bf27182c56d8a1cc8b0e0d8a1ce8c31', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '3344dd8997f422862a1c5477b490b3611be31351', 'tools/luci-go': { 'packages': [ { @@ -485,7 +506,7 @@ hooks = [ '--arch=x64'], }, { - 'name': 'msan_chained_origins', + 'name': 'msan_chained_origins_xenial', 'pattern': '.', 'condition': 'checkout_instrumented_libraries', 'action': [ 'python3', @@ -493,11 +514,11 @@ hooks = [ '--no_resume', '--no_auth', '--bucket', 'chromium-instrumented-libraries', - '-s', 'third_party/instrumented_libraries/binaries/msan-chained-origins.tgz.sha1', + '-s', 'third_party/instrumented_libraries/binaries/msan-chained-origins-xenial.tgz.sha1', ], }, { - 'name': 'msan_no_origins', + 'name': 'msan_no_origins_xenial', 'pattern': '.', 'condition': 'checkout_instrumented_libraries', 'action': [ 'python3', @@ -505,7 +526,7 @@ hooks = [ '--no_resume', '--no_auth', '--bucket', 'chromium-instrumented-libraries', - '-s', 'third_party/instrumented_libraries/binaries/msan-no-origins.tgz.sha1', + '-s', 'third_party/instrumented_libraries/binaries/msan-no-origins-xenial.tgz.sha1', ], }, { @@ -543,6 +564,14 @@ hooks = [ 'condition': 'host_os != "aix"', 'action': ['python3', 'tools/clang/scripts/update.py'], }, + { + # This is supposed to support the same set of platforms as 'clang' above. + 'name': 'clang_coverage', + 'pattern': '.', + 'condition': 'checkout_clang_coverage_tools', + 'action': ['python3', 'tools/clang/scripts/update.py', + '--package=coverage_tools'], + }, { 'name': 'clang_tidy', 'pattern': '.', @@ -560,11 +589,11 @@ hooks = [ { 'name': 'Download Fuchsia system images', 'pattern': '.', - 'condition': 'checkout_fuchsia', + 'condition': 'checkout_fuchsia and checkout_fuchsia_product_bundles', 'action': [ 'python3', - 'build/fuchsia/update_images.py', - '--boot-images={checkout_fuchsia_boot_images}', + 'build/fuchsia/update_product_bundles.py', + '{checkout_fuchsia_boot_images}', ], }, { @@ -575,16 +604,6 @@ hooks = [ 'action': ['python3', 'tools/clang/scripts/update.py', '--package=objdump'], }, - # Download and initialize "vpython" VirtualEnv environment packages. - { - 'name': 'vpython_common', - 'pattern': '.', - 'condition': 'checkout_android', - 'action': [ 'vpython', - '-vpython-spec', '.vpython', - '-vpython-tool', 'install', - ], - }, { 'name': 'vpython3_common', 'pattern': '.', diff --git a/ENG_REVIEW_OWNERS b/ENG_REVIEW_OWNERS index 78d53b821d..4f80f9d15a 100644 --- a/ENG_REVIEW_OWNERS +++ b/ENG_REVIEW_OWNERS @@ -5,5 +5,6 @@ adamk@chromium.org danno@chromium.org hpayer@chromium.org +mlippautz@chromium.org verwaest@chromium.org vahl@chromium.org diff --git a/LICENSE b/LICENSE index 53d9c47e33..f665c480d2 100644 --- a/LICENSE +++ b/LICENSE @@ -15,8 +15,7 @@ are: - Strongtalk assembler, the basis of the files assembler-arm-inl.h, assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h, assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h, - assembler-x64.cc, assembler-x64.h, assembler-mips-inl.h, - assembler-mips.cc, assembler-mips.h, assembler.cc and assembler.h. + assembler-x64.cc, assembler-x64.h, assembler.cc and assembler.h. This code is copyrighted by Sun Microsystems Inc. and released under a 3-clause BSD license. diff --git a/OWNERS b/OWNERS index db579fb0e6..cd95b48bac 100644 --- a/OWNERS +++ b/OWNERS @@ -5,6 +5,7 @@ file:ENG_REVIEW_OWNERS per-file .*=file:INFRA_OWNERS per-file .bazelrc=file:COMMON_OWNERS per-file .mailmap=file:COMMON_OWNERS +per-file .ycm_extra_conf.py=file:COMMON_OWNERS per-file codereview.settings=file:INFRA_OWNERS per-file AUTHORS=file:COMMON_OWNERS per-file BUILD.bazel=file:COMMON_OWNERS diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 03db4c126f..5c31d4dfab 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -85,6 +85,7 @@ def _V8PresubmitChecks(input_api, output_api): sys.path.append(input_api.os_path.join( input_api.PresubmitLocalPath(), 'tools')) from v8_presubmit import CppLintProcessor + from v8_presubmit import GCMoleProcessor from v8_presubmit import JSLintProcessor from v8_presubmit import TorqueLintProcessor from v8_presubmit import SourceProcessor @@ -126,6 +127,9 @@ def _V8PresubmitChecks(input_api, output_api): if not StatusFilesProcessor().RunOnFiles( input_api.AffectedFiles(include_deletes=True)): results.append(output_api.PresubmitError("Status file check failed")) + if not GCMoleProcessor().RunOnFiles( + input_api.AffectedFiles(include_deletes=False)): + results.append(output_api.PresubmitError("GCMole pattern check failed")) results.extend(input_api.canned_checks.CheckAuthorizedAuthor( input_api, output_api, bot_allowlist=[ 'v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com' @@ -257,8 +261,9 @@ def _CheckHeadersHaveIncludeGuards(input_api, output_api): files_to_check=(file_inclusion_pattern, ), files_to_skip=files_to_skip) - leading_src_pattern = input_api.re.compile(r'^src/') - dash_dot_slash_pattern = input_api.re.compile(r'[-./]') + leading_src_pattern = input_api.re.compile(r'^src[\\\/]') + dash_dot_slash_pattern = input_api.re.compile(r'[-.\\\/]') + def PathToGuardMacro(path): """Guards should be of the form V8_PATH_TO_FILE_WITHOUT_SRC_H_.""" x = input_api.re.sub(leading_src_pattern, 'v8_', path) diff --git a/bazel/config/BUILD.bazel b/bazel/config/BUILD.bazel index 448260de88..7af7ccb606 100644 --- a/bazel/config/BUILD.bazel +++ b/bazel/config/BUILD.bazel @@ -22,6 +22,13 @@ config_setting( }, ) +config_setting( + name = "is_opt", + values = { + "compilation_mode": "opt", + }, +) + config_setting( name = "is_debug", values = { diff --git a/bazel/defs.bzl b/bazel/defs.bzl index e957c0fad3..8c3e3b9d1d 100644 --- a/bazel/defs.bzl +++ b/bazel/defs.bzl @@ -152,6 +152,14 @@ def _default_args(): ], "//conditions:default": [], }), + cxxopts = select({ + "//third_party/v8/HEAD/google3/config:is_opt": [ + "-fvisibility=hidden", + "-fvisibility-inlines-hidden", + ], + "//conditions:default": [ + ], + }), includes = ["include"], linkopts = select({ "@v8//bazel/config:is_windows": [ @@ -407,15 +415,19 @@ v8_target_cpu_transition = transition( ) def _mksnapshot(ctx): + prefix = ctx.attr.prefix + suffix = ctx.attr.suffix outs = [ - ctx.actions.declare_file(ctx.attr.prefix + "/snapshot.cc"), - ctx.actions.declare_file(ctx.attr.prefix + "/embedded.S"), + ctx.actions.declare_file(prefix + "/snapshot" + suffix + ".cc"), + ctx.actions.declare_file(prefix + "/embedded" + suffix + ".S"), ] ctx.actions.run( outputs = outs, inputs = [], arguments = [ "--embedded_variant=Default", + "--target_os", + ctx.attr.target_os, "--startup_src", outs[0].path, "--embedded_src", @@ -436,26 +448,38 @@ _v8_mksnapshot = rule( executable = True, cfg = "exec", ), + "target_os": attr.string(mandatory = True), "_allowlist_function_transition": attr.label( default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ), "prefix": attr.string(mandatory = True), + "suffix": attr.string(mandatory = True), }, cfg = v8_target_cpu_transition, ) -def v8_mksnapshot(name, args): +def v8_mksnapshot(name, args, suffix = ""): _v8_mksnapshot( name = "noicu/" + name, args = args, prefix = "noicu", - tool = ":noicu/mksnapshot", + tool = ":noicu/mksnapshot" + suffix, + suffix = suffix, + target_os = select({ + "@v8//bazel/config:is_macos": "mac", + "//conditions:default": "", + }), ) _v8_mksnapshot( name = "icu/" + name, args = args, prefix = "icu", - tool = ":icu/mksnapshot", + tool = ":icu/mksnapshot" + suffix, + suffix = suffix, + target_os = select({ + "@v8//bazel/config:is_macos": "mac", + "//conditions:default": "", + }), ) def _quote(val): @@ -494,6 +518,7 @@ def build_config_content(cpu, icu): ("v8_current_cpu", cpu), ("v8_dict_property_const_tracking", "false"), ("v8_enable_atomic_object_field_writes", "false"), + ("v8_enable_conservative_stack_scanning", "false"), ("v8_enable_concurrent_marking", "false"), ("v8_enable_i18n_support", icu), ("v8_enable_verify_predictable", "false"), diff --git a/gni/snapshot_toolchain.gni b/gni/snapshot_toolchain.gni index 637dcd39c4..99de816372 100644 --- a/gni/snapshot_toolchain.gni +++ b/gni/snapshot_toolchain.gni @@ -44,10 +44,6 @@ declare_args() { # # There are test cases for this code posted as an attachment to # https://crbug.com/625353. -# -# TODO(GYP): Currently only regular (non-cross) compiles, and cross-compiles -# from x64 hosts to Intel, ARM, or MIPS targets, are implemented. Add support -# for the other supported configurations. if (v8_snapshot_toolchain == "") { if (current_os == host_os && current_cpu == host_cpu) { @@ -64,28 +60,26 @@ if (v8_snapshot_toolchain == "") { current_cpu == "arm") { # Trying to compile 32-bit arm on arm64. Good luck! v8_snapshot_toolchain = current_toolchain - } else if (host_cpu == "x64" && - (v8_current_cpu == "mips" || v8_current_cpu == "mips64")) { + } else if (host_cpu == "x64" && v8_current_cpu == "mips64") { # We don't support snapshot generation for big-endian targets, # therefore snapshots will need to be built using native mksnapshot # in combination with qemu v8_snapshot_toolchain = current_toolchain + } else if (host_cpu == current_cpu) { + # Cross-build from same ISA on one OS to another. For example: + # * targeting win/x64 on a linux/x64 host + # * targeting win/arm64 on a mac/arm64 host + v8_snapshot_toolchain = host_toolchain } else if (host_cpu == "arm64" && current_cpu == "x64") { # Cross-build from arm64 to intel (likely on an Apple Silicon mac). v8_snapshot_toolchain = "//build/toolchain/${host_os}:clang_arm64_v8_$v8_current_cpu" } else if (host_cpu == "x64") { # This is a cross-compile from an x64 host to either a non-Intel target - # cpu or a different target OS. Clang will always be used by default on the - # host, unless this is a ChromeOS build, in which case the same toolchain - # (Clang or GCC) will be used for target and host by default. - if (is_chromeos && !is_clang) { - _clang = "" - } else { - _clang = "clang_" - } + # cpu or to 32-bit x86 on a different target OS. - if (v8_current_cpu == "x64" || v8_current_cpu == "x86") { + assert(v8_current_cpu != "x64", "handled by host_cpu == current_cpu branch") + if (v8_current_cpu == "x86") { _cpus = v8_current_cpu } else if (v8_current_cpu == "arm64" || v8_current_cpu == "mips64el" || v8_current_cpu == "riscv64" || v8_current_cpu == "loong64") { @@ -96,8 +90,7 @@ if (v8_snapshot_toolchain == "") { } else { _cpus = "x64_v8_${v8_current_cpu}" } - } else if (v8_current_cpu == "arm" || v8_current_cpu == "mipsel" || - v8_current_cpu == "riscv32") { + } else if (v8_current_cpu == "arm" || v8_current_cpu == "riscv32") { _cpus = "x86_v8_${v8_current_cpu}" } else { # This branch should not be reached; leave _cpus blank so the assert @@ -106,7 +99,7 @@ if (v8_snapshot_toolchain == "") { } if (_cpus != "") { - v8_snapshot_toolchain = "//build/toolchain/${host_os}:${_clang}${_cpus}" + v8_snapshot_toolchain = "//build/toolchain/${host_os}:clang_${_cpus}" } else if (is_win && v8_current_cpu == "arm64") { # cross compile Windows arm64 with host toolchain. v8_snapshot_toolchain = host_toolchain @@ -122,7 +115,6 @@ assert(v8_snapshot_toolchain != "", # avoid building v8_libbase on the host more than once. On mips with big endian, # the snapshot toolchain is the target toolchain and, hence, can't be used. v8_generator_toolchain = v8_snapshot_toolchain -if (host_cpu == "x64" && - (v8_current_cpu == "mips" || v8_current_cpu == "mips64")) { +if (host_cpu == "x64" && v8_current_cpu == "mips64") { v8_generator_toolchain = "//build/toolchain/linux:clang_x64" } diff --git a/gni/v8.gni b/gni/v8.gni index 3dd9fde0fa..f297eb379b 100644 --- a/gni/v8.gni +++ b/gni/v8.gni @@ -107,6 +107,9 @@ declare_args() { # Enable advanced BigInt algorithms, costing about 10-30 KB binary size # depending on platform. Disabled on Android to save binary size. v8_advanced_bigint_algorithms = !is_android + + # TODO: macros for determining endian type are clang specific. + v8_use_libm_trig_functions = is_clang } if (v8_use_external_startup_data == "") { @@ -199,8 +202,7 @@ if ((is_posix || is_fuchsia) && } # On MIPS gcc_target_rpath and ldso_path might be needed for all builds. -if (target_cpu == "mipsel" || target_cpu == "mips64el" || - target_cpu == "mips" || target_cpu == "mips64") { +if (target_cpu == "mips64el" || target_cpu == "mips64") { v8_add_configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] } diff --git a/include/cppgc/README.md b/include/cppgc/README.md index a7d08f86b3..d825ea5bd5 100644 --- a/include/cppgc/README.md +++ b/include/cppgc/README.md @@ -26,6 +26,8 @@ This allows Oilpan to run garbage collection in parallel with mutators running i References to objects belonging to another thread's heap are modeled using cross-thread roots. This is even true for on-heap to on-heap references. +Oilpan heaps may generally not be accessed from different threads unless otherwise noted. + ## Heap partitioning Oilpan's heaps are partitioned into spaces. diff --git a/include/cppgc/heap-handle.h b/include/cppgc/heap-handle.h index 5a0f9cd2ed..0d1d21e65d 100644 --- a/include/cppgc/heap-handle.h +++ b/include/cppgc/heap-handle.h @@ -12,12 +12,18 @@ namespace cppgc { namespace internal { class HeapBase; class WriteBarrierTypeForCagedHeapPolicy; +class WriteBarrierTypeForNonCagedHeapPolicy; } // namespace internal /** * Opaque handle used for additional heap APIs. */ class HeapHandle { + public: + // Deleted copy ctor to avoid treating the type by value. + HeapHandle(const HeapHandle&) = delete; + HeapHandle& operator=(const HeapHandle&) = delete; + private: HeapHandle() = default; @@ -34,6 +40,7 @@ class HeapHandle { friend class internal::HeapBase; friend class internal::WriteBarrierTypeForCagedHeapPolicy; + friend class internal::WriteBarrierTypeForNonCagedHeapPolicy; }; } // namespace cppgc diff --git a/include/cppgc/internal/api-constants.h b/include/cppgc/internal/api-constants.h index 82caf3fd37..023426e94b 100644 --- a/include/cppgc/internal/api-constants.h +++ b/include/cppgc/internal/api-constants.h @@ -47,10 +47,7 @@ constexpr size_t kCagedHeapReservationSize = static_cast(2) * kGB; constexpr size_t kCagedHeapReservationSize = static_cast(4) * kGB; #endif // !defined(CPPGC_2GB_CAGE) constexpr size_t kCagedHeapReservationAlignment = kCagedHeapReservationSize; - -constexpr size_t kCagedHeapNormalPageReservationSize = - kCagedHeapReservationSize / 2; -#endif +#endif // defined(CPPGC_CAGED_HEAP) static constexpr size_t kDefaultAlignment = sizeof(void*); diff --git a/include/cppgc/internal/caged-heap-local-data.h b/include/cppgc/internal/caged-heap-local-data.h index ffe14550b5..7d689f87e7 100644 --- a/include/cppgc/internal/caged-heap-local-data.h +++ b/include/cppgc/internal/caged-heap-local-data.h @@ -25,6 +25,7 @@ namespace cppgc { namespace internal { class HeapBase; +class HeapBaseHandle; #if defined(CPPGC_YOUNG_GENERATION) @@ -92,8 +93,6 @@ static_assert(sizeof(AgeTable) == 1 * api_constants::kMB, #endif // CPPGC_YOUNG_GENERATION -// TODO(v8:12231): Remove this class entirely so that it doesn't occupy space is -// when CPPGC_YOUNG_GENERATION is off. struct CagedHeapLocalData final { V8_INLINE static CagedHeapLocalData& Get() { return *reinterpret_cast(CagedHeapBase::GetBase()); diff --git a/include/cppgc/internal/caged-heap.h b/include/cppgc/internal/caged-heap.h index 09645366b1..4db42aee08 100644 --- a/include/cppgc/internal/caged-heap.h +++ b/include/cppgc/internal/caged-heap.h @@ -45,33 +45,11 @@ class V8_EXPORT CagedHeapBase { kHalfWordShift); } - V8_INLINE static bool IsWithinNormalPageReservation(void* address) { - return (reinterpret_cast(address) - g_heap_base_) < - api_constants::kCagedHeapNormalPageReservationSize; - } - - V8_INLINE static bool IsWithinLargePageReservation(const void* ptr) { - CPPGC_DCHECK(g_heap_base_); - auto uptr = reinterpret_cast(ptr); - return (uptr >= g_heap_base_ + - api_constants::kCagedHeapNormalPageReservationSize) && - (uptr < g_heap_base_ + api_constants::kCagedHeapReservationSize); - } - V8_INLINE static uintptr_t GetBase() { return g_heap_base_; } - V8_INLINE static BasePageHandle& LookupPageFromInnerPointer(void* ptr) { - if (V8_LIKELY(IsWithinNormalPageReservation(ptr))) - return *BasePageHandle::FromPayload(ptr); - else - return LookupLargePageFromInnerPointer(ptr); - } - private: friend class CagedHeap; - static BasePageHandle& LookupLargePageFromInnerPointer(void* address); - static uintptr_t g_heap_base_; }; diff --git a/include/cppgc/internal/member-storage.h b/include/cppgc/internal/member-storage.h index 98389b8cd3..0eb6382070 100644 --- a/include/cppgc/internal/member-storage.h +++ b/include/cppgc/internal/member-storage.h @@ -61,7 +61,7 @@ class CageBaseGlobal final { #undef CPPGC_REQUIRE_CONSTANT_INIT #undef CPPGC_CONST -class CompressedPointer final { +class V8_TRIVIAL_ABI CompressedPointer final { public: using IntegralType = uint32_t; @@ -170,7 +170,7 @@ class CompressedPointer final { #endif // defined(CPPGC_POINTER_COMPRESSION) -class RawPointer final { +class V8_TRIVIAL_ABI RawPointer final { public: using IntegralType = uintptr_t; diff --git a/include/cppgc/internal/write-barrier.h b/include/cppgc/internal/write-barrier.h index 4d4fde6873..37bc5c973e 100644 --- a/include/cppgc/internal/write-barrier.h +++ b/include/cppgc/internal/write-barrier.h @@ -12,6 +12,7 @@ #include "cppgc/heap-state.h" #include "cppgc/internal/api-constants.h" #include "cppgc/internal/atomic-entry-flag.h" +#include "cppgc/internal/base-page-handle.h" #include "cppgc/internal/member-storage.h" #include "cppgc/platform.h" #include "cppgc/sentinel-pointer.h" @@ -268,8 +269,8 @@ struct WriteBarrierTypeForCagedHeapPolicy::ValueModeDispatch< if (V8_LIKELY(!WriteBarrier::IsEnabled())) return SetAndReturnType(params); -#if defined(CPPGC_YOUNG_GENERATION) HeapHandle& handle = callback(); +#if defined(CPPGC_YOUNG_GENERATION) if (V8_LIKELY(!handle.is_incremental_marking_in_progress())) { if (!handle.is_young_generation_enabled()) { return WriteBarrier::Type::kNone; @@ -283,8 +284,7 @@ struct WriteBarrierTypeForCagedHeapPolicy::ValueModeDispatch< return SetAndReturnType(params); } #else // !defined(CPPGC_YOUNG_GENERATION) - HeapHandle& handle = callback(); - if (V8_UNLIKELY(!subtle::HeapState::IsMarking(handle))) { + if (V8_UNLIKELY(!handle.is_incremental_marking_in_progress())) { return SetAndReturnType(params); } #endif // !defined(CPPGC_YOUNG_GENERATION) @@ -327,11 +327,6 @@ class V8_EXPORT WriteBarrierTypeForNonCagedHeapPolicy final { template struct ValueModeDispatch; - // TODO(chromium:1056170): Create fast path on API. - static bool IsMarking(const void*, HeapHandle**); - // TODO(chromium:1056170): Create fast path on API. - static bool IsMarking(HeapHandle&); - WriteBarrierTypeForNonCagedHeapPolicy() = delete; }; @@ -349,7 +344,13 @@ struct WriteBarrierTypeForNonCagedHeapPolicy::ValueModeDispatch< if (V8_LIKELY(!WriteBarrier::IsEnabled())) { return SetAndReturnType(params); } - if (IsMarking(object, ¶ms.heap)) { + // We know that |object| is within the normal page or in the beginning of a + // large page, so extract the page header by bitmasking. + BasePageHandle* page = + BasePageHandle::FromPayload(const_cast(object)); + + HeapHandle& heap_handle = page->heap_handle(); + if (V8_LIKELY(heap_handle.is_incremental_marking_in_progress())) { return SetAndReturnType(params); } return SetAndReturnType(params); @@ -365,7 +366,7 @@ struct WriteBarrierTypeForNonCagedHeapPolicy::ValueModeDispatch< HeapHandleCallback callback) { if (V8_UNLIKELY(WriteBarrier::IsEnabled())) { HeapHandle& handle = callback(); - if (IsMarking(handle)) { + if (V8_LIKELY(handle.is_incremental_marking_in_progress())) { params.heap = &handle; return SetAndReturnType(params); } diff --git a/include/cppgc/member.h b/include/cppgc/member.h index 71f9cab652..9bc383634f 100644 --- a/include/cppgc/member.h +++ b/include/cppgc/member.h @@ -28,7 +28,7 @@ namespace internal { // MemberBase always refers to the object as const object and defers to // BasicMember on casting to the right type as needed. -class MemberBase { +class V8_TRIVIAL_ABI MemberBase { public: #if defined(CPPGC_POINTER_COMPRESSION) using RawStorage = CompressedPointer; @@ -68,13 +68,16 @@ class MemberBase { V8_INLINE void ClearFromGC() const { raw_.Clear(); } private: + friend class MemberDebugHelper; + mutable RawStorage raw_; }; // The basic class from which all Member classes are 'generated'. template -class BasicMember final : private MemberBase, private CheckingPolicy { +class V8_TRIVIAL_ABI BasicMember final : private MemberBase, + private CheckingPolicy { public: using PointeeType = T; diff --git a/include/cppgc/platform.h b/include/cppgc/platform.h index d2fe7b124c..5a0a40ec8c 100644 --- a/include/cppgc/platform.h +++ b/include/cppgc/platform.h @@ -33,8 +33,9 @@ class V8_EXPORT Platform { virtual ~Platform() = default; /** - * Returns the allocator used by cppgc to allocate its heap and various - * support structures. + * \returns the allocator used by cppgc to allocate its heap and various + * support structures. Returning nullptr results in using the `PageAllocator` + * provided by `cppgc::InitializeProcess()` instead. */ virtual PageAllocator* GetPageAllocator() = 0; @@ -133,9 +134,10 @@ class V8_EXPORT Platform { * Can be called multiple times when paired with `ShutdownProcess()`. * * \param page_allocator The allocator used for maintaining meta data. Must stay - * always alive and not change between multiple calls to InitializeProcess. + * always alive and not change between multiple calls to InitializeProcess. If + * no allocator is provided, a default internal version will be used. */ -V8_EXPORT void InitializeProcess(PageAllocator* page_allocator); +V8_EXPORT void InitializeProcess(PageAllocator* page_allocator = nullptr); /** * Must be called after destroying the last used heap. Some process-global diff --git a/include/js_protocol-1.3.json b/include/js_protocol-1.3.json index ea573d11a6..a998d4611d 100644 --- a/include/js_protocol-1.3.json +++ b/include/js_protocol-1.3.json @@ -946,34 +946,6 @@ { "name": "url", "type": "string", "description": "JavaScript script name or url." }, { "name": "functions", "type": "array", "items": { "$ref": "FunctionCoverage" }, "description": "Functions contained in the script that has coverage data." } ] - }, - { "id": "TypeObject", - "type": "object", - "description": "Describes a type collected during runtime.", - "properties": [ - { "name": "name", "type": "string", "description": "Name of a type collected with type profiling." } - ], - "experimental": true - }, - { "id": "TypeProfileEntry", - "type": "object", - "description": "Source offset and types for a parameter or return value.", - "properties": [ - { "name": "offset", "type": "integer", "description": "Source offset of the parameter or end of function for return values." }, - { "name": "types", "type": "array", "items": {"$ref": "TypeObject"}, "description": "The types for this parameter or return value."} - ], - "experimental": true - }, - { - "id": "ScriptTypeProfile", - "type": "object", - "description": "Type profile data collected during runtime for a JavaScript script.", - "properties": [ - { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "JavaScript script id." }, - { "name": "url", "type": "string", "description": "JavaScript script name or url." }, - { "name": "entries", "type": "array", "items": { "$ref": "TypeProfileEntry" }, "description": "Type profile entries for parameters and return values of the functions in the script." } - ], - "experimental": true } ], "commands": [ @@ -1024,24 +996,6 @@ { "name": "result", "type": "array", "items": { "$ref": "ScriptCoverage" }, "description": "Coverage data for the current isolate." } ], "description": "Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection." - }, - { - "name": "startTypeProfile", - "description": "Enable type profile.", - "experimental": true - }, - { - "name": "stopTypeProfile", - "description": "Disable type profile. Disabling releases type profile data collected so far.", - "experimental": true - }, - { - "name": "takeTypeProfile", - "returns": [ - { "name": "result", "type": "array", "items": { "$ref": "ScriptTypeProfile" }, "description": "Type profile for all scripts since startTypeProfile() was turned on." } - ], - "description": "Collect type profile.", - "experimental": true } ], "events": [ diff --git a/include/js_protocol.pdl b/include/js_protocol.pdl index 8d8211bf98..6efcf78785 100644 --- a/include/js_protocol.pdl +++ b/include/js_protocol.pdl @@ -458,13 +458,14 @@ domain Debugger # New value for breakpoints active state. boolean active - # Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or - # no exceptions. Initial pause on exceptions state is `none`. + # Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions, + # or caught exceptions, no exceptions. Initial pause on exceptions state is `none`. command setPauseOnExceptions parameters # Pause on exceptions mode. enum state none + caught uncaught all @@ -766,6 +767,22 @@ experimental domain HeapProfiler # Average sample interval in bytes. Poisson distribution is used for the intervals. The # default value is 32768 bytes. optional number samplingInterval + # By default, the sampling heap profiler reports only objects which are + # still alive when the profile is returned via getSamplingProfile or + # stopSampling, which is useful for determining what functions contribute + # the most to steady-state memory usage. This flag instructs the sampling + # heap profiler to also include information about objects discarded by + # major GC, which will show which functions cause large temporary memory + # usage or long GC pauses. + optional boolean includeObjectsCollectedByMajorGC + # By default, the sampling heap profiler reports only objects which are + # still alive when the profile is returned via getSamplingProfile or + # stopSampling, which is useful for determining what functions contribute + # the most to steady-state memory usage. This flag instructs the sampling + # heap profiler to also include information about objects discarded by + # minor GC, which is useful when tuning a latency-sensitive application + # for minimal GC activity. + optional boolean includeObjectsCollectedByMinorGC command startTrackingHeapObjects parameters @@ -902,30 +919,6 @@ domain Profiler # Functions contained in the script that has coverage data. array of FunctionCoverage functions - # Describes a type collected during runtime. - experimental type TypeObject extends object - properties - # Name of a type collected with type profiling. - string name - - # Source offset and types for a parameter or return value. - experimental type TypeProfileEntry extends object - properties - # Source offset of the parameter or end of function for return values. - integer offset - # The types for this parameter or return value. - array of TypeObject types - - # Type profile data collected during runtime for a JavaScript script. - experimental type ScriptTypeProfile extends object - properties - # JavaScript script id. - Runtime.ScriptId scriptId - # JavaScript script name or url. - string url - # Type profile entries for parameters and return values of the functions in the script. - array of TypeProfileEntry entries - command disable command enable @@ -960,9 +953,6 @@ domain Profiler # Monotonically increasing time (in seconds) when the coverage update was taken in the backend. number timestamp - # Enable type profile. - experimental command startTypeProfile - command stop returns # Recorded profile. @@ -972,9 +962,6 @@ domain Profiler # executing optimized code. command stopPreciseCoverage - # Disable type profile. Disabling releases type profile data collected so far. - experimental command stopTypeProfile - # Collect coverage data for the current isolate, and resets execution counters. Precise code # coverage needs to have started. command takePreciseCoverage @@ -984,12 +971,6 @@ domain Profiler # Monotonically increasing time (in seconds) when the coverage update was taken in the backend. number timestamp - # Collect type profile. - experimental command takeTypeProfile - returns - # Type profile for all scripts since startTypeProfile() was turned on. - array of ScriptTypeProfile result - event consoleProfileFinished parameters string id diff --git a/include/libplatform/v8-tracing.h b/include/libplatform/v8-tracing.h index 12489327c5..6039a9c520 100644 --- a/include/libplatform/v8-tracing.h +++ b/include/libplatform/v8-tracing.h @@ -282,12 +282,12 @@ class V8_PLATFORM_EXPORT TracingController const char* name, uint64_t handle) override; static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag); -#endif // !defined(V8_USE_PERFETTO) void AddTraceStateObserver( v8::TracingController::TraceStateObserver* observer) override; void RemoveTraceStateObserver( v8::TracingController::TraceStateObserver* observer) override; +#endif // !defined(V8_USE_PERFETTO) void StartTracing(TraceConfig* trace_config); void StopTracing(); @@ -307,7 +307,6 @@ class V8_PLATFORM_EXPORT TracingController std::unique_ptr mutex_; std::unique_ptr trace_config_; std::atomic_bool recording_{false}; - std::unordered_set observers_; #if defined(V8_USE_PERFETTO) std::ostream* output_stream_ = nullptr; @@ -316,6 +315,7 @@ class V8_PLATFORM_EXPORT TracingController TraceEventListener* listener_for_testing_ = nullptr; std::unique_ptr tracing_session_; #else // !defined(V8_USE_PERFETTO) + std::unordered_set observers_; std::unique_ptr trace_buffer_; #endif // !defined(V8_USE_PERFETTO) diff --git a/include/v8-array-buffer.h b/include/v8-array-buffer.h index bab840f82c..804fc42c4b 100644 --- a/include/v8-array-buffer.h +++ b/include/v8-array-buffer.h @@ -53,12 +53,28 @@ class V8_EXPORT BackingStore : public v8::internal::BackingStoreBase { */ size_t ByteLength() const; + /** + * The maximum length (in bytes) that this backing store may grow to. + * + * If this backing store was created for a resizable ArrayBuffer or a growable + * SharedArrayBuffer, it is >= ByteLength(). Otherwise it is == + * ByteLength(). + */ + size_t MaxByteLength() const; + /** * Indicates whether the backing store was created for an ArrayBuffer or * a SharedArrayBuffer. */ bool IsShared() const; + /** + * Indicates whether the backing store was created for a resizable ArrayBuffer + * or a growable SharedArrayBuffer, and thus may be resized by user JavaScript + * code. + */ + bool IsResizableByUserJavaScript() const; + /** * Prevent implicit instantiation of operator delete with size_t argument. * The size_t argument would be incorrect because ptr points to the @@ -189,6 +205,11 @@ class V8_EXPORT ArrayBuffer : public Object { */ size_t ByteLength() const; + /** + * Maximum length in bytes. + */ + size_t MaxByteLength() const; + /** * Create a new ArrayBuffer. Allocate |byte_length| bytes. * Allocated memory will be owned by a created ArrayBuffer and @@ -235,24 +256,65 @@ class V8_EXPORT ArrayBuffer : public Object { void* data, size_t byte_length, v8::BackingStore::DeleterCallback deleter, void* deleter_data); + /** + * Returns a new resizable standalone BackingStore that is allocated using the + * array buffer allocator of the isolate. The result can be later passed to + * ArrayBuffer::New. + * + * |byte_length| must be <= |max_byte_length|. + * + * This function is usable without an isolate. Unlike |NewBackingStore| calls + * with an isolate, GCs cannot be triggered, and there are no + * retries. Allocation failure will cause the function to crash with an + * out-of-memory error. + */ + static std::unique_ptr NewResizableBackingStore( + size_t byte_length, size_t max_byte_length); + /** * Returns true if this ArrayBuffer may be detached. */ bool IsDetachable() const; + /** + * Returns true if this ArrayBuffer has been detached. + */ + bool WasDetached() const; + /** * Detaches this ArrayBuffer and all its views (typed arrays). * Detaching sets the byte length of the buffer and all typed arrays to zero, * preventing JavaScript from ever accessing underlying backing store. * ArrayBuffer should have been externalized and must be detachable. */ + V8_DEPRECATE_SOON( + "Use the version which takes a key parameter (passing a null handle is " + "ok).") void Detach(); + /** + * Detaches this ArrayBuffer and all its views (typed arrays). + * Detaching sets the byte length of the buffer and all typed arrays to zero, + * preventing JavaScript from ever accessing underlying backing store. + * ArrayBuffer should have been externalized and must be detachable. Returns + * Nothing if the key didn't pass the [[ArrayBufferDetachKey]] check, + * Just(true) otherwise. + */ + V8_WARN_UNUSED_RESULT Maybe Detach(v8::Local key); + + /** + * Sets the ArrayBufferDetachKey. + */ + void SetDetachKey(v8::Local key); + /** * Get a shared pointer to the backing store of this array buffer. This * pointer coordinates the lifetime management of the internal storage * with any live ArrayBuffers on the heap, even across isolates. The embedder * should not attempt to manage lifetime of the storage through other means. + * + * The returned shared pointer will not be empty, even if the ArrayBuffer has + * been detached. Use |WasDetached| to tell if it has been detached instead. */ std::shared_ptr GetBackingStore(); @@ -366,6 +428,11 @@ class V8_EXPORT SharedArrayBuffer : public Object { */ size_t ByteLength() const; + /** + * Maximum length in bytes. + */ + size_t MaxByteLength() const; + /** * Create a new SharedArrayBuffer. Allocate |byte_length| bytes. * Allocated memory will be owned by a created SharedArrayBuffer and diff --git a/include/v8-callbacks.h b/include/v8-callbacks.h index c02059a589..0ffdfb6656 100644 --- a/include/v8-callbacks.h +++ b/include/v8-callbacks.h @@ -237,7 +237,8 @@ using LogEventCallback = void (*)(const char* name, enum class CrashKeyId { kIsolateAddress, kReadonlySpaceFirstPageAddress, - kMapSpaceFirstPageAddress, + kMapSpaceFirstPageAddress V8_ENUM_DEPRECATE_SOON("Map space got removed"), + kOldSpaceFirstPageAddress, kCodeRangeBaseAddress, kCodeSpaceFirstPageAddress, kDumpType, diff --git a/include/v8-context.h b/include/v8-context.h index be52c414b4..3ce0eb0af3 100644 --- a/include/v8-context.h +++ b/include/v8-context.h @@ -169,6 +169,9 @@ class V8_EXPORT Context : public Data { /** Returns the microtask queue associated with a current context. */ MicrotaskQueue* GetMicrotaskQueue(); + /** Sets the microtask queue associated with the current context. */ + void SetMicrotaskQueue(MicrotaskQueue* queue); + /** * The field at kDebugIdIndex used to be reserved for the inspector. * It now serves no purpose. @@ -290,6 +293,7 @@ class V8_EXPORT Context : public Data { Local after_hook, Local resolve_hook); + bool HasTemplateLiteralObject(Local object); /** * Stack-allocated class which sets the execution context for all * operations executed within a local scope. diff --git a/include/v8-cppgc.h b/include/v8-cppgc.h index 8c7dc28b7e..7e38833163 100644 --- a/include/v8-cppgc.h +++ b/include/v8-cppgc.h @@ -103,6 +103,10 @@ struct CppHeapCreateParams { /** * A heap for allocating managed C++ objects. + * + * Similar to v8::Isolate, the heap may only be accessed from one thread at a + * time. The heap may be used from different threads using the + * v8::Locker/v8::Unlocker APIs which is different from generic Oilpan. */ class V8_EXPORT CppHeap { public: diff --git a/include/v8-data.h b/include/v8-data.h index cc51fefe10..fc4dea92f3 100644 --- a/include/v8-data.h +++ b/include/v8-data.h @@ -53,7 +53,7 @@ class V8_EXPORT Data { bool IsContext() const; private: - Data(); + Data() = delete; }; /** diff --git a/include/v8-embedder-heap.h b/include/v8-embedder-heap.h index d3920c5f3b..f994cdfdf3 100644 --- a/include/v8-embedder-heap.h +++ b/include/v8-embedder-heap.h @@ -72,7 +72,7 @@ class V8_EXPORT EmbedderRootsHandler { class V8_EXPORT // GCC doesn't like combining __attribute__(()) with [[deprecated]]. #ifdef __clang__ -V8_DEPRECATE_SOON("Use CppHeap when working with v8::TracedReference.") +V8_DEPRECATED("Use CppHeap when working with v8::TracedReference.") #endif // __clang__ EmbedderHeapTracer { public: diff --git a/include/v8-fast-api-calls.h b/include/v8-fast-api-calls.h index 1826f13321..0fe7cd2489 100644 --- a/include/v8-fast-api-calls.h +++ b/include/v8-fast-api-calls.h @@ -247,7 +247,9 @@ class CTypeInfo { kUint64, kFloat32, kFloat64, + kPointer, kV8Value, + kSeqOneByteString, kApiObject, // This will be deprecated once all users have // migrated from v8::ApiObject to v8::Local. kAny, // This is added to enable untyped representation of fast @@ -379,6 +381,11 @@ struct FastApiArrayBuffer { size_t byte_length; }; +struct FastOneByteString { + const char* data; + uint32_t length; +}; + class V8_EXPORT CFunctionInfo { public: // Construct a struct to hold a CFunction's type information. @@ -429,6 +436,7 @@ struct AnyCType { uint64_t uint64_value; float float_value; double double_value; + void* pointer_value; Local object_value; Local sequence_value; const FastApiTypedArray* uint8_ta_value; @@ -438,6 +446,7 @@ struct AnyCType { const FastApiTypedArray* uint64_ta_value; const FastApiTypedArray* float_ta_value; const FastApiTypedArray* double_ta_value; + const FastOneByteString* string_value; FastApiCallbackOptions* options_value; }; }; @@ -613,8 +622,9 @@ class CFunctionInfoImpl : public CFunctionInfo { kReturnType == CTypeInfo::Type::kUint32 || kReturnType == CTypeInfo::Type::kFloat32 || kReturnType == CTypeInfo::Type::kFloat64 || + kReturnType == CTypeInfo::Type::kPointer || kReturnType == CTypeInfo::Type::kAny, - "64-bit int and api object values are not currently " + "64-bit int, string and api object values are not currently " "supported return types."); } @@ -651,13 +661,14 @@ struct CTypeInfoTraits {}; #define PRIMITIVE_C_TYPES(V) \ V(bool, kBool) \ + V(uint8_t, kUint8) \ V(int32_t, kInt32) \ V(uint32_t, kUint32) \ V(int64_t, kInt64) \ V(uint64_t, kUint64) \ V(float, kFloat32) \ V(double, kFloat64) \ - V(uint8_t, kUint8) + V(void*, kPointer) // Same as above, but includes deprecated types for compatibility. #define ALL_C_TYPES(V) \ @@ -691,13 +702,13 @@ PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS) }; #define TYPED_ARRAY_C_TYPES(V) \ + V(uint8_t, kUint8) \ V(int32_t, kInt32) \ V(uint32_t, kUint32) \ V(int64_t, kInt64) \ V(uint64_t, kUint64) \ V(float, kFloat32) \ - V(double, kFloat64) \ - V(uint8_t, kUint8) + V(double, kFloat64) TYPED_ARRAY_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA) @@ -735,6 +746,18 @@ struct TypeInfoHelper { } }; +template <> +struct TypeInfoHelper { + static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; } + + static constexpr CTypeInfo::Type Type() { + return CTypeInfo::Type::kSeqOneByteString; + } + static constexpr CTypeInfo::SequenceType SequenceType() { + return CTypeInfo::SequenceType::kScalar; + } +}; + #define STATIC_ASSERT_IMPLIES(COND, ASSERTION, MSG) \ static_assert(((COND) == 0) || (ASSERTION), MSG) diff --git a/include/v8-inspector.h b/include/v8-inspector.h index aa5a044afb..563ad196d6 100644 --- a/include/v8-inspector.h +++ b/include/v8-inspector.h @@ -32,19 +32,19 @@ namespace Debugger { namespace API { class SearchMatch; } -} +} // namespace Debugger namespace Runtime { namespace API { class RemoteObject; class StackTrace; class StackTraceId; -} -} +} // namespace API +} // namespace Runtime namespace Schema { namespace API { class Domain; } -} +} // namespace Schema } // namespace protocol class V8_EXPORT StringView { @@ -134,6 +134,13 @@ class V8_EXPORT V8DebuggerId { int64_t m_second = 0; }; +struct V8_EXPORT V8StackFrame { + StringView sourceURL; + StringView functionName; + int lineNumber; + int columnNumber; +}; + class V8_EXPORT V8StackTrace { public: virtual StringView firstNonEmptySourceURL() const = 0; @@ -151,6 +158,8 @@ class V8_EXPORT V8StackTrace { // Safe to pass between threads, drops async chain. virtual std::unique_ptr clone() = 0; + + virtual std::vector frames() const = 0; }; class V8_EXPORT V8InspectorSession { @@ -203,6 +212,9 @@ class V8_EXPORT V8InspectorSession { std::unique_ptr* objectGroup) = 0; virtual void releaseObjectGroup(StringView) = 0; virtual void triggerPreciseCoverageDeltaUpdate(StringView occasion) = 0; + + // Prepare for shutdown (disables debugger pausing, etc.). + virtual void stop() = 0; }; class V8_EXPORT WebDriverValue { @@ -365,9 +377,12 @@ class V8_EXPORT V8Inspector { virtual void flushProtocolNotifications() = 0; }; enum ClientTrustLevel { kUntrusted, kFullyTrusted }; + enum SessionPauseState { kWaitingForDebugger, kNotWaitingForDebugger }; + // TODO(chromium:1352175): remove default value once downstream change lands. virtual std::unique_ptr connect( int contextGroupId, Channel*, StringView state, - ClientTrustLevel client_trust_level) { + ClientTrustLevel client_trust_level, + SessionPauseState = kNotWaitingForDebugger) { return nullptr; } diff --git a/include/v8-internal.h b/include/v8-internal.h index ed6aff1426..c56130300f 100644 --- a/include/v8-internal.h +++ b/include/v8-internal.h @@ -52,6 +52,7 @@ const int kHeapObjectTag = 1; const int kWeakHeapObjectTag = 3; const int kHeapObjectTagSize = 2; const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1; +const intptr_t kHeapObjectReferenceTagMask = 1 << (kHeapObjectTagSize - 1); // Tag information for fowarding pointers stored in object headers. // 0b00 at the lowest 2 bits in the header indicates that the map word is a @@ -181,7 +182,7 @@ constexpr size_t kSandboxSizeLog2 = 37; // 128 GB #else // Everywhere else use a 1TB sandbox. constexpr size_t kSandboxSizeLog2 = 40; // 1 TB -#endif // V8_OS_ANDROID +#endif // V8_TARGET_OS_ANDROID constexpr size_t kSandboxSize = 1ULL << kSandboxSizeLog2; // Required alignment of the sandbox. For simplicity, we require the @@ -222,6 +223,21 @@ static_assert(kSandboxMinimumReservationSize > kPtrComprCageReservationSize, "The minimum reservation size for a sandbox must be larger than " "the pointer compression cage contained within it."); +// The maximum buffer size allowed inside the sandbox. This is mostly dependent +// on the size of the guard regions around the sandbox: an attacker must not be +// able to construct a buffer that appears larger than the guard regions and +// thereby "reach out of" the sandbox. +constexpr size_t kMaxSafeBufferSizeForSandbox = 32ULL * GB - 1; +static_assert(kMaxSafeBufferSizeForSandbox <= kSandboxGuardRegionSize, + "The maximum allowed buffer size must not be larger than the " + "sandbox's guard regions"); + +constexpr size_t kBoundedSizeShift = 29; +static_assert(1ULL << (64 - kBoundedSizeShift) == + kMaxSafeBufferSizeForSandbox + 1, + "The maximum size of a BoundedSize must be synchronized with the " + "kMaxSafeBufferSizeForSandbox"); + #endif // V8_ENABLE_SANDBOX #ifdef V8_COMPRESS_POINTERS @@ -231,7 +247,7 @@ static_assert(kSandboxMinimumReservationSize > kPtrComprCageReservationSize, // size allows omitting bounds checks on table accesses if the indices are // guaranteed (e.g. through shifting) to be below the maximum index. This // value must be a power of two. -static const size_t kExternalPointerTableReservationSize = 128 * MB; +static const size_t kExternalPointerTableReservationSize = 512 * MB; // The maximum number of entries in an external pointer table. static const size_t kMaxExternalPointers = @@ -240,7 +256,7 @@ static const size_t kMaxExternalPointers = // The external pointer table indices stored in HeapObjects as external // pointers are shifted to the left by this amount to guarantee that they are // smaller than the maximum table size. -static const uint32_t kExternalPointerIndexShift = 8; +static const uint32_t kExternalPointerIndexShift = 6; static_assert((1 << (32 - kExternalPointerIndexShift)) == kMaxExternalPointers, "kExternalPointerTableReservationSize and " "kExternalPointerIndexShift don't match"); @@ -329,6 +345,14 @@ using ExternalPointer_t = Address; // that the Embedder is not using this byte (really only this one bit) for any // other purpose. This bit also does not collide with the memory tagging // extension (MTE) which would use bits [56, 60). +// +// External pointer tables are also available even when the sandbox is off but +// pointer compression is on. In that case, the mechanism can be used to easy +// alignment requirements as it turns unaligned 64-bit raw pointers into +// aligned 32-bit indices. To "opt-in" to the external pointer table mechanism +// for this purpose, instead of using the ExternalPointer accessors one needs to +// use ExternalPointerHandles directly and use them to access the pointers in an +// ExternalPointerTable. constexpr uint64_t kExternalPointerMarkBit = 1ULL << 62; constexpr uint64_t kExternalPointerTagMask = 0x40ff000000000000; constexpr uint64_t kExternalPointerTagShift = 48; @@ -351,70 +375,58 @@ constexpr uint64_t kAllExternalPointerTypeTags[] = { 0b11001100, 0b11010001, 0b11010010, 0b11010100, 0b11011000, 0b11100001, 0b11100010, 0b11100100, 0b11101000, 0b11110000}; +#define TAG(i) \ + ((kAllExternalPointerTypeTags[i] << kExternalPointerTagShift) | \ + kExternalPointerMarkBit) + // clang-format off -// New entries should be added with state "sandboxed". + // When adding new tags, please ensure that the code using these tags is // "substitution-safe", i.e. still operate safely if external pointers of the // same type are swapped by an attacker. See comment above for more details. -#define TAG(i) (kAllExternalPointerTypeTags[i]) // Shared external pointers are owned by the shared Isolate and stored in the // shared external pointer table associated with that Isolate, where they can // be accessed from multiple threads at the same time. The objects referenced // in this way must therefore always be thread-safe. -#define SHARED_EXTERNAL_POINTER_TAGS(V) \ - V(kFirstSharedTag, sandboxed, TAG(0)) \ - V(kWaiterQueueNodeTag, sandboxed, TAG(0)) \ - V(kExternalStringResourceTag, sandboxed, TAG(1)) \ - V(kExternalStringResourceDataTag, sandboxed, TAG(2)) \ - V(kLastSharedTag, sandboxed, TAG(2)) +#define SHARED_EXTERNAL_POINTER_TAGS(V) \ + V(kFirstSharedTag, TAG(0)) \ + V(kWaiterQueueNodeTag, TAG(0)) \ + V(kExternalStringResourceTag, TAG(1)) \ + V(kExternalStringResourceDataTag, TAG(2)) \ + V(kLastSharedTag, TAG(2)) // External pointers using these tags are kept in a per-Isolate external // pointer table and can only be accessed when this Isolate is active. -#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) \ - V(kForeignForeignAddressTag, sandboxed, TAG(10)) \ - V(kNativeContextMicrotaskQueueTag, sandboxed, TAG(11)) \ - V(kEmbedderDataSlotPayloadTag, sandboxed, TAG(12)) \ - V(kExternalObjectValueTag, sandboxed, TAG(13)) \ - V(kCallHandlerInfoCallbackTag, sandboxed, TAG(14)) \ - V(kAccessorInfoGetterTag, sandboxed, TAG(15)) \ - V(kAccessorInfoSetterTag, sandboxed, TAG(16)) \ - V(kWasmInternalFunctionCallTargetTag, sandboxed, TAG(17)) \ - V(kWasmTypeInfoNativeTypeTag, sandboxed, TAG(18)) \ - V(kWasmExportedFunctionDataSignatureTag, sandboxed, TAG(19)) \ - V(kWasmContinuationJmpbufTag, sandboxed, TAG(20)) +#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) \ + V(kForeignForeignAddressTag, TAG(10)) \ + V(kNativeContextMicrotaskQueueTag, TAG(11)) \ + V(kEmbedderDataSlotPayloadTag, TAG(12)) \ +/* This tag essentially stands for a `void*` pointer in the V8 API, and */ \ +/* it is the Embedder's responsibility to ensure type safety (against */ \ +/* substitution) and lifetime validity of these objects. */ \ + V(kExternalObjectValueTag, TAG(13)) \ + V(kCallHandlerInfoCallbackTag, TAG(14)) \ + V(kAccessorInfoGetterTag, TAG(15)) \ + V(kAccessorInfoSetterTag, TAG(16)) \ + V(kWasmInternalFunctionCallTargetTag, TAG(17)) \ + V(kWasmTypeInfoNativeTypeTag, TAG(18)) \ + V(kWasmExportedFunctionDataSignatureTag, TAG(19)) \ + V(kWasmContinuationJmpbufTag, TAG(20)) \ + V(kArrayBufferExtensionTag, TAG(21)) // All external pointer tags. #define ALL_EXTERNAL_POINTER_TAGS(V) \ SHARED_EXTERNAL_POINTER_TAGS(V) \ PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) -// When the sandbox is enabled, external pointers marked as "sandboxed" above -// use the external pointer table (i.e. are sandboxed). This allows a gradual -// rollout of external pointer sandboxing. If the sandbox is off, no external -// pointers are sandboxed. -// -// Sandboxed external pointer tags are available when compressing pointers even -// when the sandbox is off. Some tags (e.g. kWaiterQueueNodeTag) are used -// manually with the external pointer table even when the sandbox is off to ease -// alignment requirements. -#define sandboxed(X) (X << kExternalPointerTagShift) | kExternalPointerMarkBit -#define unsandboxed(X) kUnsandboxedExternalPointerTag -#if defined(V8_COMPRESS_POINTERS) -#define EXTERNAL_POINTER_TAG_ENUM(Name, State, Bits) Name = State(Bits), -#else -#define EXTERNAL_POINTER_TAG_ENUM(Name, State, Bits) Name = unsandboxed(Bits), -#endif - +#define EXTERNAL_POINTER_TAG_ENUM(Name, Tag) Name = Tag, #define MAKE_TAG(HasMarkBit, TypeTag) \ ((static_cast(TypeTag) << kExternalPointerTagShift) | \ (HasMarkBit ? kExternalPointerMarkBit : 0)) enum ExternalPointerTag : uint64_t { // Empty tag value. Mostly used as placeholder. kExternalPointerNullTag = MAKE_TAG(0, 0b00000000), - // Tag to use for unsandboxed external pointers, which are still stored as - // raw pointers on the heap. - kUnsandboxedExternalPointerTag = MAKE_TAG(0, 0b00000000), // External pointer tag that will match any external pointer. Use with care! kAnyExternalPointerTag = MAKE_TAG(1, 0b11111111), // The free entry tag has all type bits set so every type check with a @@ -428,20 +440,11 @@ enum ExternalPointerTag : uint64_t { }; #undef MAKE_TAG -#undef unsandboxed -#undef sandboxed #undef TAG #undef EXTERNAL_POINTER_TAG_ENUM // clang-format on -// True if the external pointer is sandboxed and so must be referenced through -// an external pointer table. -V8_INLINE static constexpr bool IsSandboxedExternalPointerType( - ExternalPointerTag tag) { - return tag != kUnsandboxedExternalPointerTag; -} - // True if the external pointer must be accessed from the shared isolate's // external pointer table. V8_INLINE static constexpr bool IsSharedExternalPointerType( @@ -450,12 +453,10 @@ V8_INLINE static constexpr bool IsSharedExternalPointerType( } // Sanity checks. -#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \ - static_assert(!IsSandboxedExternalPointerType(Tag) || \ - IsSharedExternalPointerType(Tag)); +#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \ + static_assert(IsSharedExternalPointerType(Tag)); #define CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \ - static_assert(!IsSandboxedExternalPointerType(Tag) || \ - !IsSharedExternalPointerType(Tag)); + static_assert(!IsSharedExternalPointerType(Tag)); SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS) PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS) @@ -519,10 +520,6 @@ class Internals { // ExternalPointerTable layout guarantees. static const int kExternalPointerTableBufferOffset = 0; - static const int kExternalPointerTableCapacityOffset = - kExternalPointerTableBufferOffset + kApiSystemPointerSize; - static const int kExternalPointerTableFreelistHeadOffset = - kExternalPointerTableCapacityOffset + kApiInt32Size; static const int kExternalPointerTableSize = 4 * kApiSystemPointerSize; // IsolateData layout guarantees. @@ -532,7 +529,7 @@ class Internals { static const int kVariousBooleanFlagsOffset = kIsolateStackGuardOffset + kStackGuardSize; static const int kBuiltinTier0EntryTableOffset = - kVariousBooleanFlagsOffset + kApiSystemPointerSize; + kVariousBooleanFlagsOffset + 8; static const int kBuiltinTier0TableOffset = kBuiltinTier0EntryTableOffset + kBuiltinTier0EntryTableSize; static const int kIsolateEmbedderDataOffset = @@ -569,6 +566,8 @@ class Internals { static const int kNodeStateMask = 0x3; static const int kNodeStateIsWeakValue = 2; + static const int kTracedNodeClassIdOffset = kApiSystemPointerSize; + static const int kFirstNonstringType = 0x80; static const int kOddballType = 0x83; static const int kForeignType = 0xcc; @@ -778,24 +777,23 @@ class Internals { V8_INLINE static internal::Address ReadExternalPointerField( v8::Isolate* isolate, internal::Address heap_object_ptr, int offset) { #ifdef V8_ENABLE_SANDBOX - if (IsSandboxedExternalPointerType(tag)) { - // See src/sandbox/external-pointer-table-inl.h. Logic duplicated here so - // it can be inlined and doesn't require an additional call. - internal::Address* table = - IsSharedExternalPointerType(tag) - ? GetSharedExternalPointerTableBase(isolate) - : GetExternalPointerTableBase(isolate); - internal::ExternalPointerHandle handle = - ReadRawField(heap_object_ptr, offset); - uint32_t index = handle >> kExternalPointerIndexShift; - std::atomic* ptr = - reinterpret_cast*>(&table[index]); - internal::Address entry = - std::atomic_load_explicit(ptr, std::memory_order_relaxed); - return entry & ~tag; - } -#endif + static_assert(tag != kExternalPointerNullTag); + // See src/sandbox/external-pointer-table-inl.h. Logic duplicated here so + // it can be inlined and doesn't require an additional call. + internal::Address* table = IsSharedExternalPointerType(tag) + ? GetSharedExternalPointerTableBase(isolate) + : GetExternalPointerTableBase(isolate); + internal::ExternalPointerHandle handle = + ReadRawField(heap_object_ptr, offset); + uint32_t index = handle >> kExternalPointerIndexShift; + std::atomic* ptr = + reinterpret_cast*>(&table[index]); + internal::Address entry = + std::atomic_load_explicit(ptr, std::memory_order_relaxed); + return entry & ~tag; +#else return ReadRawField
(heap_object_ptr, offset); +#endif // V8_ENABLE_SANDBOX } #ifdef V8_COMPRESS_POINTERS diff --git a/include/v8-isolate.h b/include/v8-isolate.h index e1335d53ff..9659300751 100644 --- a/include/v8-isolate.h +++ b/include/v8-isolate.h @@ -233,7 +233,7 @@ class V8_EXPORT Isolate { * Explicitly specify a startup snapshot blob. The embedder owns the blob. * The embedder *must* ensure that the snapshot is from a trusted source. */ - StartupData* snapshot_blob = nullptr; + const StartupData* snapshot_blob = nullptr; /** * Enables the host application to provide a mechanism for recording @@ -535,6 +535,8 @@ class V8_EXPORT Isolate { kFunctionPrototypeArguments = 113, kFunctionPrototypeCaller = 114, kTurboFanOsrCompileStarted = 115, + kAsyncStackTaggingCreateTaskCall = 116, + kDurationFormat = 117, // If you add new values here, you'll also need to update Chromium's: // web_feature.mojom, use_counter_callback.cc, and enums.xml. V8 changes to @@ -952,22 +954,20 @@ class V8_EXPORT Isolate { * Attaches a managed C++ heap as an extension to the JavaScript heap. The * embedder maintains ownership of the CppHeap. At most one C++ heap can be * attached to V8. + * * AttachCppHeap cannot be used simultaneously with SetEmbedderHeapTracer. * - * This is an experimental feature and may still change significantly. + * Multi-threaded use requires the use of v8::Locker/v8::Unlocker, see + * CppHeap. */ void AttachCppHeap(CppHeap*); /** * Detaches a managed C++ heap if one was attached using `AttachCppHeap()`. - * - * This is an experimental feature and may still change significantly. */ void DetachCppHeap(); /** - * This is an experimental feature and may still change significantly. - * \returns the C++ heap managed by V8. Only available if such a heap has been * attached using `AttachCppHeap()`. */ @@ -1524,8 +1524,10 @@ class V8_EXPORT Isolate { void SetWasmLoadSourceMapCallback(WasmLoadSourceMapCallback callback); + V8_DEPRECATED("Wasm SIMD is always enabled") void SetWasmSimdEnabledCallback(WasmSimdEnabledCallback callback); + V8_DEPRECATED("Wasm exceptions are always enabled") void SetWasmExceptionsEnabledCallback(WasmExceptionsEnabledCallback callback); void SetSharedArrayBufferConstructorEnabledCallback( diff --git a/include/v8-metrics.h b/include/v8-metrics.h index 887012ac8c..fc21239f0e 100644 --- a/include/v8-metrics.h +++ b/include/v8-metrics.h @@ -12,6 +12,7 @@ #include "v8-internal.h" // NOLINT(build/include_directory) #include "v8-local-handle.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { @@ -96,16 +97,88 @@ struct GarbageCollectionYoungCycle { }; struct WasmModuleDecoded { + WasmModuleDecoded() = default; + WasmModuleDecoded(bool async, bool streamed, bool success, + size_t module_size_in_bytes, size_t function_count, + int64_t wall_clock_duration_in_us) + : async(async), + streamed(streamed), + success(success), + module_size_in_bytes(module_size_in_bytes), + function_count(function_count), + wall_clock_duration_in_us(wall_clock_duration_in_us) {} + + V8_DEPRECATE_SOON("Use the version without cpu_duration_in_us") + WasmModuleDecoded(bool async, bool streamed, bool success, + size_t module_size_in_bytes, size_t function_count, + int64_t wall_clock_duration_in_us, + int64_t cpu_duration_in_us) + : async(async), + streamed(streamed), + success(success), + module_size_in_bytes(module_size_in_bytes), + function_count(function_count), + wall_clock_duration_in_us(wall_clock_duration_in_us), + cpu_duration_in_us(cpu_duration_in_us) {} + + START_ALLOW_USE_DEPRECATED() + // Copy constructor and copy assignment operator are allowed to copy the + // {cpu_duration_in_us} field. + WasmModuleDecoded(const WasmModuleDecoded&) = default; + WasmModuleDecoded& operator=(const WasmModuleDecoded&) = default; + END_ALLOW_USE_DEPRECATED() + bool async = false; bool streamed = false; bool success = false; size_t module_size_in_bytes = 0; size_t function_count = 0; int64_t wall_clock_duration_in_us = -1; + V8_DEPRECATE_SOON("We do not collect cpu times any more") int64_t cpu_duration_in_us = -1; }; struct WasmModuleCompiled { + WasmModuleCompiled() = default; + + WasmModuleCompiled(bool async, bool streamed, bool cached, bool deserialized, + bool lazy, bool success, size_t code_size_in_bytes, + size_t liftoff_bailout_count, + int64_t wall_clock_duration_in_us) + : async(async), + streamed(streamed), + cached(cached), + deserialized(deserialized), + lazy(lazy), + success(success), + code_size_in_bytes(code_size_in_bytes), + liftoff_bailout_count(liftoff_bailout_count), + wall_clock_duration_in_us(wall_clock_duration_in_us) {} + + V8_DEPRECATE_SOON("Use the version without cpu_duration_in_us") + WasmModuleCompiled(bool async, bool streamed, bool cached, bool deserialized, + bool lazy, bool success, size_t code_size_in_bytes, + size_t liftoff_bailout_count, + int64_t wall_clock_duration_in_us, + int64_t cpu_duration_in_us) + : async(async), + streamed(streamed), + cached(cached), + deserialized(deserialized), + lazy(lazy), + success(success), + code_size_in_bytes(code_size_in_bytes), + liftoff_bailout_count(liftoff_bailout_count), + wall_clock_duration_in_us(wall_clock_duration_in_us), + cpu_duration_in_us(cpu_duration_in_us) {} + + START_ALLOW_USE_DEPRECATED() + // Copy constructor and copy assignment operator are allowed to copy the + // {cpu_duration_in_us} field. + WasmModuleCompiled(const WasmModuleCompiled&) = default; + WasmModuleCompiled& operator=(const WasmModuleCompiled&) = default; + END_ALLOW_USE_DEPRECATED() + bool async = false; bool streamed = false; bool cached = false; @@ -115,6 +188,7 @@ struct WasmModuleCompiled { size_t code_size_in_bytes = 0; size_t liftoff_bailout_count = 0; int64_t wall_clock_duration_in_us = -1; + V8_DEPRECATE_SOON("We do not collect cpu times any more") int64_t cpu_duration_in_us = -1; }; diff --git a/include/v8-microtask-queue.h b/include/v8-microtask-queue.h index f1624b903b..85d227fa3f 100644 --- a/include/v8-microtask-queue.h +++ b/include/v8-microtask-queue.h @@ -118,7 +118,12 @@ class V8_EXPORT V8_NODISCARD MicrotasksScope { public: enum Type { kRunMicrotasks, kDoNotRunMicrotasks }; + V8_DEPRECATE_SOON( + "May be incorrect if context was created with non-default microtask " + "queue") MicrotasksScope(Isolate* isolate, Type type); + + MicrotasksScope(Local context, Type type); MicrotasksScope(Isolate* isolate, MicrotaskQueue* microtask_queue, Type type); ~MicrotasksScope(); diff --git a/include/v8-platform.h b/include/v8-platform.h index 5d34372df5..32898e7ef9 100644 --- a/include/v8-platform.h +++ b/include/v8-platform.h @@ -285,6 +285,8 @@ class ConvertableToTraceFormat { * V8 Tracing controller. * * Can be implemented by an embedder to record trace events from V8. + * + * Will become obsolete in Perfetto SDK build (v8_use_perfetto = true). */ class TracingController { public: @@ -348,10 +350,16 @@ class TracingController { virtual void OnTraceDisabled() = 0; }; - /** Adds tracing state change observer. */ + /** + * Adds tracing state change observer. + * Does nothing in Perfetto SDK build (v8_use_perfetto = true). + */ virtual void AddTraceStateObserver(TraceStateObserver*) {} - /** Removes tracing state change observer. */ + /** + * Removes tracing state change observer. + * Does nothing in Perfetto SDK build (v8_use_perfetto = true). + */ virtual void RemoveTraceStateObserver(TraceStateObserver*) {} }; @@ -923,6 +931,7 @@ class Platform { /** * Allows the embedder to manage memory page allocations. + * Returning nullptr will cause V8 to use the default page allocator. */ virtual PageAllocator* GetPageAllocator() = 0; @@ -943,18 +952,6 @@ class Platform { */ virtual void OnCriticalMemoryPressure() {} - /** - * Enables the embedder to respond in cases where V8 can't allocate large - * memory regions. The |length| parameter is the amount of memory needed. - * Returns true if memory is now available. Returns false if no memory could - * be made available. V8 will retry allocations until this method returns - * false. - * - * Embedder overrides of this function must NOT call back into V8. - */ - V8_DEPRECATED("Use the method without informative parameter") - virtual bool OnCriticalMemoryPressure(size_t length) { return false; } - /** * Gets the number of worker threads used by * Call(BlockingTask)OnWorkerThread(). This can be used to estimate the number diff --git a/include/v8-profiler.h b/include/v8-profiler.h index 8894641993..6b73fc60bf 100644 --- a/include/v8-profiler.h +++ b/include/v8-profiler.h @@ -175,6 +175,32 @@ class V8_EXPORT CpuProfileNode { static const int kNoColumnNumberInfo = Message::kNoColumnInfo; }; +/** + * An interface for exporting data from V8, using "push" model. + */ +class V8_EXPORT OutputStream { + public: + enum WriteResult { kContinue = 0, kAbort = 1 }; + virtual ~OutputStream() = default; + /** Notify about the end of stream. */ + virtual void EndOfStream() = 0; + /** Get preferred output chunk size. Called only once. */ + virtual int GetChunkSize() { return 1024; } + /** + * Writes the next chunk of snapshot data into the stream. Writing + * can be stopped by returning kAbort as function result. EndOfStream + * will not be called in case writing was aborted. + */ + virtual WriteResult WriteAsciiChunk(char* data, int size) = 0; + /** + * Writes the next chunk of heap stats data into the stream. Writing + * can be stopped by returning kAbort as function result. EndOfStream + * will not be called in case writing was aborted. + */ + virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) { + return kAbort; + } +}; /** * CpuProfile contains a CPU profile in a form of top-down call tree @@ -182,6 +208,9 @@ class V8_EXPORT CpuProfileNode { */ class V8_EXPORT CpuProfile { public: + enum SerializationFormat { + kJSON = 0 // See format description near 'Serialize' method. + }; /** Returns CPU profile title. */ Local GetTitle() const; @@ -235,6 +264,25 @@ class V8_EXPORT CpuProfile { * All pointers to nodes previously returned become invalid. */ void Delete(); + + /** + * Prepare a serialized representation of the profile. The result + * is written into the stream provided in chunks of specified size. + * + * For the JSON format, heap contents are represented as an object + * with the following structure: + * + * { + * nodes: [nodes array], + * startTime: number, + * endTime: number + * samples: [strings array] + * timeDeltas: [numbers array] + * } + * + */ + void Serialize(OutputStream* stream, + SerializationFormat format = kJSON) const; }; enum CpuProfilingMode { @@ -576,37 +624,6 @@ class V8_EXPORT HeapGraphNode { const HeapGraphEdge* GetChild(int index) const; }; - -/** - * An interface for exporting data from V8, using "push" model. - */ -class V8_EXPORT OutputStream { - public: - enum WriteResult { - kContinue = 0, - kAbort = 1 - }; - virtual ~OutputStream() = default; - /** Notify about the end of stream. */ - virtual void EndOfStream() = 0; - /** Get preferred output chunk size. Called only once. */ - virtual int GetChunkSize() { return 1024; } - /** - * Writes the next chunk of snapshot data into the stream. Writing - * can be stopped by returning kAbort as function result. EndOfStream - * will not be called in case writing was aborted. - */ - virtual WriteResult WriteAsciiChunk(char* data, int size) = 0; - /** - * Writes the next chunk of heap stats data into the stream. Writing - * can be stopped by returning kAbort as function result. EndOfStream - * will not be called in case writing was aborted. - */ - virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) { - return kAbort; - } -}; - /** * HeapSnapshots record the state of the JS heap at some moment. */ @@ -903,6 +920,8 @@ class V8_EXPORT HeapProfiler { enum SamplingFlags { kSamplingNoFlags = 0, kSamplingForceGC = 1 << 0, + kSamplingIncludeObjectsCollectedByMajorGC = 1 << 1, + kSamplingIncludeObjectsCollectedByMinorGC = 1 << 2, }; /** @@ -1097,10 +1116,8 @@ class V8_EXPORT HeapProfiler { * |stack_depth| parameter controls the maximum number of stack frames to be * captured on each allocation. * - * NOTE: This is a proof-of-concept at this point. Right now we only sample - * newspace allocations. Support for paged space allocation (e.g. pre-tenured - * objects, large objects, code objects, etc.) and native allocations - * doesn't exist yet, but is anticipated in the future. + * NOTE: Support for native allocations doesn't exist yet, but is anticipated + * in the future. * * Objects allocated before the sampling is started will not be included in * the profile. diff --git a/include/v8-script.h b/include/v8-script.h index fdf9e32c95..4bff68795a 100644 --- a/include/v8-script.h +++ b/include/v8-script.h @@ -92,7 +92,15 @@ class V8_EXPORT UnboundScript { * A compiled JavaScript module, not yet tied to a Context. */ class V8_EXPORT UnboundModuleScript : public Data { - // Only used as a container for code caching. + public: + /** + * Data read from magic sourceURL comments. + */ + Local GetSourceURL(); + /** + * Data read from magic sourceMappingURL comments. + */ + Local GetSourceMappingURL(); }; /** diff --git a/include/v8-snapshot.h b/include/v8-snapshot.h index 2400357cf6..b15a2b1922 100644 --- a/include/v8-snapshot.h +++ b/include/v8-snapshot.h @@ -91,7 +91,7 @@ class V8_EXPORT SnapshotCreator { */ SnapshotCreator(Isolate* isolate, const intptr_t* external_references = nullptr, - StartupData* existing_blob = nullptr); + const StartupData* existing_blob = nullptr); /** * Create and enter an isolate, and set it up for serialization. @@ -102,7 +102,7 @@ class V8_EXPORT SnapshotCreator { * that must be equivalent to CreateParams::external_references. */ SnapshotCreator(const intptr_t* external_references = nullptr, - StartupData* existing_blob = nullptr); + const StartupData* existing_blob = nullptr); /** * Destroy the snapshot creator, and exit and dispose of the Isolate diff --git a/include/v8-template.h b/include/v8-template.h index da355f80e9..16f0d2dfed 100644 --- a/include/v8-template.h +++ b/include/v8-template.h @@ -30,7 +30,9 @@ class Signature; F(AsyncIteratorPrototype, initial_async_iterator_prototype) \ F(ErrorPrototype, initial_error_prototype) \ F(IteratorPrototype, initial_iterator_prototype) \ - F(ObjProto_valueOf, object_value_of_function) + F(MapIteratorPrototype, initial_map_iterator_prototype) \ + F(ObjProto_valueOf, object_value_of_function) \ + F(SetIteratorPrototype, initial_set_iterator_prototype) enum Intrinsic { #define V8_DECL_INTRINSIC(name, iname) k##name, diff --git a/include/v8-traced-handle.h b/include/v8-traced-handle.h index 7719b9bc01..e0fd57c49d 100644 --- a/include/v8-traced-handle.h +++ b/include/v8-traced-handle.h @@ -403,7 +403,7 @@ void TracedReferenceBase::SetWrapperClassId(uint16_t class_id) { using I = internal::Internals; if (IsEmpty()) return; internal::Address* obj = reinterpret_cast(val_); - uint8_t* addr = reinterpret_cast(obj) + I::kNodeClassIdOffset; + uint8_t* addr = reinterpret_cast(obj) + I::kTracedNodeClassIdOffset; *reinterpret_cast(addr) = class_id; } @@ -411,7 +411,7 @@ uint16_t TracedReferenceBase::WrapperClassId() const { using I = internal::Internals; if (IsEmpty()) return 0; internal::Address* obj = reinterpret_cast(val_); - uint8_t* addr = reinterpret_cast(obj) + I::kNodeClassIdOffset; + uint8_t* addr = reinterpret_cast(obj) + I::kTracedNodeClassIdOffset; return *reinterpret_cast(addr); } diff --git a/include/v8-unwinder-state.h b/include/v8-unwinder-state.h index 4154905d13..18bb410d2b 100644 --- a/include/v8-unwinder-state.h +++ b/include/v8-unwinder-state.h @@ -17,10 +17,10 @@ struct CalleeSavedRegisters { void* arm_r9; void* arm_r10; }; -#elif V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM64 || \ - V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC || \ - V8_TARGET_ARCH_PPC64 || V8_TARGET_ARCH_RISCV64 || V8_TARGET_ARCH_S390 || \ - V8_TARGET_ARCH_LOONG64 || V8_TARGET_ARCH_RISCV32 +#elif V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM64 || \ + V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64 || \ + V8_TARGET_ARCH_RISCV64 || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_LOONG64 || \ + V8_TARGET_ARCH_RISCV32 struct CalleeSavedRegisters {}; #else #error Target architecture was not detected as supported by v8 diff --git a/include/v8-value.h b/include/v8-value.h index adca989e00..866da20124 100644 --- a/include/v8-value.h +++ b/include/v8-value.h @@ -244,6 +244,11 @@ class V8_EXPORT Value : public Data { */ bool IsWeakSet() const; + /** + * Returns true if this value is a WeakRef. + */ + bool IsWeakRef() const; + /** * Returns true if this value is an ArrayBuffer. */ diff --git a/include/v8-version.h b/include/v8-version.h index 6df422de60..1203175d8e 100644 --- a/include/v8-version.h +++ b/include/v8-version.h @@ -8,8 +8,8 @@ // These macros define the version number for the current version. // 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 10 -#define V8_MINOR_VERSION 7 +#define V8_MAJOR_VERSION 11 +#define V8_MINOR_VERSION 0 #define V8_BUILD_NUMBER 0 #define V8_PATCH_LEVEL 0 diff --git a/include/v8config.h b/include/v8config.h index 71d932006b..c79cd04e0f 100644 --- a/include/v8config.h +++ b/include/v8config.h @@ -288,6 +288,9 @@ path. Add it with -I to the command line // // V8_HAS_ATTRIBUTE_ALWAYS_INLINE - __attribute__((always_inline)) // supported +// V8_HAS_ATTRIBUTE_CONSTINIT - __attribute__((require_constant_ +// initialization)) +// supported // V8_HAS_ATTRIBUTE_NONNULL - __attribute__((nonnull)) supported // V8_HAS_ATTRIBUTE_NOINLINE - __attribute__((noinline)) supported // V8_HAS_ATTRIBUTE_UNUSED - __attribute__((unused)) supported @@ -305,6 +308,9 @@ path. Add it with -I to the command line // V8_HAS_BUILTIN_EXPECT - __builtin_expect() supported // V8_HAS_BUILTIN_FRAME_ADDRESS - __builtin_frame_address() supported // V8_HAS_BUILTIN_POPCOUNT - __builtin_popcount() supported +// V8_HAS_BUILTIN_ADD_OVERFLOW - __builtin_add_overflow() supported +// V8_HAS_BUILTIN_SUB_OVERFLOW - __builtin_sub_overflow() supported +// V8_HAS_BUILTIN_MUL_OVERFLOW - __builtin_mul_overflow() supported // V8_HAS_BUILTIN_SADD_OVERFLOW - __builtin_sadd_overflow() supported // V8_HAS_BUILTIN_SSUB_OVERFLOW - __builtin_ssub_overflow() supported // V8_HAS_BUILTIN_UADD_OVERFLOW - __builtin_uadd_overflow() supported @@ -334,6 +340,9 @@ path. Add it with -I to the command line #endif # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline)) +# define V8_HAS_ATTRIBUTE_CONSTINIT \ + (__has_attribute(require_constant_initialization)) +# define V8_HAS_ATTRIBUTE_CONST (__has_attribute(const)) # define V8_HAS_ATTRIBUTE_NONNULL (__has_attribute(nonnull)) # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline)) # define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused)) @@ -355,6 +364,9 @@ path. Add it with -I to the command line # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) +# define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow)) +# define V8_HAS_BUILTIN_SUB_OVERFLOW (__has_builtin(__builtin_sub_overflow)) +# define V8_HAS_BUILTIN_MUL_OVERFLOW (__has_builtin(__builtin_mul_overflow)) # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow)) @@ -450,6 +462,26 @@ path. Add it with -I to the command line #endif +// A macro to mark functions whose values don't change (e.g. across calls) +// and thereby compiler is free to hoist and fold multiple calls together. +// Use like: +// V8_CONST int foo() { ... } +#if V8_HAS_ATTRIBUTE_CONST +# define V8_CONST __attribute__((const)) +#else +# define V8_CONST +#endif + +// A macro to mark a declaration as requiring constant initialization. +// Use like: +// int* foo V8_CONSTINIT; +#if V8_HAS_ATTRIBUTE_CONSTINIT +# define V8_CONSTINIT __attribute__((require_constant_initialization)) +#else +# define V8_CONSTINIT +#endif + + // A macro to mark specific arguments as non-null. // Use like: // int add(int* x, int y, int* z) V8_NONNULL(1, 3) { return *x + y + *z; } @@ -579,6 +611,37 @@ path. Add it with -I to the command line #define V8_NO_UNIQUE_ADDRESS /* NOT SUPPORTED */ #endif +// Marks a type as being eligible for the "trivial" ABI despite having a +// non-trivial destructor or copy/move constructor. Such types can be relocated +// after construction by simply copying their memory, which makes them eligible +// to be passed in registers. The canonical example is std::unique_ptr. +// +// Use with caution; this has some subtle effects on constructor/destructor +// ordering and will be very incorrect if the type relies on its address +// remaining constant. When used as a function argument (by value), the value +// may be constructed in the caller's stack frame, passed in a register, and +// then used and destructed in the callee's stack frame. A similar thing can +// occur when values are returned. +// +// TRIVIAL_ABI is not needed for types which have a trivial destructor and +// copy/move constructors, since those are automatically trivial by the ABI +// spec. +// +// It is also not likely to be effective on types too large to be passed in one +// or two registers on typical target ABIs. +// +// See also: +// https://clang.llvm.org/docs/AttributeReference.html#trivial-abi +// https://libcxx.llvm.org/docs/DesignDocs/UniquePtrTrivialAbi.html +#if defined(__clang__) && defined(__has_attribute) +#if __has_attribute(trivial_abi) +#define V8_TRIVIAL_ABI [[clang::trivial_abi]] +#endif // __has_attribute(trivial_abi) +#endif // defined(__clang__) && defined(__has_attribute) +#if !defined(V8_TRIVIAL_ABI) +#define V8_TRIVIAL_ABI +#endif //!defined(V8_TRIVIAL_ABI) + // Helper macro to define no_sanitize attributes only with clang. #if defined(__clang__) && defined(__has_attribute) #if __has_attribute(no_sanitize) @@ -653,9 +716,6 @@ V8 shared library set USING_V8_SHARED. #elif defined(__mips64) #define V8_HOST_ARCH_MIPS64 1 #define V8_HOST_ARCH_64_BIT 1 -#elif defined(__MIPSEB__) || defined(__MIPSEL__) -#define V8_HOST_ARCH_MIPS 1 -#define V8_HOST_ARCH_32_BIT 1 #elif defined(__loongarch64) #define V8_HOST_ARCH_LOONG64 1 #define V8_HOST_ARCH_64_BIT 1 @@ -691,10 +751,10 @@ V8 shared library set USING_V8_SHARED. // The macros may be set externally. If not, detect in the same way as the host // architecture, that is, target the native environment as presented by the // compiler. -#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && \ - !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64 && \ - !V8_TARGET_ARCH_PPC && !V8_TARGET_ARCH_PPC64 && !V8_TARGET_ARCH_S390 && \ - !V8_TARGET_ARCH_RISCV64 && !V8_TARGET_ARCH_LOONG64 && \ +#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && \ + !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_PPC && \ + !V8_TARGET_ARCH_PPC64 && !V8_TARGET_ARCH_S390 && \ + !V8_TARGET_ARCH_RISCV64 && !V8_TARGET_ARCH_LOONG64 && \ !V8_TARGET_ARCH_RISCV32 #if defined(_M_X64) || defined(__x86_64__) #define V8_TARGET_ARCH_X64 1 @@ -706,8 +766,8 @@ V8 shared library set USING_V8_SHARED. #define V8_TARGET_ARCH_ARM 1 #elif defined(__mips64) #define V8_TARGET_ARCH_MIPS64 1 -#elif defined(__MIPSEB__) || defined(__MIPSEL__) -#define V8_TARGET_ARCH_MIPS 1 +#elif defined(__loongarch64) +#define V8_TARGET_ARCH_LOONG64 1 #elif defined(_ARCH_PPC64) #define V8_TARGET_ARCH_PPC64 1 #elif defined(_ARCH_PPC) @@ -785,9 +845,6 @@ V8 shared library set USING_V8_SHARED. #if (V8_TARGET_ARCH_ARM64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_ARM64)) #error Target architecture arm64 is only supported on arm64 and x64 host #endif -#if (V8_TARGET_ARCH_MIPS && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_MIPS)) -#error Target architecture mips is only supported on mips and ia32 host -#endif #if (V8_TARGET_ARCH_MIPS64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_MIPS64)) #error Target architecture mips64 is only supported on mips64 and x64 host #endif @@ -812,12 +869,6 @@ V8 shared library set USING_V8_SHARED. #define V8_TARGET_LITTLE_ENDIAN 1 #elif V8_TARGET_ARCH_LOONG64 #define V8_TARGET_LITTLE_ENDIAN 1 -#elif V8_TARGET_ARCH_MIPS -#if defined(__MIPSEB__) -#define V8_TARGET_BIG_ENDIAN 1 -#else -#define V8_TARGET_LITTLE_ENDIAN 1 -#endif #elif V8_TARGET_ARCH_MIPS64 #if defined(__MIPSEB__) || defined(V8_TARGET_ARCH_MIPS64_BE) #define V8_TARGET_BIG_ENDIAN 1 diff --git a/infra/mb/mb_config.pyl b/infra/mb/mb_config.pyl index e1c268a0c1..c494280b72 100644 --- a/infra/mb/mb_config.pyl +++ b/infra/mb/mb_config.pyl @@ -66,7 +66,6 @@ 'V8 Linux64 - debug builder': 'debug_x64', 'V8 Linux64 - external code space - debug - builder': 'debug_x64_external_code_space', 'V8 Linux64 - custom snapshot - debug builder': 'debug_x64_custom', - 'V8 Linux64 - heap sandbox - debug - builder': 'debug_x64_heap_sandbox', 'V8 Linux64 - internal snapshot - builder': 'release_x64_internal', 'V8 Linux64 - debug - header includes - builder': 'debug_x64_header_includes', 'V8 Linux64 - no sandbox - debug builder': 'debug_x64_no_sandbox', @@ -108,14 +107,15 @@ 'V8 Linux - arm64 - sim - MSAN - builder': 'release_simulate_arm64_msan', # FYI. 'V8 iOS - sim - builder': 'release_x64_ios_simulator', - 'V8 Linux64 - arm64 - sim - heap sandbox - debug - builder': 'debug_x64_heap_sandbox_arm64_sim', 'V8 Linux64 - arm64 - sim - no pointer compression - builder': 'release_simulate_arm64_no_pointer_compression', + 'V8 Linux64 - coverage': 'release_x64_coverage', '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 - builder': 'release_x64_disable_runtime_call_stats', 'V8 Linux64 - debug - single generation - builder': 'debug_x64_single_generation', 'V8 Linux64 - no pointer compression - builder': 'release_x64_no_pointer_compression', + 'V8 Linux64 css - debug builder': 'debug_x64_conservative_stack_scanning', 'V8 Linux64 gcc - builder': 'release_x64_gcc', 'V8 Linux64 gcc - debug builder': 'debug_x64_gcc', 'V8 Linux64 gcc light - debug builder': 'debug_x64_gcc', @@ -126,7 +126,6 @@ 'V8 Linux - vtunejit': 'debug_x86_vtunejit', 'V8 Linux64 - gcov coverage': 'release_x64_gcc_coverage', 'V8 Linux64 - Fuzzilli - builder': 'release_x64_fuzzilli', - 'V8 Linux - predictable - builder': 'release_x86_predictable', 'V8 Linux64 - predictable - builder': 'release_x64_predictable', 'V8 Linux - full debug builder': 'full_debug_x86', 'V8 Mac64 - full debug builder': 'full_debug_x64', @@ -168,7 +167,7 @@ 'V8 Clusterfuzz Linux64 UBSan - release builder': 'release_x64_ubsan_recover', 'V8 Clusterfuzz Linux64 ASAN sandbox testing - release builder': - 'release_x64_asan_sandbox_testing', + 'release_x64_asan_symbolized_expose_memory_corruption', }, 'client.v8.perf' : { 'V8 Arm - builder - perf': 'official_arm', @@ -208,105 +207,97 @@ 'tryserver.v8': { 'v8_android_arm_compile_rel': 'release_android_arm', 'v8_android_arm64_compile_dbg': 'debug_android_arm64', - 'v8_android_arm64_n5x_rel_ng': 'release_android_arm64', + 'v8_android_arm64_n5x_compile_rel': 'release_android_arm64', 'v8_fuchsia_compile_rel': 'release_x64_fuchsia_trybot', - 'v8_fuchsia_rel_ng': 'release_x64_fuchsia_trybot', 'v8_ios_simulator': 'release_x64_ios_simulator', - 'v8_linux_rel_ng': 'release_x86_gcmole_trybot', - 'v8_linux_optional_rel_ng': 'release_x86_trybot', - 'v8_linux_verify_csa_rel_ng': 'release_x86_verify_csa', - 'v8_linux_nodcheck_rel_ng': 'release_x86_minimal_symbols', - 'v8_linux_dbg_ng': 'debug_x86_trybot', + 'v8_linux_compile_rel': 'release_x86_gcmole_trybot', + 'v8_linux_optional_compile_rel': 'release_x86_trybot', + 'v8_linux_verify_csa_compile_rel': 'release_x86_verify_csa', + 'v8_linux_nodcheck_compile_rel': 'release_x86_minimal_symbols', + 'v8_linux_compile_dbg': 'debug_x86_trybot', 'v8_linux_noi18n_compile_dbg': 'debug_x86_no_i18n', - 'v8_linux_noi18n_rel_ng': 'release_x86_no_i18n_trybot', - 'v8_linux_gc_stress_dbg_ng': 'debug_x86_trybot', + 'v8_linux_noi18n_compile_rel': 'release_x86_no_i18n_trybot', + 'v8_linux_gc_stress_compile_dbg': 'debug_x86_trybot', 'v8_linux_shared_compile_rel': 'release_x86_shared_verify_heap', 'v8_linux_vtunejit': 'debug_x86_vtunejit', - 'v8_linux64_arm64_no_pointer_compression_rel_ng': + 'v8_linux64_arm64_no_pointer_compression_compile_rel': 'release_simulate_arm64_no_pointer_compression', - 'v8_linux64_cppgc_non_default_dbg_ng': 'debug_x64_non_default_cppgc', - 'v8_linux64_dbg_ng': 'debug_x64_trybot', - 'v8_linux64_no_sandbox_dbg_ng': 'debug_x64_no_sandbox', - 'v8_linux64_dict_tracking_dbg_ng': 'debug_x64_dict_tracking_trybot', - 'v8_linux64_disable_runtime_call_stats_rel_ng': 'release_x64_disable_runtime_call_stats', - 'v8_linux64_external_code_space_dbg_ng': 'debug_x64_external_code_space', - 'v8_linux64_gc_stress_custom_snapshot_dbg_ng': 'debug_x64_trybot_custom', - 'v8_linux64_gc_stress_dbg_ng': 'debug_x64_trybot', + 'v8_linux64_cppgc_non_default_compile_dbg': 'debug_x64_non_default_cppgc', + 'v8_linux64_compile_dbg': 'debug_x64_trybot', + 'v8_linux64_coverage': 'release_x64_coverage', + 'v8_linux64_no_sandbox_compile_dbg': 'debug_x64_no_sandbox', + 'v8_linux64_dict_tracking_compile_dbg': 'debug_x64_dict_tracking_trybot', + 'v8_linux64_disable_runtime_call_stats_compile_rel': 'release_x64_disable_runtime_call_stats', + 'v8_linux64_external_code_space_compile_dbg': 'debug_x64_external_code_space', + 'v8_linux64_css_compile_dbg': 'debug_x64_conservative_stack_scanning', + 'v8_linux64_gc_stress_custom_snapshot_compile_dbg': 'debug_x64_trybot_custom', + 'v8_linux64_gc_stress_compile_dbg': 'debug_x64_trybot', 'v8_linux64_gcc_compile_dbg': 'debug_x64_gcc', - 'v8_linux64_gcc_compile_rel': 'release_x64_gcc', 'v8_linux64_gcc_light_compile_dbg': 'debug_x64_gcc', - 'v8_linux64_gcc_rel_ng': 'release_x64_gcc', + 'v8_linux64_gcc_compile_rel': 'release_x64_gcc', '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_linux64_minor_mc_dbg_ng': 'debug_x64_trybot', - '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', - 'v8_linux64_no_pointer_compression_rel_ng': 'release_x64_no_pointer_compression', - 'v8_linux64_rel_ng': 'release_x64_test_features_trybot', - 'v8_linux64_no_sandbox_rel_ng': 'release_x64_no_sandbox', - 'v8_linux64_predictable_rel_ng': 'release_x64_predictable', + 'v8_linux64_minor_mc_compile_dbg': 'debug_x64_trybot', + 'v8_linux64_fyi_compile_rel': 'release_x64_test_features_trybot', + 'v8_linux64_nodcheck_compile_rel': 'release_x64', + 'v8_linux64_perfetto_compile_dbg': 'debug_x64_perfetto', + 'v8_linux64_no_pointer_compression_compile_rel': 'release_x64_no_pointer_compression', + 'v8_linux64_compile_rel': 'release_x64_test_features_trybot', + 'v8_linux64_no_sandbox_compile_rel': 'release_x64_no_sandbox', + 'v8_linux64_predictable_compile_rel': 'release_x64_predictable', 'v8_linux64_shared_compile_rel': 'release_x64_shared_verify_heap', - 'v8_linux64_single_generation_dbg_ng': 'debug_x64_single_generation', + 'v8_linux64_single_generation_compile_dbg': 'debug_x64_single_generation', 'v8_linux64_no_wasm_compile_rel': 'release_x64_webassembly_disabled', - 'v8_linux64_verify_csa_rel_ng': 'release_x64_verify_csa', - 'v8_linux64_asan_rel_ng': 'release_x64_asan_minimal_symbols', - 'v8_linux64_cfi_rel_ng': 'release_x64_cfi', - 'v8_linux64_fuzzilli_ng': 'release_x64_fuzzilli', - 'v8_linux64_loong64_rel_ng': 'release_simulate_loong64', - 'v8_linux64_msan_rel_ng': 'release_simulate_arm64_msan_minimal_symbols', - 'v8_linux_riscv32_rel_ng': 'release_simulate_riscv32', - 'v8_linux64_riscv64_rel_ng': 'release_simulate_riscv64', - 'v8_linux64_tsan_rel_ng': 'release_x64_tsan_minimal_symbols', - 'v8_linux64_tsan_no_cm_rel_ng': 'release_x64_tsan_no_cm', - 'v8_linux64_tsan_isolates_rel_ng': + 'v8_linux64_verify_csa_compile_rel': 'release_x64_verify_csa', + 'v8_linux64_asan_compile_rel': 'release_x64_asan_minimal_symbols', + 'v8_linux64_cfi_compile_rel': 'release_x64_cfi', + 'v8_linux64_fuzzilli_compile_rel': 'release_x64_fuzzilli', + 'v8_linux64_loong64_compile_rel': 'release_simulate_loong64', + 'v8_linux64_msan_compile_rel': 'release_simulate_arm64_msan_minimal_symbols', + 'v8_linux_riscv32_compile_rel': 'release_simulate_riscv32', + 'v8_linux64_riscv64_compile_rel': 'release_simulate_riscv64', + 'v8_linux64_tsan_compile_rel': 'release_x64_tsan_minimal_symbols', + 'v8_linux64_tsan_no_cm_compile_rel': 'release_x64_tsan_no_cm', + 'v8_linux64_tsan_isolates_compile_rel': 'release_x64_tsan_minimal_symbols', - 'v8_linux64_ubsan_rel_ng': 'release_x64_ubsan_minimal_symbols', - 'v8_odroid_arm_rel_ng': 'release_arm', + 'v8_linux64_ubsan_compile_rel': 'release_x64_ubsan_minimal_symbols', + 'v8_odroid_arm_compile_rel': 'release_arm', 'v8_linux_torque_compare': 'torque_compare', # TODO(machenbach): Remove after switching to x64 on infra side. - 'v8_win_dbg_ng': 'debug_x86_trybot', 'v8_win_compile_dbg': 'debug_x86_trybot', - 'v8_win_rel_ng': 'release_x86_trybot', - 'v8_win64_asan_rel_ng': 'release_x64_asan_no_lsan', + 'v8_win_compile_rel': 'release_x86_trybot', + 'v8_win64_asan_compile_rel': 'release_x64_asan_no_lsan', + 'v8_win64_msvc_light_compile_rel': 'release_x64_msvc', + 'v8_win64_compile_dbg': 'debug_x64_minimal_symbols', 'v8_win64_msvc_compile_rel': 'release_x64_msvc', - 'v8_win64_dbg_ng': 'debug_x64_minimal_symbols', - 'v8_win64_msvc_rel_ng': 'release_x64_msvc', - 'v8_win64_rel_ng': 'release_x64_trybot', - 'v8_mac_arm64_rel_ng': 'release_arm64', - 'v8_mac_arm64_dbg_ng': 'debug_arm64', - 'v8_mac_arm64_full_dbg_ng': 'full_debug_arm64', - 'v8_mac_arm64_no_pointer_compression_dbg_ng': 'debug_arm64_no_pointer_compression', - 'v8_mac_arm64_compile_dbg': 'debug_arm64', + 'v8_win64_compile_rel': 'release_x64_trybot', 'v8_mac_arm64_compile_rel': 'release_arm64', + 'v8_mac_arm64_compile_dbg': 'debug_arm64', + 'v8_mac_arm64_full_compile_dbg': 'full_debug_arm64', + 'v8_mac_arm64_no_pointer_compression_compile_dbg': 'debug_arm64_no_pointer_compression', + 'v8_mac_arm64_sim_compile_rel': 'release_simulate_arm64_trybot', 'v8_mac_arm64_sim_compile_dbg': 'debug_simulate_arm64', - 'v8_mac_arm64_sim_compile_rel': 'release_simulate_arm64', - 'v8_mac_arm64_sim_rel_ng': 'release_simulate_arm64_trybot', - 'v8_mac_arm64_sim_dbg_ng': 'debug_simulate_arm64', - 'v8_mac_arm64_sim_nodcheck_rel_ng': 'release_simulate_arm64', - 'v8_mac64_gc_stress_dbg_ng': 'debug_x64_trybot', - 'v8_mac64_rel_ng': 'release_x64_trybot', + 'v8_mac_arm64_sim_nodcheck_compile_rel': 'release_simulate_arm64', + 'v8_mac64_gc_stress_compile_dbg': 'debug_x64_trybot', + 'v8_mac64_compile_rel': 'release_x64_trybot', 'v8_mac64_dbg': 'debug_x64', - 'v8_mac64_dbg_ng': 'debug_x64', - 'v8_mac64_compile_full_dbg_ng': 'full_debug_x64', + 'v8_mac64_compile_dbg': 'debug_x64', + 'v8_mac64_noopt_compile_dbg': 'full_debug_x64', 'v8_mac64_asan_compile_rel': 'release_x64_asan_no_lsan', - 'v8_mac64_asan_rel_ng': 'release_x64_asan_no_lsan', - 'v8_linux_arm_rel_ng': 'release_simulate_arm_trybot', + 'v8_linux_arm_compile_rel': 'release_simulate_arm_trybot', 'v8_linux_arm_lite_compile_dbg': 'debug_simulate_arm_lite', - 'v8_linux_arm_lite_rel_ng': 'release_simulate_arm_lite_trybot', - 'v8_linux_arm_dbg_ng': 'debug_simulate_arm', + 'v8_linux_arm_lite_compile_rel': 'release_simulate_arm_lite_trybot', + 'v8_linux_arm_compile_dbg': 'debug_simulate_arm', 'v8_linux_arm_armv8a_rel': 'release_simulate_arm_trybot', 'v8_linux_arm_armv8a_dbg': 'debug_simulate_arm', - 'v8_linux_arm64_rel_ng': 'release_simulate_arm64_trybot', - 'v8_linux_arm64_cfi_rel_ng' : 'release_simulate_arm64_cfi', - 'v8_linux_arm64_dbg_ng': 'debug_simulate_arm64', - 'v8_linux_arm64_gc_stress_dbg_ng': 'debug_simulate_arm64', + 'v8_linux_arm64_compile_rel': 'release_simulate_arm64_trybot', + 'v8_linux_arm64_cfi_compile_rel' : 'release_simulate_arm64_cfi', + 'v8_linux_arm64_compile_dbg': 'debug_simulate_arm64', + 'v8_linux_arm64_gc_stress_compile_dbg': 'debug_simulate_arm64', 'v8_linux_mips64el_compile_rel': 'release_simulate_mips64el', - 'v8_numfuzz_ng': 'release_x64', - 'v8_numfuzz_dbg_ng': 'debug_x64', - 'v8_numfuzz_tsan_ng': 'release_x64_tsan', + 'v8_numfuzz_compile_rel': 'release_x64', + 'v8_numfuzz_compile_dbg': 'debug_x64', + 'v8_numfuzz_tsan_compile_rel': 'release_x64_tsan', }, }, @@ -419,7 +410,7 @@ 'release_simulate_arm64_cfi': [ 'release_bot', 'simulate_arm64', 'v8_control_flow_integrity'], 'release_simulate_arm64_no_pointer_compression': [ - 'release_bot', 'simulate_arm64_no_sandbox', 'dcheck_always_on', + 'release_bot', 'simulate_arm64', 'no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_disable_pointer_compression'], 'release_simulate_arm64_msan': [ 'release_bot', 'simulate_arm64', 'msan'], @@ -452,7 +443,7 @@ 'debug_arm64': [ 'debug_bot', 'arm64'], 'debug_arm64_no_pointer_compression': [ - 'debug_bot', 'arm64_no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_enable_javascript_promise_hooks', + 'debug_bot', 'arm64', 'no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_enable_javascript_promise_hooks', 'v8_disable_pointer_compression'], 'full_debug_arm64': [ 'debug_bot', 'arm64', 'v8_full_debug'], @@ -499,6 +490,9 @@ 'release_x64_asan_no_lsan_verify_heap_dchecks': [ 'release_bot', 'x64', 'asan', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_verify_heap'], + 'release_x64_asan_symbolized_expose_memory_corruption': [ + 'release_bot', 'x64', 'asan', 'symbolized', + 'v8_expose_memory_corruption_api'], 'release_x64_asan_symbolized_verify_heap': [ 'release_bot', 'x64', 'asan', 'lsan', 'symbolized', 'v8_verify_heap'], @@ -506,6 +500,8 @@ 'release_bot', 'x64', 'cfi'], 'release_x64_cfi_clusterfuzz': [ 'release_bot', 'x64', 'cfi_clusterfuzz'], + 'release_x64_coverage': [ + 'release_bot', 'x64', 'clang_coverage'], 'release_x64_fuzzilli': [ 'release_bot', 'x64', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_verify_heap', 'v8_verify_csa', 'fuzzilli'], @@ -533,12 +529,12 @@ 'release_x64_minimal_symbols_reclient': [ 'release_bot_reclient', 'x64', 'minimal_symbols'], 'release_x64_no_pointer_compression': [ - 'release_bot', 'x64_no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_enable_javascript_promise_hooks', - 'v8_disable_pointer_compression'], + 'release_bot', 'x64', 'no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', + 'v8_enable_javascript_promise_hooks', 'v8_disable_pointer_compression'], 'release_x64_reclient': [ 'release_bot_reclient', 'x64'], 'release_x64_no_sandbox': [ - 'release_bot', 'x64_no_sandbox'], + 'release_bot', 'x64', 'no_sandbox'], 'release_x64_trybot': [ 'release_trybot', 'x64'], 'release_x64_test_features_trybot': [ @@ -562,9 +558,6 @@ 'v8_enable_slow_dchecks', 'v8_verify_csa'], 'release_x64_webassembly_disabled': [ 'release_bot', 'x64', 'webassembly_disabled'], - 'release_x64_asan_sandbox_testing': [ - 'release_bot', 'x64', 'asan', 'symbolized', 'v8_enable_sandbox_future', - 'v8_expose_memory_corruption_api'], # Official configs for x64. 'official_x64': [ @@ -578,6 +571,8 @@ 'debug_x64_asan_no_lsan_static': [ 'debug', 'static', 'goma', 'v8_enable_slow_dchecks', 'v8_optimized_debug', 'x64', 'asan'], + 'debug_x64_conservative_stack_scanning': [ + 'debug_bot', 'x64', 'conservative_stack_scanning'], 'debug_x64_custom': [ 'debug_bot', 'x64', 'v8_snapshot_custom'], 'debug_x64_external_code_space': [ @@ -588,10 +583,6 @@ 'debug_bot_no_goma', 'x64', 'gcc', 'lld', 'no_custom_libcxx'], 'debug_x64_header_includes': [ 'debug_bot', 'x64', 'v8_check_header_includes'], - 'debug_x64_heap_sandbox': [ - 'debug_bot', 'x64', 'v8_enable_sandbox_future', 'v8_expose_memory_corruption_api'], - 'debug_x64_heap_sandbox_arm64_sim': [ - 'debug_bot', 'simulate_arm64', 'v8_enable_sandbox_future', 'v8_expose_memory_corruption_api'], 'debug_x64_minimal_symbols': [ 'debug_bot', 'x64', 'minimal_symbols'], 'debug_x64_non_default_cppgc': [ @@ -599,7 +590,7 @@ 'debug_x64_perfetto': [ 'debug_bot', 'x64', 'perfetto'], 'debug_x64_no_sandbox': [ - 'debug_bot', 'x64_no_sandbox'], + 'debug_bot', 'x64', 'no_sandbox'], 'debug_x64_single_generation': [ 'debug_bot', 'x64', 'v8_enable_single_generation'], 'debug_x64_trybot': [ @@ -645,8 +636,6 @@ 'release_trybot', 'x86', 'v8_no_i18n'], 'release_x64_predictable': [ 'release_bot', 'x64', 'v8_enable_verify_predictable'], - 'release_x86_predictable': [ - 'release_bot', 'x86', 'v8_enable_verify_predictable'], 'release_x86_shared_verify_heap': [ 'release', 'x86', 'goma', 'shared', 'v8_verify_heap'], 'release_x86_trybot': [ @@ -678,11 +667,7 @@ }, 'arm64': { - 'gn_args': 'target_cpu="arm64" v8_enable_sandbox=true', - }, - - 'arm64_no_sandbox': { - 'gn_args': 'target_cpu="arm64" v8_enable_sandbox=false', + 'gn_args': 'target_cpu="arm64"', }, 'asan': { @@ -706,6 +691,15 @@ 'gn_args': 'is_clang=true', }, + 'clang_coverage': { + 'gn_args': 'use_clang_coverage=true', + }, + + 'conservative_stack_scanning': { + 'gn_args': 'v8_enable_conservative_stack_scanning=true ' + 'v8_enable_inner_pointer_resolution_mb=true', + }, + 'coverage': { 'gn_args': 'v8_code_coverage=true', }, @@ -795,12 +789,12 @@ 'msan': { 'mixins': ['v8_enable_test_features'], - 'gn_args': 'is_msan=true msan_track_origins=2', + 'gn_args': 'is_msan=true msan_track_origins=2 instrumented_libraries_release="xenial"', }, 'msan_no_origins': { 'mixins': ['v8_enable_test_features'], - 'gn_args': 'is_msan=true msan_track_origins=0', + 'gn_args': 'is_msan=true msan_track_origins=0 instrumented_libraries_release="xenial"', }, 'msvc': { @@ -815,6 +809,10 @@ 'gn_args': 'use_goma=false', }, + 'no_sandbox': { + 'gn_args': 'v8_enable_sandbox=false', + }, + 'no_sysroot': { 'gn_args': 'use_sysroot=false', }, @@ -864,11 +862,7 @@ }, 'simulate_arm64': { - 'gn_args': 'target_cpu="x64" v8_target_cpu="arm64" v8_enable_sandbox=true', - }, - - 'simulate_arm64_no_sandbox': { - 'gn_args': 'target_cpu="x64" v8_target_cpu="arm64" v8_enable_sandbox=false', + 'gn_args': 'target_cpu="x64" v8_target_cpu="arm64"', }, 'simulate_loong64': { @@ -940,10 +934,6 @@ 'gn_args': 'v8_enable_runtime_call_stats=false', }, - 'v8_enable_sandbox_future': { - 'gn_args': 'v8_enable_sandbox_future=true', - }, - 'v8_expose_memory_corruption_api': { 'gn_args': 'v8_expose_memory_corruption_api=true', }, @@ -1033,11 +1023,7 @@ }, 'x64': { - 'gn_args': 'target_cpu="x64" v8_enable_sandbox=true', - }, - - 'x64_no_sandbox': { - 'gn_args': 'target_cpu="x64" v8_enable_sandbox=false', + 'gn_args': 'target_cpu="x64"', }, 'x86': { diff --git a/infra/testing/builders.pyl b/infra/testing/builders.pyl index 50343ec320..d6fcb8db83 100644 --- a/infra/testing/builders.pyl +++ b/infra/testing/builders.pyl @@ -32,7 +32,7 @@ ### luci.v8.try ############################################################################## # Android - 'v8_android_arm64_n5x_rel_ng_triggered': { + 'v8_android_arm64_n5x_rel': { 'swarming_dimensions' : { 'device_os': 'MMB29Q', 'device_type': 'bullhead', @@ -46,7 +46,7 @@ }, ############################################################################## # Fuchsia - 'v8_fuchsia_rel_ng_triggered': { + 'v8_fuchsia_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -64,7 +64,7 @@ }, ############################################################################## # Linux32 - 'v8_linux_dbg_ng_triggered': { + 'v8_linux_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -89,7 +89,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -109,7 +110,7 @@ }, ], }, - 'v8_linux_gc_stress_dbg_ng_triggered': { + 'v8_linux_gc_stress_dbg': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -118,7 +119,7 @@ {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 5}, ], }, - 'v8_linux_nodcheck_rel_ng_triggered': { + 'v8_linux_nodcheck_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -143,17 +144,17 @@ }, ], }, - 'v8_linux_noi18n_rel_ng_triggered': { + 'v8_linux_noi18n_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, 'tests': [ {'name': 'mozilla', 'variant': 'default'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'variant': 'default', 'shards': 2}, ], }, - 'v8_linux_rel_ng_triggered': { + 'v8_linux_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -161,7 +162,6 @@ 'tests': [ {'name': 'benchmarks'}, {'name': 'benchmarks', 'variant': 'extra'}, - {'name': 'gcmole'}, {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, {'name': 'mozilla', 'variant': 'extra'}, @@ -180,9 +180,30 @@ ], 'shards': 4, }, + {'name': 'gcmole_v2', 'variant': 'ia32'}, + {'name': 'gcmole_v2', 'variant': 'x64'}, + {'name': 'gcmole_v2', 'variant': 'arm'}, + {'name': 'gcmole_v2', 'variant': 'arm64'}, + # TODO(https://crbug.com/v8/12660): Remove v2 above after testing. + {'name': 'gcmole_v3', 'variant': 'ia32', 'shards': 4}, + {'name': 'gcmole_v3', 'variant': 'x64', 'shards': 4}, + {'name': 'gcmole_v3', 'variant': 'arm', 'shards': 4}, + {'name': 'gcmole_v3', 'variant': 'arm64', 'shards': 4}, + { + 'name': 'gcmole_v2', + 'variant': 'x64', + 'suffix': 'test single host', + 'test_args': ['--test-run'], + }, + { + 'name': 'gcmole_v3', + 'variant': 'x64', + 'suffix': 'test multi host', + 'test_args': ['--test-run'], + }, ], }, - 'v8_linux_optional_rel_ng_triggered': { + 'v8_linux_optional_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -210,6 +231,7 @@ '--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx', ], + 'shards': 2, }, { 'name': 'v8testing', @@ -237,6 +259,7 @@ '--extra-flags', '--noenable-ssse3 --noenable-sse4-1 --noenable-avx', ], + 'shards': 2, }, { 'name': 'v8testing', @@ -258,6 +281,7 @@ 'suffix': 'nosse4', 'variant': 'default', 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'], + 'shards': 2, }, { 'name': 'v8testing', @@ -275,7 +299,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2, }, { 'name': 'v8testing', @@ -285,7 +310,7 @@ }, ], }, - 'v8_linux_verify_csa_rel_ng_triggered': { + 'v8_linux_verify_csa_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -295,7 +320,7 @@ }, ############################################################################## # Linux32 with arm simulators - 'v8_linux_arm_dbg_ng_triggered': { + 'v8_linux_arm_dbg': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -307,7 +332,7 @@ {'name': 'v8testing', 'variant': 'extra', 'shards': 10}, ], }, - 'v8_linux_arm_lite_rel_ng_triggered': { + 'v8_linux_arm_lite_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -315,7 +340,7 @@ {'name': 'v8testing', 'variant': 'default', 'shards': 4}, ], }, - 'v8_linux_arm_rel_ng_triggered': { + 'v8_linux_arm_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -329,7 +354,7 @@ }, ############################################################################## # Linux64 - 'v8_linux64_asan_rel_ng_triggered': { + 'v8_linux64_asan_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -340,7 +365,7 @@ {'name': 'v8testing', 'variant': 'slow_path'}, ], }, - 'v8_linux64_cfi_rel_ng_triggered': { + 'v8_linux64_cfi_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -348,11 +373,23 @@ {'name': 'benchmarks'}, {'name': 'mozilla'}, {'name': 'optimize_for_size'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 3}, ], }, - 'v8_linux64_cppgc_non_default_dbg_ng_triggered': { + 'v8_linux64_coverage': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + # TODO(https://crbug.com/1265931): Speed things up for now. Later replace + # mjsunit and unittests with full v8testing. + # {'name': 'v8testing'}, + {'name': 'mjsunit', 'variant': 'default'}, + {'name': 'unittests', 'variant': 'default'}, + ], + }, + 'v8_linux64_cppgc_non_default_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -361,7 +398,15 @@ {'name': 'v8testing', 'shards': 3}, ], }, - 'v8_linux64_dbg_ng_triggered': { + 'v8_linux64_css_dbg': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 5}, + ], + }, + 'v8_linux64_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -376,6 +421,7 @@ {'name': 'test262', 'variant': 'extra', 'shards': 9}, {'name': 'v8testing', 'shards': 5}, {'name': 'v8testing', 'variant': 'extra', 'shards': 5}, + {'name': 'v8testing', 'variant': 'minor_mc'}, {'name': 'v8testing', 'variant': 'no_lfa'}, {'name': 'v8testing', 'variant': 'stress_instruction_scheduling'}, {'name': 'v8testing', 'variant': 'stress_concurrent_allocation'}, @@ -384,7 +430,7 @@ {'name': 'mjsunit', 'variant': 'maglev'}, ], }, - 'v8_linux64_dict_tracking_dbg_ng_triggered': { + 'v8_linux64_dict_tracking_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -393,7 +439,7 @@ {'name': 'v8testing', 'shards': 3}, ], }, - 'v8_linux64_disable_runtime_call_stats_rel_ng_triggered': { + 'v8_linux64_disable_runtime_call_stats_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -401,7 +447,7 @@ {'name': 'v8testing'}, ], }, - 'v8_linux64_external_code_space_dbg_ng_triggered': { + 'v8_linux64_external_code_space_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -410,14 +456,14 @@ {'name': 'v8testing', 'shards': 3}, ], }, - 'v8_linux64_fuzzilli_ng_triggered': { + 'v8_linux64_fuzzilli_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, # TODO(almuthanna): Add a new test config for the fuzzilli suite. 'tests': [], }, - 'v8_linux64_fyi_rel_ng_triggered': { + 'v8_linux64_fyi_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -439,7 +485,7 @@ {'name': 'mjsunit', 'variant': 'wasm_write_protect_code'}, ], }, - 'v8_linux64_gc_stress_custom_snapshot_dbg_ng_triggered': { + 'v8_linux64_gc_stress_custom_snapshot_dbg': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -451,7 +497,7 @@ }, ], }, - 'v8_linux64_gc_stress_dbg_ng_triggered': { + 'v8_linux64_gc_stress_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -472,7 +518,7 @@ }, ], }, - 'v8_linux64_gcc_rel_ng_triggered': { + 'v8_linux64_gcc_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-20.04', }, @@ -488,15 +534,7 @@ {'name': 'v8testing'}, ], }, - 'v8_linux64_heap_sandbox_dbg_ng_triggered': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-18.04', - }, - 'tests': [ - {'name': 'v8testing', 'shards': 4}, - ], - }, - 'v8_linux64_minor_mc_dbg_ng_triggered': { + 'v8_linux64_minor_mc_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -509,7 +547,7 @@ {'name': 'mjsunit', 'variant': 'minor_mc'}, ], }, - 'v8_linux64_msan_rel_ng_triggered': { + 'v8_linux64_msan_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -518,7 +556,7 @@ {'name': 'v8testing', 'shards': 5}, ], }, - 'v8_linux64_nodcheck_rel_ng_triggered': { + 'v8_linux64_nodcheck_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -544,7 +582,7 @@ {'name': 'mjsunit', 'variant': 'maglev'}, ], }, - 'v8_linux64_perfetto_dbg_ng_triggered': { + 'v8_linux64_perfetto_dbg': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -552,7 +590,7 @@ {'name': 'v8testing', 'shards': 3}, ], }, - 'v8_linux64_no_pointer_compression_rel_ng_triggered': { + 'v8_linux64_no_pointer_compression_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -560,7 +598,7 @@ {'name': 'v8testing', 'shards': 3}, ], }, - 'v8_linux64_no_sandbox_dbg_ng_triggered': { + 'v8_linux64_no_sandbox_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -569,7 +607,7 @@ {'name': 'v8testing', 'shards': 5}, ], }, - 'v8_linux64_single_generation_dbg_ng_triggered': { + 'v8_linux64_single_generation_dbg': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -577,7 +615,7 @@ {'name': 'v8testing', 'shards': 3}, ], }, - 'v8_linux64_rel_ng_triggered': { + 'v8_linux64_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -592,6 +630,7 @@ {'name': 'v8initializers'}, {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing', 'variant': 'minor_mc'}, {'name': 'v8testing', 'variant': 'no_lfa'}, {'name': 'v8testing', 'variant': 'slow_path'}, {'name': 'v8testing', 'variant': 'stress_instruction_scheduling'}, @@ -599,7 +638,7 @@ {'name': 'mjsunit', 'variant': 'maglev'}, ], }, - 'v8_linux64_predictable_rel_ng_triggered': { + 'v8_linux64_predictable_rel': { 'swarming_dimensions': { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -610,7 +649,7 @@ {'name': 'mozilla'}, ], }, - 'v8_linux64_no_sandbox_rel_ng_triggered': { + 'v8_linux64_no_sandbox_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', 'os': 'Ubuntu-18.04', @@ -619,7 +658,7 @@ {'name': 'v8testing', 'shards': 2}, ], }, - 'v8_linux64_tsan_rel_ng_triggered': { + 'v8_linux64_tsan_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -633,7 +672,7 @@ {'name': 'v8testing', 'variant': 'stress_concurrent_allocation', 'shards': 2}, ], }, - 'v8_linux64_tsan_no_cm_rel_ng_triggered': { + 'v8_linux64_tsan_no_cm_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -651,7 +690,7 @@ {'name': 'v8testing', 'variant': 'stress_concurrent_inlining', 'shards': 2}, ], }, - 'v8_linux64_tsan_isolates_rel_ng_triggered': { + 'v8_linux64_tsan_isolates_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -659,7 +698,7 @@ {'name': 'v8testing', 'test_args': ['--isolates'], 'shards': 7}, ], }, - 'v8_linux64_ubsan_rel_ng_triggered': { + 'v8_linux64_ubsan_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -667,7 +706,7 @@ {'name': 'v8testing', 'shards': 2}, ], }, - 'v8_linux64_verify_csa_rel_ng_triggered': { + 'v8_linux64_verify_csa_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -677,7 +716,7 @@ }, ############################################################################## # Linux64 with arm64 simulators - 'v8_linux_arm64_dbg_ng_triggered': { + 'v8_linux_arm64_dbg': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -689,7 +728,7 @@ {'name': 'v8testing', 'variant': 'extra', 'shards': 14}, ], }, - 'v8_linux_arm64_gc_stress_dbg_ng_triggered': { + 'v8_linux_arm64_gc_stress_dbg': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -697,15 +736,7 @@ {'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': { + 'v8_linux_arm64_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -717,7 +748,7 @@ {'name': 'v8testing', 'variant': 'extra', 'shards': 14}, ], }, - 'v8_linux_arm64_cfi_rel_ng_triggered': { + 'v8_linux_arm64_cfi_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -726,7 +757,7 @@ {'name': 'v8testing', 'shards': 4}, ], }, - 'v8_linux64_arm64_no_pointer_compression_rel_ng_triggered': { + 'v8_linux64_arm64_no_pointer_compression_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', }, @@ -736,7 +767,7 @@ }, ############################################################################## # Linux64 with Loongson simulators - 'v8_linux64_loong64_rel_ng_triggered': { + 'v8_linux64_loong64_rel': { 'swarming_dimensions': { 'os': 'Ubuntu-18.04', }, @@ -746,7 +777,7 @@ }, ############################################################################## # Linux with RISC-V simulators - 'v8_linux_riscv32_rel_ng_triggered': { + 'v8_linux_riscv32_rel': { 'swarming_dimensions': { 'os': 'Ubuntu-18.04', }, @@ -754,7 +785,7 @@ {'name': 'v8testing', 'shards': 3}, ], }, - 'v8_linux64_riscv64_rel_ng_triggered': { + 'v8_linux64_riscv64_rel': { 'swarming_dimensions': { 'os': 'Ubuntu-18.04', }, @@ -764,7 +795,7 @@ }, ############################################################################## # Odroids with native arm - 'v8_odroid_arm_rel_ng_triggered': { + 'v8_odroid_arm_rel': { 'swarming_dimensions' : { 'cores': '8', 'cpu': 'armv7l-32-ODROID-XU4', @@ -782,7 +813,7 @@ }, ############################################################################## # Win32 - 'v8_win_dbg_ng_triggered': { + 'v8_win_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', 'os': 'Windows-7-SP1', @@ -792,7 +823,7 @@ {'name': 'v8testing', 'shards': 3}, ], }, - 'v8_win_rel_ng_triggered': { + 'v8_win_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', 'os': 'Windows-7-SP1', @@ -805,7 +836,7 @@ }, ############################################################################## # Win64 - 'v8_win64_asan_rel_ng_triggered': { + 'v8_win64_asan_rel': { 'swarming_dimensions' : { 'os': 'Windows-10-19042', }, @@ -813,7 +844,7 @@ {'name': 'v8testing', 'shards': 5}, ], }, - 'v8_win64_dbg_ng_triggered': { + 'v8_win64_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', 'os': 'Windows-10-19042', @@ -825,7 +856,7 @@ {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, ], }, - 'v8_win64_msvc_rel_ng_triggered': { + 'v8_win64_msvc_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', 'os': 'Windows-10-19042', @@ -836,7 +867,7 @@ {'name': 'v8testing', 'shards': 2}, ], }, - 'v8_win64_rel_ng_triggered': { + 'v8_win64_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', 'os': 'Windows-10-19042', @@ -845,24 +876,24 @@ {'name': 'mozilla'}, {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 2}, - {'name': 'v8testing', 'variant': 'extra'}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, ], }, ############################################################################## # Mac64 - 'v8_mac64_asan_rel_ng_triggered': { + 'v8_mac64_asan_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'v8testing', 'shards': 8}, ], }, - 'v8_mac64_dbg_ng_triggered': { + 'v8_mac64_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'mozilla'}, @@ -871,19 +902,28 @@ {'name': 'v8testing', 'variant': 'extra', 'shards': 6}, ], }, - 'v8_mac64_gc_stress_dbg_ng_triggered': { + 'v8_mac64_gc_stress_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 6}, ], }, - 'v8_mac64_rel_ng_triggered': { + 'v8_mac64_noopt_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 6}, + ], + }, + 'v8_mac64_rel': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Mac-12', }, 'tests': [ {'name': 'mozilla'}, @@ -892,7 +932,7 @@ {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, ], }, - 'v8_mac_arm64_rel_ng_triggered': { + 'v8_mac_arm64_rel': { 'swarming_dimensions' : { 'cpu': 'arm64', 'os': 'Mac-11', @@ -902,7 +942,7 @@ {'name': 'v8testing'}, ], }, - 'v8_mac_arm64_dbg_ng_triggered': { + 'v8_mac_arm64_dbg': { 'swarming_dimensions' : { 'cpu': 'arm64', 'os': 'Mac-11', @@ -912,7 +952,7 @@ {'name': 'v8testing'}, ], }, - 'v8_mac_arm64_full_dbg_ng_triggered': { + 'v8_mac_arm64_full_dbg': { 'swarming_dimensions' : { 'cpu': 'arm64', 'os': 'Mac-11', @@ -922,7 +962,7 @@ {'name': 'v8testing'}, ], }, - 'v8_mac_arm64_no_pointer_compression_dbg_ng_triggered': { + 'v8_mac_arm64_no_pointer_compression_dbg': { 'swarming_dimensions' : { 'cpu': 'arm64', 'os': 'Mac-11', @@ -932,30 +972,30 @@ {'name': 'v8testing'}, ], }, - 'v8_mac_arm64_sim_rel_ng_triggered': { + 'v8_mac_arm64_sim_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'v8testing', 'shards': 8}, {'name': 'v8testing', 'variant': 'future', 'shards': 2}, ], }, - 'v8_mac_arm64_sim_dbg_ng_triggered': { + 'v8_mac_arm64_sim_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'v8testing', 'shards': 8}, {'name': 'v8testing', 'variant': 'future', 'shards': 2}, ], }, - 'v8_mac_arm64_sim_nodcheck_rel_ng_triggered': { + 'v8_mac_arm64_sim_nodcheck_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'v8testing', 'shards': 8}, @@ -987,7 +1027,6 @@ 'tests': [ {'name': 'benchmarks'}, {'name': 'benchmarks', 'variant': 'extra'}, - {'name': 'gcmole'}, {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, {'name': 'mozilla', 'variant': 'extra'}, @@ -1041,7 +1080,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1049,6 +1089,27 @@ 'test_args': ['--extra-flags', '--noenable-avx'], 'shards': 2 }, + {'name': 'gcmole_v2', 'variant': 'ia32'}, + {'name': 'gcmole_v2', 'variant': 'x64'}, + {'name': 'gcmole_v2', 'variant': 'arm'}, + {'name': 'gcmole_v2', 'variant': 'arm64'}, + # TODO(https://crbug.com/v8/12660): Remove v2 above after testing. + {'name': 'gcmole_v3', 'variant': 'ia32', 'shards': 4}, + {'name': 'gcmole_v3', 'variant': 'x64', 'shards': 4}, + {'name': 'gcmole_v3', 'variant': 'arm', 'shards': 4}, + {'name': 'gcmole_v3', 'variant': 'arm64', 'shards': 4}, + { + 'name': 'gcmole_v2', + 'variant': 'x64', + 'suffix': 'test single host', + 'test_args': ['--test-run'], + }, + { + 'name': 'gcmole_v3', + 'variant': 'x64', + 'suffix': 'test multi host', + 'test_args': ['--test-run'], + }, ], }, 'V8 Linux - arm64 - sim - CFI': { @@ -1084,9 +1145,9 @@ {'name': 'mozilla', 'variant': 'code_serializer', 'shards': 1}, {'name': 'mozilla', 'variant': 'extra'}, {'name': 'optimize_for_size'}, - {'name': 'test262', 'shards': 6}, + {'name': 'test262', 'shards': 12}, {'name': 'test262', 'variant': 'code_serializer', 'shards': 2}, - {'name': 'test262', 'variant': 'extra', 'shards': 5}, + {'name': 'test262', 'variant': 'extra', 'shards': 10}, {'name': 'v8testing', 'shards': 3}, { 'name': 'v8testing', @@ -1094,7 +1155,7 @@ 'test_args': ['--isolates'], 'shards': 4 }, - {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 4}, # Nosse3. { 'name': 'mozilla', @@ -1105,7 +1166,8 @@ 'name': 'test262', 'suffix': 'nosse3', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1123,7 +1185,8 @@ 'name': 'test262', 'suffix': 'nossse3', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-ssse3 --noenable-sse4-1 --noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-ssse3 --noenable-sse4-1 --noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1141,7 +1204,8 @@ 'name': 'test262', 'suffix': 'nosse4', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1159,7 +1223,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1201,20 +1266,10 @@ }, 'tests': [ {'name': 'mozilla', 'variant': 'default'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'variant': 'default'}, ], }, - 'V8 Linux - predictable': { - 'swarming_dimensions': { - 'os': 'Ubuntu-18.04', - }, - 'tests': [ - {'name': 'benchmarks'}, - {'name': 'd8testing'}, - {'name': 'mozilla'}, - ], - }, 'V8 Linux64 - predictable': { 'swarming_dimensions': { 'cpu': 'x86-64-avx2', @@ -1232,7 +1287,7 @@ }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing'}, ], }, @@ -1261,12 +1316,13 @@ {'name': 'optimize_for_size'}, {'name': 'perf_integration'}, {'name': 'test262', 'shards': 2}, - {'name': 'test262', 'variant': 'assert_types'}, + {'name': 'test262', 'variant': 'assert_types', 'shards': 2}, {'name': 'test262', 'variant': 'extra', 'shards': 2}, {'name': 'v8initializers'}, {'name': 'v8testing'}, {'name': 'v8testing', 'variant': 'assert_types'}, {'name': 'v8testing', 'variant': 'extra'}, + {'name': 'v8testing', 'variant': 'minor_mc'}, {'name': 'v8testing', 'variant': 'no_lfa'}, {'name': 'v8testing', 'variant': 'stress_instruction_scheduling'}, # Maglev -- move to extra once more architectures are supported. @@ -1281,7 +1337,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1298,10 +1355,22 @@ {'name': 'benchmarks'}, {'name': 'mozilla'}, {'name': 'optimize_for_size'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 2}, ], }, + 'V8 Linux64 - coverage': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + # TODO(https://crbug.com/1265931): Speed things up for now. Later replace + # mjsunit and unittests with full v8testing. + # {'name': 'v8testing'}, + {'name': 'mjsunit', 'variant': 'default'}, + {'name': 'unittests', 'variant': 'default'}, + ], + }, 'V8 Linux64 - custom snapshot - debug': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -1325,12 +1394,13 @@ {'name': 'test262', 'shards': 7}, {'name': 'test262', 'variant': 'extra', 'shards': 5}, {'name': 'v8testing', 'shards': 2}, - {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 4}, + {'name': 'v8testing', 'variant': 'minor_mc'}, {'name': 'v8testing', 'variant': 'no_lfa'}, {'name': 'v8testing', 'variant': 'slow_path'}, {'name': 'v8testing', 'variant': 'stress_instruction_scheduling'}, {'name': 'v8testing', 'variant': 'stress_concurrent_allocation'}, - {'name': 'v8testing', 'variant': 'stress_concurrent_inlining'}, + {'name': 'v8testing', 'variant': 'stress_concurrent_inlining', 'shards': 2}, # Maglev -- move to extra once more architectures are supported. {'name': 'mjsunit', 'variant': 'maglev'}, # Noavx. @@ -1343,7 +1413,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1503,14 +1574,6 @@ {'name': 'v8testing'}, ], }, - 'V8 Linux64 - heap sandbox - debug': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-18.04', - }, - 'tests': [ - {'name': 'v8testing', 'shards': 2}, - ], - }, 'V8 Linux64 - internal snapshot': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -1551,7 +1614,7 @@ }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing'}, ], }, @@ -1574,6 +1637,14 @@ {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, ], }, + 'V8 Linux64 css - debug': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 5}, + ], + }, 'V8 Linux64 GC Stress - custom snapshot': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -1673,7 +1744,7 @@ 'V8 Mac64': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'mozilla'}, @@ -1685,7 +1756,7 @@ 'V8 Mac64 - debug': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'mozilla'}, @@ -1697,7 +1768,7 @@ 'V8 Mac64 ASAN': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'v8testing', 'shards': 10}, @@ -1706,7 +1777,7 @@ 'V8 Mac64 GC Stress': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 6}, @@ -1757,7 +1828,7 @@ 'V8 Mac - arm64 - sim - debug': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'swarming_task_attrs': { 'expiration': 14400, @@ -1772,7 +1843,7 @@ 'V8 Mac - arm64 - sim - release': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'swarming_task_attrs': { 'expiration': 14400, @@ -1791,7 +1862,7 @@ }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing'}, ], }, @@ -1802,7 +1873,7 @@ }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 5}, ], }, @@ -1812,9 +1883,9 @@ }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, - {'name': 'v8testing'}, - {'name': 'v8testing', 'variant': 'extra'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, + {'name': 'v8testing', 'shards': 2}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, ], }, 'V8 Win64 - debug': { @@ -1834,8 +1905,8 @@ }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, - {'name': 'v8testing'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, + {'name': 'v8testing', 'shards': 2}, ], }, 'V8 Win64 ASAN': { @@ -1957,7 +2028,8 @@ 'name': 'test262', 'suffix': 'armv8-a', 'variant': 'default', - 'test_args': ['--extra-flags', '--enable-armv8'] + 'test_args': ['--extra-flags', '--enable-armv8'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1976,6 +2048,7 @@ 'suffix': 'novfp3', 'variant': 'default', 'test_args': ['--novfp3'], + 'shards': 2 }, { 'name': 'v8testing', @@ -2061,7 +2134,7 @@ 'tests': [ {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 3}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, ], @@ -2099,19 +2172,6 @@ }, ], }, - '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', @@ -2135,7 +2195,7 @@ 'priority': 35, }, 'tests': [ - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 4}, ], }, @@ -2355,7 +2415,7 @@ }, ], }, - 'v8_numfuzz_ng_triggered': { + 'v8_numfuzz_rel': { 'swarming_dimensions': { 'os': 'Ubuntu-18.04', }, @@ -2372,7 +2432,7 @@ }, ], }, - 'v8_numfuzz_tsan_ng_triggered': { + 'v8_numfuzz_tsan_rel': { 'swarming_dimensions': { 'os': 'Ubuntu-18.04', }, @@ -2425,7 +2485,7 @@ }, ], }, - 'v8_numfuzz_dbg_ng_triggered': { + 'v8_numfuzz_dbg': { 'swarming_dimensions': { 'os': 'Ubuntu-18.04', }, diff --git a/src/DEPS b/src/DEPS index 1edad011be..8912d7fb25 100644 --- a/src/DEPS +++ b/src/DEPS @@ -32,6 +32,7 @@ include_rules = [ "+src/heap/local-factory.h", "+src/heap/local-heap.h", "+src/heap/local-heap-inl.h", + "+src/heap/pretenuring-handler-inl.h", # TODO(v8:10496): Don't expose memory chunk outside of heap/. "+src/heap/memory-chunk.h", "+src/heap/memory-chunk-inl.h", diff --git a/src/api/api-natives.cc b/src/api/api-natives.cc index 562b7849b4..d0b2987234 100644 --- a/src/api/api-natives.cc +++ b/src/api/api-natives.cc @@ -83,6 +83,8 @@ MaybeHandle DefineAccessorProperty(Isolate* isolate, InstantiateFunction(isolate, Handle::cast(getter)), Object); + Handle trampoline = BUILTIN_CODE(isolate, DebugBreakTrampoline); + Handle::cast(getter)->set_code(*trampoline); } if (setter->IsFunctionTemplateInfo() && FunctionTemplateInfo::cast(*setter).BreakAtEntry()) { @@ -91,6 +93,8 @@ MaybeHandle DefineAccessorProperty(Isolate* isolate, InstantiateFunction(isolate, Handle::cast(setter)), Object); + Handle trampoline = BUILTIN_CODE(isolate, DebugBreakTrampoline); + Handle::cast(setter)->set_code(*trampoline); } RETURN_ON_EXCEPTION( isolate, @@ -529,7 +533,7 @@ MaybeHandle InstantiateFunction( if (!data->needs_access_check() && data->GetNamedPropertyHandler().IsUndefined(isolate) && data->GetIndexedPropertyHandler().IsUndefined(isolate)) { - function_type = FLAG_embedder_instance_types && data->HasInstanceType() + function_type = v8_flags.embedder_instance_types && data->HasInstanceType() ? static_cast(data->InstanceType()) : JS_API_OBJECT_TYPE; } diff --git a/src/api/api.cc b/src/api/api.cc index 2388a0921c..b125541699 100644 --- a/src/api/api.cc +++ b/src/api/api.cc @@ -63,6 +63,7 @@ #include "src/handles/global-handles.h" #include "src/handles/persistent-handles.h" #include "src/handles/shared-object-conveyor-handles.h" +#include "src/handles/traced-handles.h" #include "src/heap/embedder-tracing.h" #include "src/heap/heap-inl.h" #include "src/heap/heap-write-barrier.h" @@ -286,7 +287,7 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* i_isolate, const char* location, // BUG(1718): Don't use the take_snapshot since we don't support // HeapObjectIterator here without doing a special GC. i_isolate->heap()->RecordStats(&heap_stats, false); - if (!FLAG_correctness_fuzzer_suppressions) { + if (!v8_flags.correctness_fuzzer_suppressions) { char* first_newline = strchr(last_few_messages, '\n'); if (first_newline == nullptr || first_newline[1] == '\0') first_newline = last_few_messages; @@ -359,19 +360,12 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { namespace { #ifdef V8_ENABLE_SANDBOX -// ArrayBufferAllocator to use when sandboxed pointers are used in which case -// all ArrayBuffer backing stores need to be allocated inside the sandbox. -// Note, the current implementation is extremely inefficient as it uses the -// BoundedPageAllocator. In the future, we'll need a proper allocator -// implementation. +// ArrayBufferAllocator to use when the sandbox is enabled in which case all +// ArrayBuffer backing stores need to be allocated inside the sandbox. class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { public: - ArrayBufferAllocator() { CHECK(page_allocator_); } - void* Allocate(size_t length) override { - return page_allocator_->AllocatePages(nullptr, RoundUp(length, page_size_), - page_size_, - PageAllocator::kReadWrite); + return allocator_->Allocate(length); } void* AllocateUninitialized(size_t length) override { @@ -379,12 +373,136 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { } void Free(void* data, size_t length) override { - page_allocator_->FreePages(data, RoundUp(length, page_size_)); + return allocator_->Free(data); } private: - PageAllocator* page_allocator_ = internal::GetArrayBufferPageAllocator(); - const size_t page_size_ = page_allocator_->AllocatePageSize(); + // Backend allocator shared by all ArrayBufferAllocator instances. This way, + // there is a single region of virtual addres space reserved inside the + // sandbox from which all ArrayBufferAllocators allocate their memory, + // instead of each allocator creating their own region, which may cause + // address space exhaustion inside the sandbox. + // TODO(chromium:1340224): replace this with a more efficient allocator. + class BackendAllocator { + public: + BackendAllocator() { + CHECK(i::GetProcessWideSandbox()->is_initialized()); + VirtualAddressSpace* vas = i::GetProcessWideSandbox()->address_space(); + constexpr size_t max_backing_memory_size = 8ULL * i::GB; + constexpr size_t min_backing_memory_size = 1ULL * i::GB; + size_t backing_memory_size = max_backing_memory_size; + i::Address backing_memory_base = 0; + while (!backing_memory_base && + backing_memory_size >= min_backing_memory_size) { + backing_memory_base = vas->AllocatePages( + VirtualAddressSpace::kNoHint, backing_memory_size, kChunkSize, + PagePermissions::kNoAccess); + if (!backing_memory_base) { + backing_memory_size /= 2; + } + } + if (!backing_memory_base) { + i::V8::FatalProcessOutOfMemory( + nullptr, + "Could not reserve backing memory for ArrayBufferAllocators"); + } + DCHECK(IsAligned(backing_memory_base, kChunkSize)); + + region_alloc_ = std::make_unique( + backing_memory_base, backing_memory_size, kAllocationGranularity); + end_of_accessible_region_ = region_alloc_->begin(); + + // Install a on-merge callback to discard or decommit unused pages. + region_alloc_->set_on_merge_callback([this](i::Address start, + size_t size) { + mutex_.AssertHeld(); + VirtualAddressSpace* vas = i::GetProcessWideSandbox()->address_space(); + i::Address end = start + size; + if (end == region_alloc_->end() && + start <= end_of_accessible_region_ - kChunkSize) { + // Can shrink the accessible region. + i::Address new_end_of_accessible_region = RoundUp(start, kChunkSize); + size_t size = + end_of_accessible_region_ - new_end_of_accessible_region; + CHECK(vas->DecommitPages(new_end_of_accessible_region, size)); + end_of_accessible_region_ = new_end_of_accessible_region; + } else if (size >= 2 * kChunkSize) { + // Can discard pages. The pages stay accessible, so the size of the + // accessible region doesn't change. + i::Address chunk_start = RoundUp(start, kChunkSize); + i::Address chunk_end = RoundDown(start + size, kChunkSize); + CHECK(vas->DiscardSystemPages(chunk_start, chunk_end - chunk_start)); + } + }); + } + + ~BackendAllocator() { + // The sandbox may already have been torn down, in which case there's no + // need to free any memory. + if (i::GetProcessWideSandbox()->is_initialized()) { + VirtualAddressSpace* vas = i::GetProcessWideSandbox()->address_space(); + vas->FreePages(region_alloc_->begin(), region_alloc_->size()); + } + } + + BackendAllocator(const BackendAllocator&) = delete; + BackendAllocator& operator=(const BackendAllocator&) = delete; + + void* Allocate(size_t length) { + base::MutexGuard guard(&mutex_); + + length = RoundUp(length, kAllocationGranularity); + i::Address region = region_alloc_->AllocateRegion(length); + if (region == base::RegionAllocator::kAllocationFailure) return nullptr; + + // Check if the memory is inside the accessible region. If not, grow it. + i::Address end = region + length; + size_t length_to_memset = length; + if (end > end_of_accessible_region_) { + VirtualAddressSpace* vas = i::GetProcessWideSandbox()->address_space(); + i::Address new_end_of_accessible_region = RoundUp(end, kChunkSize); + size_t size = new_end_of_accessible_region - end_of_accessible_region_; + if (!vas->SetPagePermissions(end_of_accessible_region_, size, + PagePermissions::kReadWrite)) { + CHECK(region_alloc_->FreeRegion(region)); + return nullptr; + } + + // The pages that were inaccessible are guaranteed to be zeroed, so only + // memset until the previous end of the accessible region. + length_to_memset = end_of_accessible_region_ - region; + end_of_accessible_region_ = new_end_of_accessible_region; + } + + void* mem = reinterpret_cast(region); + memset(mem, 0, length_to_memset); + return mem; + } + + void Free(void* data) { + base::MutexGuard guard(&mutex_); + region_alloc_->FreeRegion(reinterpret_cast(data)); + } + + static BackendAllocator* SharedInstance() { + static base::LeakyObject instance; + return instance.get(); + } + + private: + // Use a region allocator with a "page size" of 128 bytes as a reasonable + // compromise between the number of regions it has to manage and the amount + // of memory wasted due to rounding allocation sizes up to the page size. + static constexpr size_t kAllocationGranularity = 128; + // The backing memory's accessible region is grown in chunks of this size. + static constexpr size_t kChunkSize = 1 * i::MB; + + std::unique_ptr region_alloc_; + size_t end_of_accessible_region_; + base::Mutex mutex_; + }; + + BackendAllocator* allocator_ = BackendAllocator::SharedInstance(); }; #else @@ -430,7 +548,7 @@ struct SnapshotCreatorData { SnapshotCreator::SnapshotCreator(Isolate* v8_isolate, const intptr_t* external_references, - StartupData* existing_snapshot) { + const StartupData* existing_snapshot) { SnapshotCreatorData* data = new SnapshotCreatorData(v8_isolate); i::Isolate* i_isolate = reinterpret_cast(v8_isolate); i_isolate->set_array_buffer_allocator(&data->allocator_); @@ -452,7 +570,7 @@ SnapshotCreator::SnapshotCreator(Isolate* v8_isolate, } SnapshotCreator::SnapshotCreator(const intptr_t* external_references, - StartupData* existing_snapshot) + const StartupData* existing_snapshot) : SnapshotCreator(Isolate::Allocate(), external_references, existing_snapshot) {} @@ -618,7 +736,10 @@ StartupData SnapshotCreator::CreateBlob( i::Snapshot::ClearReconstructableDataForSerialization( i_isolate, function_code_handling == FunctionCodeHandling::kClear); - i::GlobalSafepointScope global_safepoint(i_isolate); + i::SafepointKind safepoint_kind = i_isolate->has_shared_heap() + ? i::SafepointKind::kGlobal + : i::SafepointKind::kIsolate; + i::SafepointScope safepoint_scope(i_isolate, safepoint_kind); i::DisallowGarbageCollection no_gc_from_here_on; // Create a vector with all contexts and clear associated Persistent fields. @@ -656,7 +777,7 @@ StartupData SnapshotCreator::CreateBlob( data->created_ = true; return i::Snapshot::Create(i_isolate, &contexts, embedder_fields_serializers, - global_safepoint, no_gc_from_here_on); + safepoint_scope, no_gc_from_here_on); } bool StartupData::CanBeRehashed() const { @@ -794,10 +915,9 @@ i::Address* GlobalizeTracedReference(i::Isolate* i_isolate, i::Address* obj, Utils::ApiCheck((slot != nullptr), "v8::GlobalizeTracedReference", "the address slot must be not null"); #endif - i::Handle result = - i_isolate->global_handles()->CreateTraced(*obj, slot, store_mode); + auto result = i_isolate->traced_handles()->Create(*obj, slot, store_mode); #ifdef VERIFY_HEAP - if (i::FLAG_verify_heap) { + if (i::v8_flags.verify_heap) { i::Object(*obj).ObjectVerify(i_isolate); } #endif // VERIFY_HEAP @@ -805,16 +925,16 @@ i::Address* GlobalizeTracedReference(i::Isolate* i_isolate, i::Address* obj, } void MoveTracedReference(internal::Address** from, internal::Address** to) { - GlobalHandles::MoveTracedReference(from, to); + TracedHandles::Move(from, to); } void CopyTracedReference(const internal::Address* const* from, internal::Address** to) { - GlobalHandles::CopyTracedReference(from, to); + TracedHandles::Copy(from, to); } void DisposeTracedReference(internal::Address* location) { - GlobalHandles::DestroyTracedReference(location); + TracedHandles::Destroy(location); } } // namespace internal @@ -825,7 +945,7 @@ i::Address* GlobalizeReference(i::Isolate* i_isolate, i::Address* obj) { API_RCS_SCOPE(i_isolate, Persistent, New); i::Handle result = i_isolate->global_handles()->Create(*obj); #ifdef VERIFY_HEAP - if (i::FLAG_verify_heap) { + if (i::v8_flags.verify_heap) { i::Object(*obj).ObjectVerify(i_isolate); } #endif // VERIFY_HEAP @@ -1678,7 +1798,7 @@ void ObjectTemplate::SetAccessor(v8::Local name, SideEffectType getter_side_effect_type, SideEffectType setter_side_effect_type) { TemplateSetAccessor(this, name, getter, setter, data, settings, attribute, - i::FLAG_disable_old_api_accessors, false, + i::v8_flags.disable_old_api_accessors, false, getter_side_effect_type, setter_side_effect_type); } @@ -1690,7 +1810,7 @@ void ObjectTemplate::SetAccessor(v8::Local name, SideEffectType getter_side_effect_type, SideEffectType setter_side_effect_type) { TemplateSetAccessor(this, name, getter, setter, data, settings, attribute, - i::FLAG_disable_old_api_accessors, false, + i::v8_flags.disable_old_api_accessors, false, getter_side_effect_type, setter_side_effect_type); } @@ -1940,8 +2060,32 @@ void ObjectTemplate::SetCodeLike() { // --- S c r i p t s --- -// Internally, UnboundScript is a SharedFunctionInfo, and Script is a -// JSFunction. +// Internally, UnboundScript and UnboundModuleScript are SharedFunctionInfos, +// and Script is a JSFunction. + +namespace { +inline Local GetSharedFunctionInfoSourceMappingURL( + i::Isolate* isolate, i::Handle obj) { + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + if (obj->script().IsScript()) { + i::Object url = i::Script::cast(obj->script()).source_mapping_url(); + return Utils::ToLocal(i::Handle(url, isolate)); + } else { + return Local(); + } +} + +inline Local GetSharedFunctionInfoSourceURL( + i::Isolate* isolate, i::Handle obj) { + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + if (obj->script().IsScript()) { + i::Object url = i::Script::cast(obj->script()).source_url(); + return Utils::ToLocal(i::Handle(url, isolate)); + } else { + return Local(); + } +} +} // namespace ScriptCompiler::CachedData::CachedData(const uint8_t* data_, int length_, BufferPolicy buffer_policy_) @@ -2026,14 +2170,8 @@ Local UnboundScript::GetSourceURL() { i::Handle obj = i::Handle::cast(Utils::OpenHandle(this)); i::Isolate* i_isolate = obj->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); API_RCS_SCOPE(i_isolate, UnboundScript, GetSourceURL); - if (obj->script().IsScript()) { - i::Object url = i::Script::cast(obj->script()).source_url(); - return Utils::ToLocal(i::Handle(url, i_isolate)); - } else { - return Local(); - } + return GetSharedFunctionInfoSourceURL(i_isolate, obj); } Local UnboundScript::GetSourceMappingURL() { @@ -2041,13 +2179,23 @@ Local UnboundScript::GetSourceMappingURL() { i::Handle::cast(Utils::OpenHandle(this)); i::Isolate* i_isolate = obj->GetIsolate(); API_RCS_SCOPE(i_isolate, UnboundScript, GetSourceMappingURL); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); - if (obj->script().IsScript()) { - i::Object url = i::Script::cast(obj->script()).source_mapping_url(); - return Utils::ToLocal(i::Handle(url, i_isolate)); - } else { - return Local(); - } + return GetSharedFunctionInfoSourceMappingURL(i_isolate, obj); +} + +Local UnboundModuleScript::GetSourceURL() { + i::Handle obj = + i::Handle::cast(Utils::OpenHandle(this)); + i::Isolate* i_isolate = obj->GetIsolate(); + API_RCS_SCOPE(i_isolate, UnboundModuleScript, GetSourceURL); + return GetSharedFunctionInfoSourceURL(i_isolate, obj); +} + +Local UnboundModuleScript::GetSourceMappingURL() { + i::Handle obj = + i::Handle::cast(Utils::OpenHandle(this)); + i::Isolate* i_isolate = obj->GetIsolate(); + API_RCS_SCOPE(i_isolate, UnboundModuleScript, GetSourceMappingURL); + return GetSharedFunctionInfoSourceMappingURL(i_isolate, obj); } MaybeLocal Script::Run(Local context) { @@ -2076,7 +2224,7 @@ MaybeLocal Script::Run(Local context, // // To avoid this, on running scripts check first if JIT code log is // pending and generate immediately. - if (i::FLAG_enable_etw_stack_walking) { + if (i::v8_flags.enable_etw_stack_walking) { i::ETWJITInterface::MaybeSetHandlerNow(i_isolate); } #endif @@ -2085,14 +2233,15 @@ MaybeLocal Script::Run(Local context, // TODO(crbug.com/1193459): remove once ablation study is completed base::ElapsedTimer timer; base::TimeDelta delta; - if (i::FLAG_script_delay > 0) { - delta = v8::base::TimeDelta::FromMillisecondsD(i::FLAG_script_delay); + if (i::v8_flags.script_delay > 0) { + delta = v8::base::TimeDelta::FromMillisecondsD(i::v8_flags.script_delay); } - if (i::FLAG_script_delay_once > 0 && !i_isolate->did_run_script_delay()) { - delta = v8::base::TimeDelta::FromMillisecondsD(i::FLAG_script_delay_once); + if (i::v8_flags.script_delay_once > 0 && !i_isolate->did_run_script_delay()) { + delta = + v8::base::TimeDelta::FromMillisecondsD(i::v8_flags.script_delay_once); i_isolate->set_did_run_script_delay(true); } - if (i::FLAG_script_delay_fraction > 0.0) { + if (i::v8_flags.script_delay_fraction > 0.0) { timer.Start(); } else if (delta.InMicroseconds() > 0) { timer.Start(); @@ -2101,7 +2250,7 @@ MaybeLocal Script::Run(Local context, } } - if (V8_UNLIKELY(i::FLAG_experimental_web_snapshots)) { + if (V8_UNLIKELY(i::v8_flags.experimental_web_snapshots)) { i::Handle maybe_script = handle(fun->shared().script(), i_isolate); if (maybe_script->IsScript() && @@ -2125,9 +2274,9 @@ MaybeLocal Script::Run(Local context, has_pending_exception = !ToLocal( i::Execution::CallScript(i_isolate, fun, receiver, options), &result); - if (i::FLAG_script_delay_fraction > 0.0) { + if (i::v8_flags.script_delay_fraction > 0.0) { delta = v8::base::TimeDelta::FromMillisecondsD( - timer.Elapsed().InMillisecondsF() * i::FLAG_script_delay_fraction); + timer.Elapsed().InMillisecondsF() * i::v8_flags.script_delay_fraction); timer.Restart(); while (timer.Elapsed() < delta) { // Busy wait. @@ -2734,7 +2883,7 @@ ScriptCompiler::ScriptStreamingTask* ScriptCompiler::StartStreaming( Utils::ApiCheck(options == kNoCompileOptions || options == kEagerCompile, "v8::ScriptCompiler::StartStreaming", "Invalid CompileOptions"); - if (!i::FLAG_script_streaming) return nullptr; + if (!i::v8_flags.script_streaming) return nullptr; i::Isolate* i_isolate = reinterpret_cast(v8_isolate); i::ScriptStreamingData* data = source->impl(); std::unique_ptr task = @@ -2767,20 +2916,22 @@ void ScriptCompiler::ConsumeCodeCacheTask::SourceTextAvailable( bool ScriptCompiler::ConsumeCodeCacheTask::ShouldMergeWithExistingScript() const { - if (!i::FLAG_merge_background_deserialized_script_with_compilation_cache) { + if (!i::v8_flags + .merge_background_deserialized_script_with_compilation_cache) { return false; } return impl_->ShouldMergeWithExistingScript(); } void ScriptCompiler::ConsumeCodeCacheTask::MergeWithExistingScript() { - DCHECK(i::FLAG_merge_background_deserialized_script_with_compilation_cache); + DCHECK( + i::v8_flags.merge_background_deserialized_script_with_compilation_cache); impl_->MergeWithExistingScript(); } ScriptCompiler::ConsumeCodeCacheTask* ScriptCompiler::StartConsumingCodeCache( Isolate* v8_isolate, std::unique_ptr cached_data) { - if (!i::FLAG_concurrent_cache_deserialization) return nullptr; + if (!i::v8_flags.concurrent_cache_deserialization) return nullptr; i::Isolate* i_isolate = reinterpret_cast(v8_isolate); DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate); return new ScriptCompiler::ConsumeCodeCacheTask( @@ -3721,6 +3872,7 @@ bool Value::IsWasmModuleObject() const { return false; } #endif // V8_ENABLE_WEBASSEMBLY VALUE_IS_SPECIFIC_TYPE(WeakMap, JSWeakMap) VALUE_IS_SPECIFIC_TYPE(WeakSet, JSWeakSet) +VALUE_IS_SPECIFIC_TYPE(WeakRef, JSWeakRef) #undef VALUE_IS_SPECIFIC_TYPE @@ -4059,10 +4211,18 @@ size_t v8::BackingStore::ByteLength() const { return reinterpret_cast(this)->byte_length(); } +size_t v8::BackingStore::MaxByteLength() const { + return reinterpret_cast(this)->max_byte_length(); +} + bool v8::BackingStore::IsShared() const { return reinterpret_cast(this)->is_shared(); } +bool v8::BackingStore::IsResizableByUserJavaScript() const { + return reinterpret_cast(this)->is_resizable_by_js(); +} + // static std::unique_ptr v8::BackingStore::Reallocate( v8::Isolate* v8_isolate, std::unique_ptr backing_store, @@ -4756,11 +4916,16 @@ MaybeLocal v8::Object::ObjectProtoToString(Local context) { } Local v8::Object::GetConstructorName() { + // TODO(v8:12547): Consider adding GetConstructorName(Local). auto self = Utils::OpenHandle(this); - // TODO(v8:12547): Support shared objects. - DCHECK(!self->InSharedHeap()); + i::Isolate* i_isolate; + if (self->InSharedWritableHeap()) { + i_isolate = i::Isolate::Current(); + } else { + i_isolate = self->GetIsolate(); + } i::Handle name = - i::JSReceiver::GetConstructorName(self->GetIsolate(), self); + i::JSReceiver::GetConstructorName(i_isolate, self); return Utils::ToLocal(name); } @@ -4910,7 +5075,7 @@ Maybe Object::SetAccessor(Local context, Local name, SideEffectType setter_side_effect_type) { return ObjectSetAccessor(context, this, name, getter, setter, data.FromMaybe(Local()), settings, attribute, - i::FLAG_disable_old_api_accessors, false, + i::v8_flags.disable_old_api_accessors, false, getter_side_effect_type, setter_side_effect_type); } @@ -6182,7 +6347,8 @@ void v8::Object::SetAlignedPointerInInternalField(int index, void* value) { .store_aligned_pointer(obj->GetIsolate(), value), location, "Unaligned pointer"); DCHECK_EQ(value, GetAlignedPointerFromInternalField(index)); - internal::WriteBarrier::MarkingFromInternalFields(i::JSObject::cast(*obj)); + internal::WriteBarrier::CombinedBarrierFromInternalFields( + i::JSObject::cast(*obj), value); } void v8::Object::SetAlignedPointerInInternalFields(int argc, int indices[], @@ -6205,7 +6371,8 @@ void v8::Object::SetAlignedPointerInInternalFields(int argc, int indices[], location, "Unaligned pointer"); DCHECK_EQ(value, GetAlignedPointerFromInternalField(index)); } - internal::WriteBarrier::MarkingFromInternalFields(js_obj); + internal::WriteBarrier::CombinedBarrierFromInternalFields(js_obj, argc, + values); } // --- E n v i r o n m e n t --- @@ -6653,10 +6820,31 @@ v8::Isolate* Context::GetIsolate() { v8::MicrotaskQueue* Context::GetMicrotaskQueue() { i::Handle env = Utils::OpenHandle(this); Utils::ApiCheck(env->IsNativeContext(), "v8::Context::GetMicrotaskQueue", - "Must be calld on a native context"); + "Must be called on a native context"); return i::Handle::cast(env)->microtask_queue(); } +void Context::SetMicrotaskQueue(v8::MicrotaskQueue* queue) { + i::Handle context = Utils::OpenHandle(this); + i::Isolate* i_isolate = context->GetIsolate(); + Utils::ApiCheck(context->IsNativeContext(), "v8::Context::SetMicrotaskQueue", + "Must be called on a native context"); + i::Handle native_context = + i::Handle::cast(context); + i::HandleScopeImplementer* impl = i_isolate->handle_scope_implementer(); + Utils::ApiCheck(!native_context->microtask_queue()->IsRunningMicrotasks(), + "v8::Context::SetMicrotaskQueue", + "Must not be running microtasks"); + Utils::ApiCheck( + native_context->microtask_queue()->GetMicrotasksScopeDepth() == 0, + "v8::Context::SetMicrotaskQueue", "Must not have microtask scope pushed"); + Utils::ApiCheck(impl->EnteredContextCount() == 0, + "v8::Context::SetMicrotaskQueue()", + "Cannot set Microtask Queue with an entered context"); + native_context->set_microtask_queue( + i_isolate, static_cast(queue)); +} + v8::Local Context::Global() { i::Handle context = Utils::OpenHandle(this); i::Isolate* i_isolate = context->GetIsolate(); @@ -6785,6 +6973,14 @@ void v8::Context::SetPromiseHooks(Local init_hook, #endif // V8_ENABLE_JAVASCRIPT_PROMISE_HOOKS } +bool Context::HasTemplateLiteralObject(Local object) { + i::DisallowGarbageCollection no_gc; + i::Object i_object = *Utils::OpenHandle(*object); + if (!i_object.IsJSArray()) return false; + return Utils::OpenHandle(this)->native_context().HasTemplateLiteralObject( + i::JSArray::cast(i_object)); +} + MaybeLocal metrics::Recorder::GetContext( Isolate* v8_isolate, metrics::Recorder::ContextId id) { i::Isolate* i_isolate = reinterpret_cast(v8_isolate); @@ -7128,9 +7324,16 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) { return false; } - // It is safe to call GetIsolateFromWritableHeapObject because - // SupportsExternalization already checked that the object is writable. - i::Isolate* i_isolate = i::GetIsolateFromWritableObject(obj); + // TODO(v8:12007): Consider adding + // MakeExternal(Isolate*, ExternalStringResource*). + i::Isolate* i_isolate; + if (obj.InSharedWritableHeap()) { + i_isolate = i::Isolate::Current(); + } else { + // It is safe to call GetIsolateFromWritableHeapObject because + // SupportsExternalization already checked that the object is writable. + i_isolate = i::GetIsolateFromWritableObject(obj); + } ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); CHECK(resource && resource->data()); @@ -7154,9 +7357,16 @@ bool v8::String::MakeExternal( return false; } - // It is safe to call GetIsolateFromWritableHeapObject because - // SupportsExternalization already checked that the object is writable. - i::Isolate* i_isolate = i::GetIsolateFromWritableObject(obj); + // TODO(v8:12007): Consider adding + // MakeExternal(Isolate*, ExternalOneByteStringResource*). + i::Isolate* i_isolate; + if (obj.InSharedWritableHeap()) { + i_isolate = i::Isolate::Current(); + } else { + // It is safe to call GetIsolateFromWritableHeapObject because + // SupportsExternalization already checked that the object is writable. + i_isolate = i::GetIsolateFromWritableObject(obj); + } ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); CHECK(resource && resource->data()); @@ -8095,6 +8305,10 @@ bool v8::ArrayBuffer::IsDetachable() const { return Utils::OpenHandle(this)->is_detachable(); } +bool v8::ArrayBuffer::WasDetached() const { + return Utils::OpenHandle(this)->was_detached(); +} + namespace { std::shared_ptr ToInternal( std::shared_ptr backing_store) { @@ -8102,19 +8316,42 @@ std::shared_ptr ToInternal( } } // namespace -void v8::ArrayBuffer::Detach() { +Maybe v8::ArrayBuffer::Detach(v8::Local key) { i::Handle obj = Utils::OpenHandle(this); i::Isolate* i_isolate = obj->GetIsolate(); Utils::ApiCheck(obj->is_detachable(), "v8::ArrayBuffer::Detach", "Only detachable ArrayBuffers can be detached"); - API_RCS_SCOPE(i_isolate, ArrayBuffer, Detach); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); - obj->Detach(); + ENTER_V8_NO_SCRIPT( + i_isolate, reinterpret_cast(i_isolate)->GetCurrentContext(), + ArrayBuffer, Detach, Nothing(), i::HandleScope); + if (!key.IsEmpty()) { + i::Handle i_key = Utils::OpenHandle(*key); + constexpr bool kForceForWasmMemory = false; + has_pending_exception = + i::JSArrayBuffer::Detach(obj, kForceForWasmMemory, i_key).IsNothing(); + } else { + has_pending_exception = i::JSArrayBuffer::Detach(obj).IsNothing(); + } + RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); + return Just(true); +} + +void v8::ArrayBuffer::Detach() { Detach(Local()).Check(); } + +void v8::ArrayBuffer::SetDetachKey(v8::Local key) { + i::Handle obj = Utils::OpenHandle(this); + i::Handle i_key = Utils::OpenHandle(*key); + obj->set_detach_key(*i_key); } size_t v8::ArrayBuffer::ByteLength() const { i::Handle obj = Utils::OpenHandle(this); - return obj->byte_length(); + return obj->GetByteLength(); +} + +size_t v8::ArrayBuffer::MaxByteLength() const { + i::Handle obj = Utils::OpenHandle(this); + return obj->max_byte_length(); } Local v8::ArrayBuffer::New(Isolate* v8_isolate, @@ -8176,12 +8413,12 @@ std::unique_ptr v8::ArrayBuffer::NewBackingStore( void* deleter_data) { CHECK_LE(byte_length, i::JSArrayBuffer::kMaxByteLength); #ifdef V8_ENABLE_SANDBOX - Utils::ApiCheck( - !data || i::GetProcessWideSandbox()->Contains(data), - "v8_ArrayBuffer_NewBackingStore", - "When the V8 Sandbox is enabled, ArrayBuffer backing stores must be " - "allocated inside the sandbox address space. Please use an appropriate " - "ArrayBuffer::Allocator to allocate these buffers."); + Utils::ApiCheck(!data || i::GetProcessWideSandbox()->Contains(data), + "v8_ArrayBuffer_NewBackingStore", + "When the V8 Sandbox is enabled, ArrayBuffer backing stores " + "must be allocated inside the sandbox address space. Please " + "use an appropriate ArrayBuffer::Allocator to allocate these " + "buffers, or disable the sandbox."); #endif // V8_ENABLE_SANDBOX std::unique_ptr backing_store = @@ -8191,6 +8428,41 @@ std::unique_ptr v8::ArrayBuffer::NewBackingStore( static_cast(backing_store.release())); } +// static +std::unique_ptr v8::ArrayBuffer::NewResizableBackingStore( + size_t byte_length, size_t max_byte_length) { + Utils::ApiCheck(i::v8_flags.harmony_rab_gsab, + "v8::ArrayBuffer::NewResizableBackingStore", + "Constructing resizable ArrayBuffers is not supported"); + Utils::ApiCheck(byte_length <= max_byte_length, + "v8::ArrayBuffer::NewResizableBackingStore", + "Cannot construct resizable ArrayBuffer, byte_length must be " + "<= max_byte_length"); + Utils::ApiCheck( + byte_length <= i::JSArrayBuffer::kMaxByteLength, + "v8::ArrayBuffer::NewResizableBackingStore", + "Cannot construct resizable ArrayBuffer, requested length is too big"); + + size_t page_size, initial_pages, max_pages; + if (i::JSArrayBuffer::GetResizableBackingStorePageConfiguration( + nullptr, byte_length, max_byte_length, i::kDontThrow, &page_size, + &initial_pages, &max_pages) + .IsNothing()) { + i::V8::FatalProcessOutOfMemory(nullptr, + "v8::ArrayBuffer::NewResizableBackingStore"); + } + std::unique_ptr backing_store = + i::BackingStore::TryAllocateAndPartiallyCommitMemory( + nullptr, byte_length, max_byte_length, page_size, initial_pages, + max_pages, i::WasmMemoryFlag::kNotWasm, i::SharedFlag::kNotShared); + if (!backing_store) { + i::V8::FatalProcessOutOfMemory(nullptr, + "v8::ArrayBuffer::NewResizableBackingStore"); + } + return std::unique_ptr( + static_cast(backing_store.release())); +} + Local v8::ArrayBufferView::Buffer() { i::Handle obj = Utils::OpenHandle(this); i::Handle buffer; @@ -8240,13 +8512,21 @@ size_t v8::ArrayBufferView::ByteOffset() { } size_t v8::ArrayBufferView::ByteLength() { - i::Handle obj = Utils::OpenHandle(this); - return obj->WasDetached() ? 0 : obj->byte_length(); + i::DisallowGarbageCollection no_gc; + i::JSArrayBufferView obj = *Utils::OpenHandle(this); + if (obj.WasDetached()) { + return 0; + } + if (obj.IsJSTypedArray()) { + return i::JSTypedArray::cast(obj).GetByteLength(); + } + return i::JSDataView::cast(obj).GetByteLength(); } size_t v8::TypedArray::Length() { - i::Handle obj = Utils::OpenHandle(this); - return obj->WasDetached() ? 0 : obj->length(); + i::DisallowGarbageCollection no_gc; + i::JSTypedArray obj = *Utils::OpenHandle(this); + return obj.WasDetached() ? 0 : obj.GetLength(); } static_assert( @@ -8273,7 +8553,7 @@ static_assert( Local Type##Array::New( \ Local shared_array_buffer, size_t byte_offset, \ size_t length) { \ - CHECK(i::FLAG_harmony_sharedarraybuffer); \ + CHECK(i::v8_flags.harmony_sharedarraybuffer); \ i::Isolate* i_isolate = \ Utils::OpenHandle(*shared_array_buffer)->GetIsolate(); \ API_RCS_SCOPE(i_isolate, Type##Array, New); \ @@ -8295,6 +8575,7 @@ static_assert( TYPED_ARRAYS(TYPED_ARRAY_NEW) #undef TYPED_ARRAY_NEW +// TODO(v8:11111): Support creating length tracking DataViews via the API. Local DataView::New(Local array_buffer, size_t byte_offset, size_t byte_length) { i::Handle buffer = Utils::OpenHandle(*array_buffer); @@ -8308,7 +8589,7 @@ Local DataView::New(Local array_buffer, Local DataView::New(Local shared_array_buffer, size_t byte_offset, size_t byte_length) { - CHECK(i::FLAG_harmony_sharedarraybuffer); + CHECK(i::v8_flags.harmony_sharedarraybuffer); i::Handle buffer = Utils::OpenHandle(*shared_array_buffer); i::Isolate* i_isolate = buffer->GetIsolate(); API_RCS_SCOPE(i_isolate, DataView, New); @@ -8320,12 +8601,17 @@ Local DataView::New(Local shared_array_buffer, size_t v8::SharedArrayBuffer::ByteLength() const { i::Handle obj = Utils::OpenHandle(this); - return obj->byte_length(); + return obj->GetByteLength(); +} + +size_t v8::SharedArrayBuffer::MaxByteLength() const { + i::Handle obj = Utils::OpenHandle(this); + return obj->max_byte_length(); } Local v8::SharedArrayBuffer::New(Isolate* v8_isolate, size_t byte_length) { - CHECK(i::FLAG_harmony_sharedarraybuffer); + CHECK(i::v8_flags.harmony_sharedarraybuffer); i::Isolate* i_isolate = reinterpret_cast(v8_isolate); API_RCS_SCOPE(i_isolate, SharedArrayBuffer, New); ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); @@ -8347,7 +8633,7 @@ Local v8::SharedArrayBuffer::New(Isolate* v8_isolate, Local v8::SharedArrayBuffer::New( Isolate* v8_isolate, std::shared_ptr backing_store) { - CHECK(i::FLAG_harmony_sharedarraybuffer); + CHECK(i::v8_flags.harmony_sharedarraybuffer); CHECK_IMPLIES(backing_store->ByteLength() != 0, backing_store->Data() != nullptr); i::Isolate* i_isolate = reinterpret_cast(v8_isolate); @@ -8738,7 +9024,7 @@ bool Isolate::HasPendingBackgroundTasks() { } void Isolate::RequestGarbageCollectionForTesting(GarbageCollectionType type) { - Utils::ApiCheck(i::FLAG_expose_gc, + Utils::ApiCheck(i::v8_flags.expose_gc, "v8::Isolate::RequestGarbageCollectionForTesting", "Must use --expose-gc"); if (type == kMinorGarbageCollection) { @@ -9256,7 +9542,7 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory( void Isolate::SetEventLogger(LogEventCallback that) { // Do not overwrite the event logger if we want to log explicitly. - if (i::FLAG_log_internal_timer_events) return; + if (i::v8_flags.log_internal_timer_events) return; i::Isolate* i_isolate = reinterpret_cast(this); i_isolate->set_event_logger(that); } @@ -9389,7 +9675,7 @@ bool Isolate::IdleNotificationDeadline(double deadline_in_seconds) { // Returning true tells the caller that it need not // continue to call IdleNotification. i::Isolate* i_isolate = reinterpret_cast(this); - if (!i::FLAG_use_idle_notification) return true; + if (!i::v8_flags.use_idle_notification) return true; return i_isolate->heap()->IdleNotification(deadline_in_seconds); } @@ -9575,16 +9861,19 @@ CALLBACK_SETTER(WasmAsyncResolvePromiseCallback, CALLBACK_SETTER(WasmLoadSourceMapCallback, WasmLoadSourceMapCallback, wasm_load_source_map_callback) -CALLBACK_SETTER(WasmSimdEnabledCallback, WasmSimdEnabledCallback, - wasm_simd_enabled_callback) - -CALLBACK_SETTER(WasmExceptionsEnabledCallback, WasmExceptionsEnabledCallback, - wasm_exceptions_enabled_callback) - CALLBACK_SETTER(SharedArrayBufferConstructorEnabledCallback, SharedArrayBufferConstructorEnabledCallback, sharedarraybuffer_constructor_enabled_callback) +void Isolate::SetWasmExceptionsEnabledCallback( + WasmExceptionsEnabledCallback callback) { + // Exceptions are always enabled +} + +void Isolate::SetWasmSimdEnabledCallback(WasmSimdEnabledCallback callback) { + // SIMD is always enabled +} + void Isolate::InstallConditionalFeatures(Local context) { v8::HandleScope handle_scope(this); v8::Context::Scope context_scope(context); @@ -9592,7 +9881,7 @@ void Isolate::InstallConditionalFeatures(Local context) { if (i_isolate->is_execution_terminating()) return; i_isolate->InstallConditionalFeatures(Utils::OpenHandle(*context)); #if V8_ENABLE_WEBASSEMBLY - if (i::FLAG_expose_wasm && !i_isolate->has_pending_exception()) { + if (i::v8_flags.expose_wasm && !i_isolate->has_pending_exception()) { i::WasmJs::InstallConditionalFeatures(i_isolate, Utils::OpenHandle(*context)); } @@ -9743,6 +10032,11 @@ MicrotasksScope::MicrotasksScope(Isolate* v8_isolate, MicrotasksScope::Type type) : MicrotasksScope(v8_isolate, nullptr, type) {} +MicrotasksScope::MicrotasksScope(Local v8_context, + MicrotasksScope::Type type) + : MicrotasksScope(v8_context->GetIsolate(), v8_context->GetMicrotaskQueue(), + type) {} + MicrotasksScope::MicrotasksScope(Isolate* v8_isolate, MicrotaskQueue* microtask_queue, MicrotasksScope::Type type) @@ -10064,6 +10358,21 @@ int64_t CpuProfile::GetEndTime() const { return profile->end_time().since_origin().InMicroseconds(); } +static i::CpuProfile* ToInternal(const CpuProfile* profile) { + return const_cast( + reinterpret_cast(profile)); +} + +void CpuProfile::Serialize(OutputStream* stream, + CpuProfile::SerializationFormat format) const { + Utils::ApiCheck(format == kJSON, "v8::CpuProfile::Serialize", + "Unknown serialization format"); + Utils::ApiCheck(stream->GetChunkSize() > 0, "v8::CpuProfile::Serialize", + "Invalid stream chunk size"); + i::CpuProfileJSONSerializer serializer(ToInternal(this)); + serializer.Serialize(stream); +} + int CpuProfile::GetSamplesCount() const { return reinterpret_cast(this)->samples_count(); } @@ -10526,7 +10835,7 @@ void EmbedderHeapTracer::IterateTracedGlobalHandles( TracedGlobalHandleVisitor* visitor) { i::Isolate* i_isolate = reinterpret_cast(v8_isolate_); i::DisallowGarbageCollection no_gc; - i_isolate->global_handles()->IterateTracedNodes(visitor); + i_isolate->traced_handles()->Iterate(visitor); } bool EmbedderHeapTracer::IsRootForNonTracingGC( diff --git a/src/asmjs/asm-js.cc b/src/asmjs/asm-js.cc index a6973bd385..cb904a0be0 100644 --- a/src/asmjs/asm-js.cc +++ b/src/asmjs/asm-js.cc @@ -133,7 +133,7 @@ void Report(Handle