From 97fba1de92a125b88359462b4f8870419c1b6e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 27 May 2022 15:35:25 +0200 Subject: [PATCH 01/14] deps: update V8 to 10.3.174.8 --- deps/v8/AUTHORS | 2 + deps/v8/BUILD.bazel | 69 +- deps/v8/BUILD.gn | 105 +- deps/v8/DEPS | 61 +- deps/v8/bazel/config/BUILD.bazel | 8 + deps/v8/gni/release_branch_toggle.gni | 2 +- deps/v8/include/cppgc/heap-statistics.h | 2 +- deps/v8/include/cppgc/heap.h | 4 +- .../cppgc/internal/caged-heap-local-data.h | 28 +- deps/v8/include/cppgc/internal/name-trait.h | 25 +- .../v8/include/cppgc/internal/write-barrier.h | 81 +- deps/v8/include/cppgc/name-provider.h | 8 +- deps/v8/include/js_protocol.pdl | 25 +- deps/v8/include/v8-callbacks.h | 11 +- deps/v8/include/v8-cppgc.h | 3 - deps/v8/include/v8-embedder-heap.h | 4 +- deps/v8/include/v8-exception.h | 2 +- deps/v8/include/v8-fast-api-calls.h | 25 - deps/v8/include/v8-initialization.h | 15 +- deps/v8/include/v8-inspector.h | 21 +- deps/v8/include/v8-internal.h | 14 +- deps/v8/include/v8-isolate.h | 36 +- deps/v8/include/v8-local-handle.h | 10 +- deps/v8/include/v8-locker.h | 4 +- deps/v8/include/v8-maybe.h | 25 +- deps/v8/include/v8-message.h | 6 +- deps/v8/include/v8-microtask-queue.h | 2 +- deps/v8/include/v8-object.h | 6 - deps/v8/include/v8-platform.h | 35 +- deps/v8/include/v8-profiler.h | 69 +- deps/v8/include/v8-script.h | 9 +- deps/v8/include/v8-version.h | 6 +- deps/v8/include/v8-wasm.h | 2 +- deps/v8/include/v8-weak-callback-info.h | 7 - deps/v8/infra/mb/mb_config.pyl | 4 +- deps/v8/infra/testing/builders.pyl | 29 +- deps/v8/src/api/api-inl.h | 8 - deps/v8/src/api/api-macros-undef.h | 4 +- deps/v8/src/api/api-macros.h | 143 +- deps/v8/src/api/api.cc | 3369 +++--- deps/v8/src/ast/ast.cc | 22 + deps/v8/src/ast/ast.h | 8 + deps/v8/src/ast/prettyprinter.cc | 4 + deps/v8/src/base/address-region.h | 17 +- deps/v8/src/base/atomicops.h | 15 +- .../atomicops_internals_atomicword_compat.h | 89 - deps/v8/src/base/bits.cc | 8 +- deps/v8/src/base/bits.h | 8 +- deps/v8/src/base/bounded-page-allocator.cc | 52 +- deps/v8/src/base/bounded-page-allocator.h | 25 +- .../base/emulated-virtual-address-subspace.cc | 6 + .../base/emulated-virtual-address-subspace.h | 3 + deps/v8/src/base/functional.h | 55 +- deps/v8/src/base/ieee754.cc | 56 +- deps/v8/src/base/iterator.h | 37 +- deps/v8/src/base/macros.h | 2 + deps/v8/src/base/numbers/double.h | 8 +- deps/v8/src/base/page-allocator.cc | 6 + deps/v8/src/base/page-allocator.h | 3 + deps/v8/src/base/platform/platform-cygwin.cc | 5 + deps/v8/src/base/platform/platform-fuchsia.cc | 22 +- deps/v8/src/base/platform/platform-linux.cc | 301 +- deps/v8/src/base/platform/platform-linux.h | 42 + deps/v8/src/base/platform/platform-posix.cc | 144 +- deps/v8/src/base/platform/platform-posix.h | 5 + .../src/base/platform/platform-starboard.cc | 5 + deps/v8/src/base/platform/platform-win32.cc | 40 +- deps/v8/src/base/platform/platform.h | 34 +- deps/v8/src/base/platform/time.cc | 22 + deps/v8/src/base/platform/time.h | 12 +- .../src/base/sanitizer/lsan-page-allocator.h | 9 + .../sanitizer/lsan-virtual-address-space.h | 5 + deps/v8/src/base/small-vector.h | 18 +- deps/v8/src/base/threaded-list.h | 58 +- .../src/base/utils/random-number-generator.cc | 4 +- .../src/base/utils/random-number-generator.h | 2 +- deps/v8/src/base/vector.h | 44 +- .../virtual-address-space-page-allocator.cc | 6 + .../virtual-address-space-page-allocator.h | 3 + deps/v8/src/base/virtual-address-space.cc | 20 + deps/v8/src/base/virtual-address-space.h | 6 + .../baseline/arm/baseline-assembler-arm-inl.h | 26 + .../arm64/baseline-assembler-arm64-inl.h | 28 + deps/v8/src/baseline/baseline-assembler-inl.h | 5 + deps/v8/src/baseline/baseline-assembler.h | 10 + .../src/baseline/baseline-batch-compiler.cc | 25 +- deps/v8/src/baseline/baseline-compiler.cc | 66 +- .../ia32/baseline-assembler-ia32-inl.h | 27 + .../loong64/baseline-assembler-loong64-inl.h | 24 + .../mips/baseline-assembler-mips-inl.h | 24 + .../mips64/baseline-assembler-mips64-inl.h | 24 + .../baseline/ppc/baseline-assembler-ppc-inl.h | 156 +- .../baseline/ppc/baseline-compiler-ppc-inl.h | 79 +- .../riscv64/baseline-assembler-riscv64-inl.h | 34 +- .../s390/baseline-assembler-s390-inl.h | 26 + .../baseline/x64/baseline-assembler-x64-inl.h | 26 + deps/v8/src/builtins/arm/builtins-arm.cc | 134 +- deps/v8/src/builtins/arm64/builtins-arm64.cc | 139 +- deps/v8/src/builtins/base.tq | 3 +- deps/v8/src/builtins/builtins-array-gen.cc | 2 +- .../builtins/builtins-async-generator-gen.cc | 82 +- deps/v8/src/builtins/builtins-async-module.cc | 12 +- deps/v8/src/builtins/builtins-callsite.cc | 6 + .../src/builtins/builtins-collections-gen.cc | 12 + deps/v8/src/builtins/builtins-console.cc | 2 +- .../src/builtins/builtins-constructor-gen.cc | 2 - deps/v8/src/builtins/builtins-definitions.h | 86 +- deps/v8/src/builtins/builtins-internal-gen.cc | 12 +- deps/v8/src/builtins/builtins-iterator-gen.cc | 183 +- deps/v8/src/builtins/builtins-iterator-gen.h | 10 + deps/v8/src/builtins/builtins-lazy-gen.cc | 11 +- .../builtins/builtins-microtask-queue-gen.cc | 1 + deps/v8/src/builtins/builtins-object.cc | 11 +- deps/v8/src/builtins/builtins-reflect.cc | 2 +- ...lm-gen.cc => builtins-shadow-realm-gen.cc} | 178 + ...dow-realms.cc => builtins-shadow-realm.cc} | 10 +- .../builtins-sharedarraybuffer-gen.cc | 126 +- .../builtins/builtins-sharedarraybuffer.cc | 2 +- deps/v8/src/builtins/builtins-string-gen.cc | 34 +- deps/v8/src/builtins/builtins-temporal-gen.cc | 216 +- deps/v8/src/builtins/builtins-temporal.cc | 243 +- deps/v8/src/builtins/builtins-utils.h | 6 +- .../v8/src/builtins/builtins-web-snapshots.cc | 119 + deps/v8/src/builtins/builtins.cc | 8 +- deps/v8/src/builtins/builtins.h | 1 - deps/v8/src/builtins/ia32/builtins-ia32.cc | 147 +- deps/v8/src/builtins/ic-callable.tq | 2 +- deps/v8/src/builtins/iterator.tq | 4 +- .../src/builtins/loong64/builtins-loong64.cc | 130 +- deps/v8/src/builtins/mips/builtins-mips.cc | 132 +- .../v8/src/builtins/mips64/builtins-mips64.cc | 132 +- deps/v8/src/builtins/ppc/builtins-ppc.cc | 154 +- deps/v8/src/builtins/profile-data-reader.cc | 54 +- deps/v8/src/builtins/profile-data-reader.h | 30 +- .../src/builtins/riscv64/builtins-riscv64.cc | 124 +- deps/v8/src/builtins/s390/builtins-s390.cc | 136 +- deps/v8/src/builtins/x64/builtins-x64.cc | 120 +- .../arm/interface-descriptors-arm-inl.h | 3 +- .../v8/src/codegen/arm/macro-assembler-arm.cc | 13 + deps/v8/src/codegen/arm/macro-assembler-arm.h | 3 + deps/v8/src/codegen/arm64/assembler-arm64.cc | 6 +- .../arm64/instructions-arm64-constants.cc | 26 +- .../v8/src/codegen/arm64/instructions-arm64.h | 4 +- .../arm64/interface-descriptors-arm64-inl.h | 3 +- .../codegen/arm64/macro-assembler-arm64-inl.h | 4 +- .../codegen/arm64/macro-assembler-arm64.cc | 25 +- .../src/codegen/arm64/macro-assembler-arm64.h | 4 + deps/v8/src/codegen/arm64/utils-arm64.cc | 16 +- deps/v8/src/codegen/arm64/utils-arm64.h | 10 +- deps/v8/src/codegen/code-stub-assembler.cc | 92 +- deps/v8/src/codegen/code-stub-assembler.h | 16 +- deps/v8/src/codegen/compiler.cc | 272 +- deps/v8/src/codegen/compiler.h | 12 +- deps/v8/src/codegen/external-reference.cc | 8 + deps/v8/src/codegen/external-reference.h | 2 + deps/v8/src/codegen/ia32/assembler-ia32.h | 8 +- .../ia32/interface-descriptors-ia32-inl.h | 11 +- .../src/codegen/ia32/macro-assembler-ia32.cc | 20 +- .../src/codegen/ia32/macro-assembler-ia32.h | 11 +- .../src/codegen/interface-descriptors-inl.h | 34 + deps/v8/src/codegen/interface-descriptors.h | 113 +- .../src/codegen/loong64/constants-loong64.h | 6 - .../interface-descriptors-loong64-inl.h | 3 +- .../loong64/macro-assembler-loong64.cc | 32 +- .../codegen/loong64/macro-assembler-loong64.h | 13 +- deps/v8/src/codegen/machine-type.cc | 2 + deps/v8/src/codegen/machine-type.h | 33 +- deps/v8/src/codegen/mips/constants-mips.h | 6 - .../mips/interface-descriptors-mips-inl.h | 3 +- .../src/codegen/mips/macro-assembler-mips.cc | 31 +- .../src/codegen/mips/macro-assembler-mips.h | 13 +- deps/v8/src/codegen/mips64/constants-mips64.h | 6 - .../mips64/interface-descriptors-mips64-inl.h | 3 +- .../codegen/mips64/macro-assembler-mips64.cc | 40 +- .../codegen/mips64/macro-assembler-mips64.h | 13 +- deps/v8/src/codegen/ppc/assembler-ppc.cc | 73 +- deps/v8/src/codegen/ppc/assembler-ppc.h | 6 + deps/v8/src/codegen/ppc/constants-ppc.h | 3 +- .../ppc/interface-descriptors-ppc-inl.h | 18 +- .../v8/src/codegen/ppc/macro-assembler-ppc.cc | 52 +- deps/v8/src/codegen/ppc/macro-assembler-ppc.h | 4 + deps/v8/src/codegen/register-base.h | 6 +- deps/v8/src/codegen/register.h | 5 +- deps/v8/src/codegen/reglist.h | 7 + .../src/codegen/riscv64/constants-riscv64.h | 6 +- .../interface-descriptors-riscv64-inl.h | 3 +- .../riscv64/macro-assembler-riscv64.cc | 35 +- .../codegen/riscv64/macro-assembler-riscv64.h | 7 +- .../s390/interface-descriptors-s390-inl.h | 3 +- .../src/codegen/s390/macro-assembler-s390.cc | 22 +- .../src/codegen/s390/macro-assembler-s390.h | 7 +- deps/v8/src/codegen/x64/assembler-x64.cc | 81 +- deps/v8/src/codegen/x64/assembler-x64.h | 71 +- .../x64/interface-descriptors-x64-inl.h | 3 +- .../v8/src/codegen/x64/macro-assembler-x64.cc | 37 +- deps/v8/src/codegen/x64/macro-assembler-x64.h | 15 +- deps/v8/src/codegen/x64/register-x64.h | 6 +- deps/v8/src/common/code-memory-access-inl.h | 52 + deps/v8/src/common/code-memory-access.cc | 25 + deps/v8/src/common/code-memory-access.h | 98 + deps/v8/src/common/globals.h | 69 +- deps/v8/src/common/message-template.h | 6 +- deps/v8/src/compiler/access-builder.cc | 2 +- deps/v8/src/compiler/access-info.cc | 22 +- .../backend/arm/code-generator-arm.cc | 8 - .../backend/arm/instruction-codes-arm.h | 2 - .../backend/arm/instruction-scheduler-arm.cc | 2 - .../backend/arm/instruction-selector-arm.cc | 11 +- .../backend/arm64/code-generator-arm64.cc | 21 +- .../backend/arm64/instruction-codes-arm64.h | 2 - .../arm64/instruction-scheduler-arm64.cc | 2 - .../arm64/instruction-selector-arm64.cc | 137 +- .../compiler/backend/code-generator-impl.h | 4 +- .../v8/src/compiler/backend/code-generator.cc | 49 +- deps/v8/src/compiler/backend/code-generator.h | 40 +- .../backend/ia32/code-generator-ia32.cc | 8 - .../backend/ia32/instruction-codes-ia32.h | 2 - .../ia32/instruction-scheduler-ia32.cc | 2 - .../backend/ia32/instruction-selector-ia32.cc | 13 +- .../backend/instruction-selector-impl.h | 11 +- .../compiler/backend/instruction-selector.cc | 42 +- .../compiler/backend/instruction-selector.h | 10 + deps/v8/src/compiler/backend/instruction.cc | 15 +- deps/v8/src/compiler/backend/instruction.h | 28 +- .../backend/loong64/code-generator-loong64.cc | 34 +- .../loong64/instruction-codes-loong64.h | 2 - .../loong64/instruction-selector-loong64.cc | 37 +- .../backend/mips/code-generator-mips.cc | 28 +- .../backend/mips/instruction-codes-mips.h | 2 - .../mips/instruction-scheduler-mips.cc | 2 - .../backend/mips/instruction-selector-mips.cc | 13 +- .../backend/mips64/code-generator-mips64.cc | 39 +- .../backend/mips64/instruction-codes-mips64.h | 2 - .../mips64/instruction-scheduler-mips64.cc | 2 - .../mips64/instruction-selector-mips64.cc | 13 +- .../backend/ppc/code-generator-ppc.cc | 95 +- .../backend/ppc/instruction-codes-ppc.h | 2 - .../backend/ppc/instruction-scheduler-ppc.cc | 2 - .../backend/ppc/instruction-selector-ppc.cc | 28 +- .../compiler/backend/register-allocation.h | 2 + .../backend/riscv64/code-generator-riscv64.cc | 43 +- .../riscv64/instruction-codes-riscv64.h | 2 - .../riscv64/instruction-scheduler-riscv64.cc | 2 - .../riscv64/instruction-selector-riscv64.cc | 37 +- .../backend/s390/code-generator-s390.cc | 21 - .../backend/s390/instruction-codes-s390.h | 2 - .../s390/instruction-scheduler-s390.cc | 2 - .../backend/s390/instruction-selector-s390.cc | 17 +- .../backend/x64/code-generator-x64.cc | 12 +- .../backend/x64/instruction-codes-x64.h | 2 - .../backend/x64/instruction-scheduler-x64.cc | 2 - .../backend/x64/instruction-selector-x64.cc | 17 +- .../src/compiler/basic-block-instrumentor.cc | 10 + deps/v8/src/compiler/c-linkage.cc | 64 +- deps/v8/src/compiler/code-assembler.h | 9 +- deps/v8/src/compiler/common-node-cache.cc | 4 +- deps/v8/src/compiler/common-node-cache.h | 6 +- deps/v8/src/compiler/common-operator.cc | 9 +- deps/v8/src/compiler/common-operator.h | 17 +- .../src/compiler/effect-control-linearizer.cc | 10 +- deps/v8/src/compiler/escape-analysis.cc | 9 +- deps/v8/src/compiler/frame-states.cc | 4 +- deps/v8/src/compiler/frame-states.h | 5 +- deps/v8/src/compiler/globals.h | 5 +- deps/v8/src/compiler/graph-assembler.cc | 6 +- deps/v8/src/compiler/graph-assembler.h | 2 +- deps/v8/src/compiler/js-call-reducer.cc | 30 +- deps/v8/src/compiler/js-create-lowering.cc | 2 +- deps/v8/src/compiler/js-graph.cc | 6 +- deps/v8/src/compiler/js-inlining.cc | 7 +- deps/v8/src/compiler/js-intrinsic-lowering.cc | 2 +- .../js-native-context-specialization.cc | 140 +- deps/v8/src/compiler/js-operator.h | 5 +- deps/v8/src/compiler/js-typed-lowering.cc | 15 +- deps/v8/src/compiler/linkage.h | 8 + deps/v8/src/compiler/load-elimination.cc | 3 + deps/v8/src/compiler/load-elimination.h | 4 +- .../v8/src/compiler/machine-graph-verifier.cc | 1 + deps/v8/src/compiler/machine-graph.h | 6 +- .../src/compiler/machine-operator-reducer.cc | 21 +- .../src/compiler/machine-operator-reducer.h | 12 +- deps/v8/src/compiler/machine-operator.cc | 19 +- deps/v8/src/compiler/machine-operator.h | 3 - deps/v8/src/compiler/memory-optimizer.cc | 1 - deps/v8/src/compiler/opcodes.h | 3 - deps/v8/src/compiler/pipeline.cc | 84 +- deps/v8/src/compiler/pipeline.h | 6 +- deps/v8/src/compiler/representation-change.cc | 1 + deps/v8/src/compiler/scheduler.cc | 18 +- deps/v8/src/compiler/simplified-lowering.cc | 16 +- .../compiler/simplified-operator-reducer.h | 2 +- .../src/compiler/store-store-elimination.cc | 2 +- deps/v8/src/compiler/turboshaft/assembler.h | 209 + deps/v8/src/compiler/turboshaft/deopt-data.h | 117 + .../src/compiler/turboshaft/graph-builder.cc | 722 ++ .../src/compiler/turboshaft/graph-builder.h | 18 + deps/v8/src/compiler/turboshaft/graph.cc | 39 + deps/v8/src/compiler/turboshaft/graph.h | 508 + deps/v8/src/compiler/turboshaft/operations.cc | 345 + deps/v8/src/compiler/turboshaft/operations.h | 1329 +++ .../compiler/turboshaft/recreate-schedule.cc | 907 ++ .../compiler/turboshaft/recreate-schedule.h | 30 + deps/v8/src/compiler/typed-optimization.cc | 14 + deps/v8/src/compiler/verifier.cc | 1 - deps/v8/src/compiler/wasm-compiler.cc | 464 +- deps/v8/src/compiler/wasm-compiler.h | 5 +- deps/v8/src/compiler/wasm-graph-assembler.cc | 288 + deps/v8/src/compiler/wasm-graph-assembler.h | 234 + deps/v8/src/d8/d8-posix.cc | 2 +- deps/v8/src/d8/d8-test.cc | 3 +- deps/v8/src/d8/d8.cc | 475 +- deps/v8/src/d8/d8.h | 6 + deps/v8/src/debug/debug-evaluate.cc | 2 +- deps/v8/src/debug/debug-interface.cc | 237 +- deps/v8/src/debug/debug-interface.h | 8 +- deps/v8/src/debug/debug-property-iterator.cc | 5 +- deps/v8/src/debug/debug-scopes.cc | 4 +- .../src/debug/debug-stack-trace-iterator.cc | 64 +- .../v8/src/debug/debug-stack-trace-iterator.h | 5 + deps/v8/src/debug/debug.cc | 18 +- deps/v8/src/debug/debug.h | 26 + deps/v8/src/deoptimizer/deoptimizer.cc | 75 +- deps/v8/src/deoptimizer/deoptimizer.h | 13 +- .../v8/src/deoptimizer/ppc/deoptimizer-ppc.cc | 2 +- deps/v8/src/deoptimizer/translated-state.cc | 16 +- deps/v8/src/deoptimizer/translated-state.h | 4 +- deps/v8/src/deoptimizer/translation-array.cc | 20 +- deps/v8/src/deoptimizer/translation-array.h | 2 +- deps/v8/src/deoptimizer/translation-opcode.h | 2 +- .../src/diagnostics/basic-block-profiler.cc | 29 +- .../v8/src/diagnostics/basic-block-profiler.h | 2 + deps/v8/src/diagnostics/disassembler.cc | 2 +- deps/v8/src/diagnostics/objects-debug.cc | 24 +- deps/v8/src/diagnostics/objects-printer.cc | 4 +- deps/v8/src/diagnostics/perf-jit.cc | 63 +- deps/v8/src/diagnostics/perf-jit.h | 8 +- deps/v8/src/diagnostics/ppc/disasm-ppc.cc | 40 +- deps/v8/src/diagnostics/system-jit-win.cc | 11 +- .../src/diagnostics/unwinding-info-win64.cc | 30 - deps/v8/src/diagnostics/x64/disasm-x64.cc | 17 +- deps/v8/src/execution/arguments.h | 17 +- deps/v8/src/execution/arm/simulator-arm.cc | 39 +- .../v8/src/execution/arm64/simulator-arm64.cc | 6 +- .../execution/arm64/simulator-logic-arm64.cc | 16 +- deps/v8/src/execution/frames.cc | 4 +- deps/v8/src/execution/futex-emulation.cc | 8 +- deps/v8/src/execution/isolate-inl.h | 32 + deps/v8/src/execution/isolate.cc | 172 +- deps/v8/src/execution/isolate.h | 42 +- deps/v8/src/execution/local-isolate.cc | 3 + deps/v8/src/execution/local-isolate.h | 9 +- .../execution/loong64/simulator-loong64.cc | 206 +- .../src/execution/loong64/simulator-loong64.h | 66 +- deps/v8/src/execution/microtask-queue.cc | 2 + deps/v8/src/execution/mips/simulator-mips.cc | 201 +- .../src/execution/mips64/simulator-mips64.cc | 396 +- .../src/execution/mips64/simulator-mips64.h | 66 +- deps/v8/src/execution/ppc/simulator-ppc.cc | 111 +- deps/v8/src/execution/ppc/simulator-ppc.h | 8 +- .../execution/riscv64/simulator-riscv64.cc | 12 +- .../src/execution/riscv64/simulator-riscv64.h | 6 +- deps/v8/src/execution/s390/simulator-s390.cc | 56 +- deps/v8/src/execution/simulator-base.h | 10 +- deps/v8/src/execution/stack-guard.h | 4 +- deps/v8/src/execution/thread-local-top.cc | 10 +- deps/v8/src/execution/thread-local-top.h | 12 - deps/v8/src/execution/tiering-manager.cc | 66 +- deps/v8/src/execution/tiering-manager.h | 3 +- deps/v8/src/execution/v8threads.cc | 7 +- deps/v8/src/flags/flag-definitions.h | 111 +- deps/v8/src/flags/flags.cc | 4 + deps/v8/src/handles/global-handles-inl.h | 6 + deps/v8/src/handles/global-handles.cc | 587 +- deps/v8/src/handles/global-handles.h | 77 +- deps/v8/src/handles/handles.h | 4 +- deps/v8/src/heap/code-range.cc | 45 +- deps/v8/src/heap/concurrent-allocator.cc | 15 +- deps/v8/src/heap/concurrent-marking.cc | 2 + .../v8/src/heap/conservative-stack-visitor.cc | 19 +- deps/v8/src/heap/cppgc-js/cpp-heap.cc | 31 +- .../cppgc-js/unified-heap-marking-state-inl.h | 10 +- .../cppgc-js/unified-heap-marking-visitor.h | 16 +- .../src/heap/cppgc/caged-heap-local-data.cc | 28 + deps/v8/src/heap/cppgc/caged-heap.cc | 9 +- deps/v8/src/heap/cppgc/caged-heap.h | 4 + deps/v8/src/heap/cppgc/compactor.cc | 27 +- deps/v8/src/heap/cppgc/explicit-management.cc | 17 +- deps/v8/src/heap/cppgc/gc-info.cc | 2 +- deps/v8/src/heap/cppgc/heap-base.cc | 43 +- deps/v8/src/heap/cppgc/heap-base.h | 31 + deps/v8/src/heap/cppgc/heap-object-header.cc | 5 +- .../heap/cppgc/heap-statistics-collector.cc | 6 +- deps/v8/src/heap/cppgc/heap.cc | 15 + deps/v8/src/heap/cppgc/heap.h | 3 + deps/v8/src/heap/cppgc/marker.cc | 41 +- deps/v8/src/heap/cppgc/object-allocator.cc | 33 +- deps/v8/src/heap/cppgc/object-start-bitmap.h | 3 +- deps/v8/src/heap/cppgc/remembered-set.cc | 15 + deps/v8/src/heap/cppgc/remembered-set.h | 2 + deps/v8/src/heap/cppgc/sweeper.cc | 53 +- deps/v8/src/heap/cppgc/write-barrier.cc | 46 +- deps/v8/src/heap/cppgc/write-barrier.h | 32 +- deps/v8/src/heap/embedder-tracing.cc | 4 +- deps/v8/src/heap/embedder-tracing.h | 2 +- deps/v8/src/heap/evacuation-allocator-inl.h | 9 +- deps/v8/src/heap/factory-base.cc | 24 +- deps/v8/src/heap/factory-base.h | 2 - deps/v8/src/heap/factory.cc | 14 +- deps/v8/src/heap/factory.h | 7 + deps/v8/src/heap/gc-tracer-inl.h | 25 + deps/v8/src/heap/gc-tracer.cc | 102 +- deps/v8/src/heap/gc-tracer.h | 19 +- deps/v8/src/heap/heap-allocator-inl.h | 6 +- deps/v8/src/heap/heap-allocator.cc | 1 - deps/v8/src/heap/heap-inl.h | 19 + deps/v8/src/heap/heap-write-barrier-inl.h | 12 +- deps/v8/src/heap/heap-write-barrier.h | 1 + deps/v8/src/heap/heap.cc | 202 +- deps/v8/src/heap/heap.h | 156 +- deps/v8/src/heap/incremental-marking.cc | 15 +- deps/v8/src/heap/invalidated-slots-inl.h | 2 +- deps/v8/src/heap/invalidated-slots.cc | 11 + deps/v8/src/heap/invalidated-slots.h | 2 + deps/v8/src/heap/large-spaces.cc | 120 +- deps/v8/src/heap/large-spaces.h | 17 +- deps/v8/src/heap/local-heap-inl.h | 7 - deps/v8/src/heap/local-heap.cc | 10 + deps/v8/src/heap/local-heap.h | 4 +- deps/v8/src/heap/mark-compact-inl.h | 5 +- deps/v8/src/heap/mark-compact.cc | 570 +- deps/v8/src/heap/mark-compact.h | 130 +- deps/v8/src/heap/marking-barrier.cc | 14 +- deps/v8/src/heap/memory-allocator.cc | 70 +- deps/v8/src/heap/memory-chunk.cc | 54 +- deps/v8/src/heap/memory-chunk.h | 9 +- deps/v8/src/heap/new-spaces-inl.h | 71 +- deps/v8/src/heap/new-spaces.cc | 152 +- deps/v8/src/heap/new-spaces.h | 127 +- deps/v8/src/heap/object-start-bitmap.h | 34 +- deps/v8/src/heap/object-stats.h | 7 +- deps/v8/src/heap/paged-spaces-inl.h | 25 + deps/v8/src/heap/paged-spaces.cc | 32 +- deps/v8/src/heap/paged-spaces.h | 13 +- deps/v8/src/heap/read-only-spaces.cc | 15 +- deps/v8/src/heap/scavenger.cc | 19 +- deps/v8/src/heap/setup-heap-internal.cc | 21 +- deps/v8/src/heap/spaces-inl.h | 16 +- deps/v8/src/heap/spaces.cc | 9 +- deps/v8/src/heap/spaces.h | 6 +- deps/v8/src/heap/sweeper.cc | 180 +- deps/v8/src/heap/sweeper.h | 37 +- deps/v8/src/ic/accessor-assembler.cc | 4 - deps/v8/src/ic/stub-cache.cc | 2 +- deps/v8/src/init/bootstrapper.cc | 100 +- deps/v8/src/init/heap-symbols.h | 11 +- deps/v8/src/init/isolate-allocator.cc | 1 + deps/v8/src/inspector/DEPS | 1 + deps/v8/src/inspector/injected-script.cc | 38 +- deps/v8/src/inspector/injected-script.h | 4 +- deps/v8/src/inspector/v8-console-message.cc | 29 +- deps/v8/src/inspector/v8-console.cc | 4 +- .../src/inspector/v8-debugger-agent-impl.cc | 21 +- deps/v8/src/inspector/v8-debugger-script.cc | 76 +- deps/v8/src/inspector/v8-debugger-script.h | 3 +- deps/v8/src/inspector/v8-debugger.cc | 12 + deps/v8/src/inspector/v8-debugger.h | 1 + .../inspector/v8-heap-profiler-agent-impl.cc | 24 +- .../inspector/v8-heap-profiler-agent-impl.h | 6 +- deps/v8/src/inspector/v8-inspector-impl.cc | 5 +- deps/v8/src/inspector/v8-inspector-impl.h | 3 +- .../inspector/v8-inspector-session-impl.cc | 53 +- .../src/inspector/v8-inspector-session-impl.h | 13 +- .../v8/src/inspector/v8-runtime-agent-impl.cc | 25 +- .../src/inspector/v8-webdriver-serializer.cc | 408 +- .../src/inspector/v8-webdriver-serializer.h | 5 +- deps/v8/src/inspector/value-mirror.cc | 163 +- deps/v8/src/inspector/value-mirror.h | 5 +- .../src/interpreter/bytecode-array-builder.cc | 9 +- .../src/interpreter/bytecode-array-builder.h | 7 +- .../interpreter/bytecode-array-iterator.cc | 10 + .../src/interpreter/bytecode-array-iterator.h | 3 + .../src/interpreter/bytecode-array-writer.cc | 27 +- deps/v8/src/interpreter/bytecode-flags.cc | 4 +- deps/v8/src/interpreter/bytecode-flags.h | 2 +- deps/v8/src/interpreter/bytecode-generator.cc | 44 +- deps/v8/src/interpreter/bytecode-generator.h | 1 + deps/v8/src/interpreter/bytecodes.h | 2 +- .../src/interpreter/control-flow-builders.cc | 7 +- .../src/interpreter/control-flow-builders.h | 8 +- .../src/interpreter/interpreter-assembler.cc | 87 +- .../src/interpreter/interpreter-assembler.h | 18 +- .../src/interpreter/interpreter-generator.cc | 78 +- deps/v8/src/json/json-parser.cc | 4 +- deps/v8/src/json/json-stringifier.cc | 2 +- .../src/libplatform/tracing/recorder-win.cc | 4 + deps/v8/src/libsampler/sampler.cc | 16 +- deps/v8/src/logging/code-events.h | 188 +- deps/v8/src/logging/counters-definitions.h | 62 +- deps/v8/src/logging/counters-scopes.h | 8 +- deps/v8/src/logging/counters.cc | 3 +- deps/v8/src/logging/local-logger.cc | 21 +- deps/v8/src/logging/local-logger.h | 4 +- .../src/logging/{log-utils.cc => log-file.cc} | 102 +- .../src/logging/{log-utils.h => log-file.h} | 45 +- deps/v8/src/logging/log-inl.h | 20 +- deps/v8/src/logging/log.cc | 584 +- deps/v8/src/logging/log.h | 68 +- deps/v8/src/logging/runtime-call-stats.h | 5 + deps/v8/src/maglev/maglev-code-gen-state.h | 114 +- deps/v8/src/maglev/maglev-code-generator.cc | 295 +- deps/v8/src/maglev/maglev-code-generator.h | 4 +- deps/v8/src/maglev/maglev-compilation-info.cc | 11 +- deps/v8/src/maglev/maglev-compilation-info.h | 4 - deps/v8/src/maglev/maglev-compilation-unit.cc | 17 +- deps/v8/src/maglev/maglev-compilation-unit.h | 36 +- deps/v8/src/maglev/maglev-compiler.cc | 99 +- deps/v8/src/maglev/maglev-compiler.h | 23 +- .../maglev/maglev-concurrent-dispatcher.cc | 10 +- deps/v8/src/maglev/maglev-graph-builder.cc | 648 +- deps/v8/src/maglev/maglev-graph-builder.h | 268 +- deps/v8/src/maglev/maglev-graph-printer.cc | 19 +- deps/v8/src/maglev/maglev-graph-printer.h | 10 +- deps/v8/src/maglev/maglev-graph-processor.h | 63 +- deps/v8/src/maglev/maglev-graph-verifier.h | 68 +- deps/v8/src/maglev/maglev-graph.h | 17 +- .../maglev/maglev-interpreter-frame-state.h | 143 +- deps/v8/src/maglev/maglev-ir.cc | 497 +- deps/v8/src/maglev/maglev-ir.h | 639 +- deps/v8/src/maglev/maglev-regalloc-data.h | 20 + deps/v8/src/maglev/maglev-regalloc.cc | 518 +- deps/v8/src/maglev/maglev-regalloc.h | 163 +- deps/v8/src/maglev/maglev-vreg-allocator.h | 6 +- deps/v8/src/maglev/maglev.cc | 9 +- deps/v8/src/numbers/conversions-inl.h | 2 +- deps/v8/src/numbers/conversions.cc | 2 +- deps/v8/src/numbers/conversions.h | 2 +- deps/v8/src/objects/all-objects-inl.h | 3 +- deps/v8/src/objects/allocation-site.h | 8 +- deps/v8/src/objects/arguments.tq | 4 +- deps/v8/src/objects/bigint.cc | 12 +- deps/v8/src/objects/bigint.h | 2 +- deps/v8/src/objects/call-site-info.cc | 13 + deps/v8/src/objects/call-site-info.h | 1 + deps/v8/src/objects/cell.tq | 4 +- deps/v8/src/objects/code-inl.h | 46 +- deps/v8/src/objects/code-kind.h | 2 +- deps/v8/src/objects/code.cc | 1 - deps/v8/src/objects/code.h | 66 +- deps/v8/src/objects/code.tq | 12 +- deps/v8/src/objects/contexts-inl.h | 1 - deps/v8/src/objects/contexts.h | 10 +- deps/v8/src/objects/elements.cc | 4 +- deps/v8/src/objects/feedback-vector-inl.h | 45 +- deps/v8/src/objects/feedback-vector.cc | 51 +- deps/v8/src/objects/feedback-vector.h | 44 +- deps/v8/src/objects/feedback-vector.tq | 24 +- deps/v8/src/objects/fixed-array-inl.h | 2 - deps/v8/src/objects/fixed-array.h | 13 - deps/v8/src/objects/fixed-array.tq | 4 +- deps/v8/src/objects/free-space-inl.h | 4 +- deps/v8/src/objects/intl-objects.cc | 13 +- deps/v8/src/objects/intl-objects.h | 8 +- deps/v8/src/objects/intl-objects.tq | 2 +- deps/v8/src/objects/js-function.cc | 2 +- deps/v8/src/objects/js-number-format.cc | 186 +- deps/v8/src/objects/js-objects-inl.h | 13 +- deps/v8/src/objects/js-objects.cc | 46 +- deps/v8/src/objects/js-objects.h | 6 +- deps/v8/src/objects/js-objects.tq | 8 +- ...dow-realms-inl.h => js-shadow-realm-inl.h} | 10 +- .../{js-shadow-realms.h => js-shadow-realm.h} | 8 +- ...js-shadow-realms.tq => js-shadow-realm.tq} | 4 +- deps/v8/src/objects/js-temporal-objects.cc | 4326 +++++--- deps/v8/src/objects/js-temporal-objects.h | 91 +- deps/v8/src/objects/js-temporal-objects.tq | 4 +- deps/v8/src/objects/js-weak-refs-inl.h | 21 +- deps/v8/src/objects/js-weak-refs.h | 8 +- deps/v8/src/objects/js-weak-refs.tq | 4 +- deps/v8/src/objects/keys.cc | 18 +- deps/v8/src/objects/keys.h | 3 +- deps/v8/src/objects/lookup.cc | 7 +- deps/v8/src/objects/managed.h | 4 +- deps/v8/src/objects/map-inl.h | 3 +- deps/v8/src/objects/map.cc | 3 +- deps/v8/src/objects/module.cc | 5 + deps/v8/src/objects/module.h | 2 + deps/v8/src/objects/module.tq | 4 +- deps/v8/src/objects/name-inl.h | 28 + deps/v8/src/objects/name.h | 20 + deps/v8/src/objects/object-macros.h | 2 +- deps/v8/src/objects/objects.cc | 47 +- .../objects/osr-optimized-code-cache-inl.h | 25 - .../src/objects/osr-optimized-code-cache.cc | 303 - .../v8/src/objects/osr-optimized-code-cache.h | 118 - deps/v8/src/objects/property-array.tq | 4 +- deps/v8/src/objects/property-details.h | 6 +- deps/v8/src/objects/script.h | 1 + deps/v8/src/objects/script.tq | 4 + .../v8/src/objects/shared-function-info-inl.h | 19 +- deps/v8/src/objects/shared-function-info.tq | 9 +- deps/v8/src/objects/source-text-module.cc | 37 +- deps/v8/src/objects/source-text-module.h | 6 + deps/v8/src/objects/string-inl.h | 21 - deps/v8/src/objects/string-table-inl.h | 31 + deps/v8/src/objects/string-table.cc | 395 +- deps/v8/src/objects/string-table.h | 60 +- deps/v8/src/objects/string.cc | 243 +- deps/v8/src/objects/string.h | 1 - deps/v8/src/objects/swiss-name-dictionary.cc | 2 +- deps/v8/src/objects/swiss-name-dictionary.tq | 3 +- deps/v8/src/objects/tagged-field.h | 2 +- deps/v8/src/objects/value-serializer.cc | 6 +- deps/v8/src/objects/visitors.h | 1 + deps/v8/src/parsing/parse-info.cc | 11 +- deps/v8/src/parsing/parse-info.h | 13 +- deps/v8/src/parsing/parser-base.h | 20 +- deps/v8/src/parsing/parser.cc | 13 +- deps/v8/src/parsing/parser.h | 4 +- deps/v8/src/parsing/parsing.cc | 2 - deps/v8/src/parsing/preparser.cc | 2 +- deps/v8/src/parsing/preparser.h | 6 +- deps/v8/src/profiler/allocation-tracker.cc | 2 +- deps/v8/src/profiler/cpu-profiler-inl.h | 2 +- deps/v8/src/profiler/cpu-profiler.cc | 8 +- deps/v8/src/profiler/heap-profiler.cc | 18 +- deps/v8/src/profiler/heap-profiler.h | 6 +- .../src/profiler/heap-snapshot-generator.cc | 57 +- .../v8/src/profiler/heap-snapshot-generator.h | 26 +- deps/v8/src/profiler/profile-generator-inl.h | 2 +- deps/v8/src/profiler/profile-generator.cc | 56 +- deps/v8/src/profiler/profile-generator.h | 6 +- deps/v8/src/profiler/profiler-listener.cc | 8 +- deps/v8/src/profiler/profiler-listener.h | 2 +- .../ia32/regexp-macro-assembler-ia32.cc | 32 +- .../regexp/ia32/regexp-macro-assembler-ia32.h | 4 + .../riscv64/regexp-macro-assembler-riscv64.cc | 178 +- .../riscv64/regexp-macro-assembler-riscv64.h | 14 +- .../regexp/x64/regexp-macro-assembler-x64.cc | 28 +- .../regexp/x64/regexp-macro-assembler-x64.h | 4 + deps/v8/src/roots/roots.h | 12 +- deps/v8/src/runtime/runtime-atomics.cc | 95 +- deps/v8/src/runtime/runtime-compiler.cc | 150 +- deps/v8/src/runtime/runtime-debug.cc | 11 + deps/v8/src/runtime/runtime-futex.cc | 4 +- deps/v8/src/runtime/runtime-module.cc | 12 + deps/v8/src/runtime/runtime-object.cc | 36 +- deps/v8/src/runtime/runtime-regexp.cc | 4 +- deps/v8/src/runtime/runtime-shadow-realm.cc | 22 + deps/v8/src/runtime/runtime-strings.cc | 2 - deps/v8/src/runtime/runtime-temporal.cc | 26 + deps/v8/src/runtime/runtime-test.cc | 122 +- deps/v8/src/runtime/runtime-wasm.cc | 88 +- deps/v8/src/runtime/runtime.h | 13 +- deps/v8/src/snapshot/code-serializer.cc | 12 +- deps/v8/src/snapshot/deserializer.cc | 8 +- deps/v8/src/snapshot/deserializer.h | 21 +- .../src/snapshot/embedded/embedded-empty.cc | 8 +- .../snapshot/embedded/embedded-file-writer.cc | 32 +- .../snapshot/embedded/embedded-file-writer.h | 23 +- .../platform-embedded-file-writer-aix.cc | 12 - .../platform-embedded-file-writer-aix.h | 2 - .../platform-embedded-file-writer-base.h | 4 +- .../platform-embedded-file-writer-generic.cc | 27 +- .../platform-embedded-file-writer-generic.h | 3 +- .../platform-embedded-file-writer-mac.cc | 11 +- .../platform-embedded-file-writer-mac.h | 4 +- .../platform-embedded-file-writer-win.cc | 28 - .../platform-embedded-file-writer-win.h | 2 - deps/v8/src/snapshot/mksnapshot.cc | 8 +- deps/v8/src/snapshot/serializer.h | 4 +- .../src/snapshot/shared-heap-deserializer.cc | 2 +- deps/v8/src/snapshot/snapshot-compression.cc | 18 +- deps/v8/src/snapshot/snapshot-empty.cc | 4 + deps/v8/src/snapshot/snapshot-external.cc | 25 +- deps/v8/src/snapshot/snapshot.cc | 17 +- deps/v8/src/snapshot/snapshot.h | 5 + deps/v8/src/temporal/temporal-parser.cc | 39 +- deps/v8/src/temporal/temporal-parser.h | 30 +- deps/v8/src/third_party/vtune/vtune-jit.cc | 2 +- deps/v8/src/torque/implementation-visitor.cc | 2 +- deps/v8/src/trap-handler/handler-shared.cc | 5 + deps/v8/src/trap-handler/trap-handler.h | 2 +- deps/v8/src/utils/allocation.cc | 53 +- deps/v8/src/utils/allocation.h | 23 +- deps/v8/src/utils/boxed-float.h | 16 +- deps/v8/src/utils/hex-format.cc | 27 + deps/v8/src/utils/hex-format.h | 27 + deps/v8/src/utils/identity-map.h | 8 +- deps/v8/src/utils/sha-256.cc | 176 + deps/v8/src/utils/sha-256.h | 76 + deps/v8/src/utils/utils.h | 24 +- deps/v8/src/wasm/assembler-buffer-cache.cc | 67 + deps/v8/src/wasm/assembler-buffer-cache.h | 46 + .../wasm/baseline/arm/liftoff-assembler-arm.h | 41 + .../baseline/arm64/liftoff-assembler-arm64.h | 41 + .../baseline/ia32/liftoff-assembler-ia32.h | 51 +- .../v8/src/wasm/baseline/liftoff-assembler.cc | 5 + deps/v8/src/wasm/baseline/liftoff-assembler.h | 36 + deps/v8/src/wasm/baseline/liftoff-compiler.cc | 170 +- deps/v8/src/wasm/baseline/liftoff-compiler.h | 29 +- .../loong64/liftoff-assembler-loong64.h | 41 + .../baseline/mips/liftoff-assembler-mips.h | 41 + .../mips64/liftoff-assembler-mips64.h | 53 +- .../wasm/baseline/ppc/liftoff-assembler-ppc.h | 41 + .../riscv64/liftoff-assembler-riscv64.h | 73 +- .../baseline/s390/liftoff-assembler-s390.h | 41 + .../wasm/baseline/x64/liftoff-assembler-x64.h | 59 +- deps/v8/src/wasm/code-space-access.cc | 33 +- deps/v8/src/wasm/compilation-environment.h | 5 +- deps/v8/src/wasm/decoder.h | 8 +- deps/v8/src/wasm/function-body-decoder-impl.h | 40 +- deps/v8/src/wasm/function-body-decoder.h | 4 +- deps/v8/src/wasm/function-compiler.cc | 26 +- deps/v8/src/wasm/function-compiler.h | 3 + deps/v8/src/wasm/memory-protection-key.cc | 5 +- deps/v8/src/wasm/module-compiler.cc | 164 +- deps/v8/src/wasm/module-compiler.h | 5 + deps/v8/src/wasm/wasm-code-manager.cc | 79 +- deps/v8/src/wasm/wasm-code-manager.h | 10 +- deps/v8/src/wasm/wasm-debug.cc | 4 +- deps/v8/src/wasm/wasm-external-refs.cc | 2 +- deps/v8/src/wasm/wasm-feature-flags.h | 1 + deps/v8/src/wasm/wasm-js.cc | 10 +- deps/v8/src/wasm/wasm-module-builder.h | 4 +- deps/v8/src/wasm/wasm-objects.cc | 11 +- deps/v8/src/wasm/wasm-objects.tq | 2 +- deps/v8/src/wasm/wasm-opcodes-inl.h | 27 +- deps/v8/src/wasm/wasm-opcodes.h | 46 +- deps/v8/src/wasm/wasm-serialization.cc | 8 +- deps/v8/src/web-snapshot/web-snapshot.cc | 1157 +- deps/v8/src/web-snapshot/web-snapshot.h | 119 +- deps/v8/src/zone/accounting-allocator.cc | 3 +- deps/v8/src/zone/zone-containers.h | 6 + deps/v8/src/zone/zone.h | 17 + deps/v8/test/benchmarks/csuite/README.md | 2 +- deps/v8/test/benchmarks/csuite/csuite.py | 2 +- deps/v8/test/cctest/BUILD.gn | 30 +- deps/v8/test/cctest/cctest.cc | 5 +- deps/v8/test/cctest/cctest.status | 75 +- .../test-atomic-load-store-codegen.cc | 2 +- .../compiler/test-basic-block-profiler.cc | 2 +- .../cctest/compiler/test-branch-combine.cc | 2 +- .../cctest/compiler/test-code-generator.cc | 15 +- .../{codegen-tester.cc => test-codegen.cc} | 20 +- .../{codegen-tester.h => test-codegen.h} | 9 - .../cctest/compiler/test-js-constant-cache.cc | 10 +- .../compiler/test-machine-operator-reducer.cc | 24 +- .../cctest/compiler/test-multiple-return.cc | 2 +- .../compiler/test-representation-change.cc | 2 +- .../test-run-bytecode-graph-builder.cc | 2 +- .../test-run-calls-to-external-references.cc | 46 +- .../cctest/compiler/test-run-load-store.cc | 2 +- .../test/cctest/compiler/test-run-machops.cc | 72 +- .../cctest/compiler/test-run-native-calls.cc | 3 +- .../compiler/test-run-unwinding-info.cc | 2 +- .../cctest/compiler/test-sloppy-equality.cc | 2 +- deps/v8/test/cctest/heap/heap-utils.cc | 11 +- deps/v8/test/cctest/heap/test-alloc.cc | 15 +- .../cctest/heap/test-concurrent-allocation.cc | 4 +- deps/v8/test/cctest/heap/test-heap.cc | 137 +- deps/v8/test/cctest/heap/test-mark-compact.cc | 76 +- deps/v8/test/cctest/heap/test-spaces.cc | 49 +- .../ArrayLiterals.golden | 8 +- .../AsyncGenerators.golden | 42 +- .../bytecode_expectations/BasicLoops.golden | 98 +- .../BreakableBlocks.golden | 14 +- .../CallAndSpread.golden | 8 +- .../CompareBoolean.golden | 400 + .../bytecode_expectations/CompareNil.golden | 6 +- .../DestructuringAssignment.golden | 40 +- .../bytecode_expectations/ForAwaitOf.golden | 56 +- .../bytecode_expectations/ForIn.golden | 34 +- .../bytecode_expectations/ForOf.golden | 58 +- .../bytecode_expectations/ForOfLoop.golden | 138 +- .../bytecode_expectations/Generators.golden | 32 +- .../bytecode_expectations/NewAndSpread.golden | 10 +- .../PrivateAccessorAccess.golden | 8 +- .../PrivateMethodAccess.golden | 4 +- .../RemoveRedundantLdar.golden | 6 +- .../StandardForLoop.golden | 68 +- .../StaticPrivateMethodAccess.golden | 30 +- .../SuperCallAndSpread.golden | 10 +- .../UnaryOperators.golden | 12 +- .../WideRegisters.golden | 14 +- .../generate-bytecode-expectations.cc | 2 +- .../cctest/interpreter/interpreter-tester.cc | 2 +- .../interpreter/test-bytecode-generator.cc | 58 +- .../cctest/interpreter/test-interpreter.cc | 4 +- .../interpreter/test-source-positions.cc | 8 +- ...mutexes.cc => test-signals-and-mutexes.cc} | 0 deps/v8/test/cctest/test-allocation.cc | 3 +- deps/v8/test/cctest/test-api-accessors.cc | 4 +- deps/v8/test/cctest/test-api-interceptors.cc | 2 +- deps/v8/test/cctest/test-api.cc | 250 +- deps/v8/test/cctest/test-array-list.cc | 39 - deps/v8/test/cctest/test-assembler-arm.cc | 162 +- deps/v8/test/cctest/test-assembler-arm64.cc | 365 +- deps/v8/test/cctest/test-assembler-mips.cc | 252 +- deps/v8/test/cctest/test-assembler-mips64.cc | 259 +- deps/v8/test/cctest/test-assembler-riscv64.cc | 8 +- deps/v8/test/cctest/test-assembler-x64.cc | 26 +- deps/v8/test/cctest/test-bignum.cc | 1544 --- deps/v8/test/cctest/test-bit-vector.cc | 154 - .../test/cctest/test-code-stub-assembler.cc | 5 + deps/v8/test/cctest/test-compiler.cc | 1004 -- deps/v8/test/cctest/test-conversions.cc | 505 - deps/v8/test/cctest/test-cpu-profiler.cc | 55 +- deps/v8/test/cctest/test-debug.cc | 52 +- deps/v8/test/cctest/test-deoptimization.cc | 30 +- ...-helper.cc => test-disasm-regex-helper.cc} | 2 +- ...ex-helper.h => test-disasm-regex-helper.h} | 0 deps/v8/test/cctest/test-disasm-x64.cc | 15 + deps/v8/test/cctest/test-feedback-vector.cc | 32 +- .../test/cctest/test-field-type-tracking.cc | 7 +- deps/v8/test/cctest/test-flags.cc | 4 +- deps/v8/test/cctest/test-global-handles.cc | 131 +- deps/v8/test/cctest/test-heap-profiler.cc | 19 +- deps/v8/test/cctest/test-helper-riscv64.h | 29 +- deps/v8/test/cctest/test-icache.cc | 51 +- deps/v8/test/cctest/test-identity-map.cc | 2 + .../cctest/test-inobject-slack-tracking.cc | 42 +- deps/v8/test/cctest/test-inspector.cc | 4 +- deps/v8/test/cctest/test-js-weak-refs.cc | 51 +- deps/v8/test/cctest/test-lockers.cc | 10 +- .../test/cctest/test-macro-assembler-arm64.cc | 4 + .../cctest/test-macro-assembler-loong64.cc | 60 +- .../test/cctest/test-macro-assembler-mips.cc | 64 +- .../cctest/test-macro-assembler-mips64.cc | 60 +- .../cctest/test-macro-assembler-riscv64.cc | 63 +- deps/v8/test/cctest/test-object.cc | 502 - deps/v8/test/cctest/test-parsing.cc | 19 +- deps/v8/test/cctest/test-profile-generator.cc | 90 +- .../cctest/test-random-number-generator.cc | 4 +- deps/v8/test/cctest/test-regexp.cc | 2391 ---- deps/v8/test/cctest/test-serialize.cc | 38 +- deps/v8/test/cctest/test-shared-strings.cc | 59 +- deps/v8/test/cctest/test-strings.cc | 2 + deps/v8/test/cctest/test-temporal-parser.cc | 439 +- .../test/cctest/test-unwinder-code-pages.cc | 4 +- deps/v8/test/cctest/test-utils-arm64.cc | 20 +- deps/v8/test/cctest/test-utils-arm64.h | 4 +- deps/v8/test/cctest/test-web-snapshots.cc | 174 +- deps/v8/test/cctest/testcfg.py | 16 +- .../cctest/wasm/test-jump-table-assembler.cc | 17 +- .../cctest/wasm/test-liftoff-inspection.cc | 20 +- deps/v8/test/cctest/wasm/test-run-wasm-64.cc | 6 +- .../cctest/wasm/test-run-wasm-relaxed-simd.cc | 17 +- .../v8/test/cctest/wasm/test-run-wasm-simd.cc | 63 +- deps/v8/test/cctest/wasm/test-run-wasm.cc | 13 +- deps/v8/test/cctest/wasm/wasm-run-utils.cc | 24 +- deps/v8/test/cctest/wasm/wasm-run-utils.h | 7 +- deps/v8/test/cctest/wasm/wasm-simd-utils.cc | 22 +- deps/v8/test/common/assembler-tester.h | 59 +- deps/v8/test/common/wasm/wasm-interpreter.cc | 2 - deps/v8/test/common/wasm/wasm-macro-gen.h | 51 +- .../debugger/debug/debug-compile-optimized.js | 2 +- .../test/debugger/debug/debug-eval-scope.js | 2 +- .../debugger/debug/debug-evaluate-closure.js | 2 +- .../debug-evaluate-dead-function-fails.js | 2 +- .../debug/debug-evaluate-locals-capturing.js | 2 +- ...debug-evaluate-modify-catch-block-scope.js | 2 +- .../debug/debug-evaluate-nested-let.js | 2 +- .../debug-evaluate-repl-mode-optimized.js | 2 +- .../test/debugger/debug/debug-liveedit-2.js | 2 +- .../test/debugger/debug/debug-liveedit-4.js | 2 +- .../debug-modules-set-variable-value.mjs | 2 +- deps/v8/test/debugger/debug/debug-optimize.js | 2 +- .../debug/debug-set-variable-value.js | 4 +- .../debug-stepin-property-function-call.js | 2 +- .../debugger/debug/es6/debug-blockscopes.js | 2 +- .../debug/es6/debug-evaluate-blockscopes.js | 2 +- .../es6/debug-promises/stepin-handler.js | 2 +- .../es8/async-function-debug-evaluate.js | 2 +- .../debug/es8/async-function-debug-scopes.js | 2 +- .../debug/lazy-deopt-then-flush-bytecode.js | 2 +- deps/v8/test/debugger/debug/regress-3225.js | 2 +- .../debug/regress/regress-crbug-171715.js | 2 +- .../debug/regress/regress-crbug-323936.js | 2 +- .../debug/regress/regress-crbug-633999.js | 2 +- .../regress/regress-opt-after-debug-deopt.js | 2 +- .../regress-prepare-break-while-recompile.js | 2 +- deps/v8/test/fuzzer/wasm-fuzzer-common.cc | 11 +- .../cpu-profiler/console-profile-wasm.js | 4 +- .../inspector/cpu-profiler/coverage-block.js | 2 +- .../test/inspector/cpu-profiler/coverage.js | 2 +- .../debugger/breakpoints-expected.txt | 2 +- .../v8/test/inspector/debugger/breakpoints.js | 2 +- .../debugger/class-fields-scopes-expected.txt | 20 + .../class-private-fields-scopes-expected.txt | 3 + .../es6-module-script-parsed-expected.txt | 12 +- ...ssible-breakpoints-lazy-error-expected.txt | 6 +- .../regress-crbug-1319828-expected.txt | 18 + .../debugger/regress-crbug-1319828.js | 65 + .../resource-name-to-url-expected.txt | 24 +- .../fails-for-non-existant-index-expected.txt | 17 + .../fails-for-non-existant-index.js | 21 + .../fails-for-resumables-expected.txt | 51 + .../restart-frame/fails-for-resumables.js | 59 + .../fails-with-embedder-frames-expected.txt | 16 + .../fails-with-embedder-frames.js | 29 + .../fails-without-mode-param-expected.txt} | 0 .../fails-without-mode-param.js} | 0 .../restart-inlined-frame-expected.txt | 19 + .../restart-frame/restart-inlined-frame.js | 71 + ...start-top-frame-debugger-stmt-expected.txt | 15 + .../restart-top-frame-debugger-stmt.js | 31 + ...art-top-frame-local-variables-expected.txt | 45 + .../restart-top-frame-local-variables.js | 52 + ...art-top-frame-with-breakpoint-expected.txt | 15 + .../restart-top-frame-with-breakpoint.js | 35 + .../restart-various-frames-expected.txt | 22 + .../restart-frame/restart-various-frames.js | 69 + .../script-on-after-compile-expected.txt | 256 +- .../debugger/script-origin-stack-expected.txt | 12 +- ...t-parsed-for-runtime-evaluate-expected.txt | 80 +- .../debugger/script-parsed-hash-expected.txt | 12 +- .../inspector/debugger/set-variable-value.js | 2 +- .../inspector/debugger/tdz-modules-scopes.js | 2 +- deps/v8/test/inspector/debugger/tdz-scopes.js | 2 +- ...-terminate-execution-on-pause-expected.txt | 24 + .../wasm-terminate-execution-on-pause.js | 52 + deps/v8/test/inspector/inspector-test.cc | 18 + deps/v8/test/inspector/inspector.status | 16 +- deps/v8/test/inspector/isolate-data.cc | 4 +- deps/v8/test/inspector/protocol-test.js | 46 + .../inspector/runtime/es6-module-expected.txt | 21 +- ...=> generate-web-driver-value-expected.txt} | 38 +- ...-value.js => generate-web-driver-value.js} | 10 +- .../runtime/regress-1321833-expected.txt | 67 + .../test/inspector/runtime/regress-1321833.js | 51 + deps/v8/test/inspector/testcfg.py | 8 +- .../intl/number-format/options-digits-v3.js | 63 + .../test/intl/number-format/options-digits.js | 64 + .../number-format/rounding-increment-v3.js | 33 +- deps/v8/test/intl/string-localecompare.js | 2 +- deps/v8/test/intl/temporal/calendar/fields.js | 24 + .../js-perf-test/BytecodeHandlers/compare.js | 114 + .../GetOwnPropertyDescriptor.json | 85 + .../get-own-property-descriptor.js | 280 + .../GetOwnPropertyDescriptor/run.js | 24 + deps/v8/test/js-perf-test/JSTests3.json | 5 +- deps/v8/test/js-perf-test/JSTests5.json | 4 +- .../fail/array-spread-non-iterable-object.js | 5 + .../fail/array-spread-non-iterable-object.out | 5 + deps/v8/test/mjsunit/allocation-site-info.js | 2 +- .../mjsunit/array-bounds-check-removal.js | 2 +- .../mjsunit/array-constructor-feedback.js | 2 +- deps/v8/test/mjsunit/array-feedback.js | 2 +- .../v8/test/mjsunit/array-literal-feedback.js | 2 +- .../test/mjsunit/array-literal-transitions.js | 4 +- deps/v8/test/mjsunit/array-push5.js | 2 +- deps/v8/test/mjsunit/array-reduce.js | 2 +- deps/v8/test/mjsunit/array-shift4.js | 2 +- deps/v8/test/mjsunit/array-store-and-grow.js | 2 +- .../mjsunit/baseline/batch-compilation.js | 2 +- .../mjsunit/baseline/flush-baseline-code.js | 10 +- .../baseline/flush-only-baseline-code.js | 2 +- deps/v8/test/mjsunit/baseline/test-osr.js | 2 +- deps/v8/test/mjsunit/binary-op-newspace.js | 2 +- .../test/mjsunit/check-bounds-array-index.js | 2 +- .../check-bounds-string-from-char-code-at.js | 2 +- deps/v8/test/mjsunit/code-coverage-ad-hoc.js | 2 +- .../test/mjsunit/code-coverage-block-async.js | 2 +- .../test/mjsunit/code-coverage-block-noopt.js | 4 +- .../test/mjsunit/code-coverage-block-opt.js | 2 +- deps/v8/test/mjsunit/code-coverage-block.js | 2 +- .../mjsunit/code-coverage-class-fields.js | 2 +- deps/v8/test/mjsunit/code-coverage-precise.js | 2 +- .../compiler/abstract-equal-oddball.js | 2 +- .../compiler/abstract-equal-receiver.js | 2 +- .../mjsunit/compiler/abstract-equal-symbol.js | 2 +- .../compiler/abstract-equal-undetectable.js | 2 +- .../mjsunit/compiler/array-buffer-is-view.js | 2 +- .../compiler/array-multiple-receiver-maps.js | 2 +- deps/v8/test/mjsunit/compiler/array-push-1.js | 2 +- deps/v8/test/mjsunit/compiler/array-push-2.js | 2 +- deps/v8/test/mjsunit/compiler/array-push-3.js | 2 +- .../mjsunit/compiler/array-slice-clone.js | 2 +- .../compiler/bigint-add-no-deopt-loop.js | 2 +- deps/v8/test/mjsunit/compiler/bigint-add.js | 2 +- .../v8/test/mjsunit/compiler/bigint-asintn.js | 2 +- .../test/mjsunit/compiler/bigint-asuintn.js | 2 +- .../mjsunit/compiler/bigint-int64-lowered.js | 2 +- .../v8/test/mjsunit/compiler/bigint-negate.js | 2 +- .../mjsunit/compiler/bigint-uint64-lowered.js | 2 +- .../compiler/bound-functions-serialize.js | 2 +- .../call-with-arraylike-or-spread-2.js | 4 +- .../call-with-arraylike-or-spread-3.js | 4 +- .../call-with-arraylike-or-spread-4.js | 4 +- .../call-with-arraylike-or-spread-5.js | 4 +- .../call-with-arraylike-or-spread-6.js | 4 +- .../call-with-arraylike-or-spread-7.js | 4 +- .../compiler/call-with-arraylike-or-spread.js | 4 +- .../concurrent-invalidate-transition-map.js | 2 +- .../compiler/concurrent-proto-change.js | 2 +- .../compiler/constant-fold-cow-array.js | 2 +- .../compiler/constant-fold-tostring.js | 2 +- .../compiler/construct-bound-function.js | 2 +- .../test/mjsunit/compiler/construct-object.js | 2 +- .../test/mjsunit/compiler/dataview-deopt.js | 2 +- .../mjsunit/compiler/dataview-detached.js | 2 +- deps/v8/test/mjsunit/compiler/dataview-get.js | 2 +- deps/v8/test/mjsunit/compiler/dataview-set.js | 2 +- .../mjsunit/compiler/deopt-array-builtins.js | 2 +- .../deopt-array-iterator-prototype-next.js | 2 +- .../compiler/deopt-array-prototype-every.js | 2 +- .../compiler/deopt-array-prototype-filter.js | 2 +- .../compiler/deopt-array-prototype-find.js | 2 +- .../deopt-array-prototype-findindex.js | 2 +- .../compiler/deopt-array-prototype-foreach.js | 2 +- .../deopt-array-prototype-includes.js | 2 +- .../compiler/deopt-array-prototype-indexof.js | 2 +- .../deopt-array-prototype-lastindexof.js | 2 +- .../compiler/deopt-array-prototype-map.js | 2 +- .../compiler/deopt-array-prototype-pop.js | 2 +- .../compiler/deopt-array-prototype-reduce.js | 2 +- .../compiler/deopt-array-prototype-slice.js | 2 +- .../compiler/deopt-array-prototype-some.js | 2 +- .../test/mjsunit/compiler/deopt-array-push.js | 2 +- .../compiler/deopt-inlined-from-call.js | 2 +- .../mjsunit/compiler/deopt-inlined-smi.js | 2 +- .../compiler/deopt-numberoroddball-binop.js | 2 +- .../test/mjsunit/compiler/deopt-pretenure.js | 2 +- .../compiler/deopt-string-outofbounds.js | 2 +- .../dont-flush-code-marked-for-opt.js | 2 +- .../test/mjsunit/compiler/expression-trees.js | 2 +- .../test/mjsunit/compiler/fast-api-calls.js | 6 +- .../test/mjsunit/compiler/fast-api-helpers.js | 2 +- .../compiler/fast-api-interface-types.js | 4 +- .../compiler/fast-api-sequences-x64.js | 6 +- .../mjsunit/compiler/fast-api-sequences.js | 6 +- .../compiler/field-representation-tracking.js | 2 +- deps/v8/test/mjsunit/compiler/for-in-1.js | 2 +- deps/v8/test/mjsunit/compiler/for-in-2.js | 2 +- deps/v8/test/mjsunit/compiler/for-in-3.js | 2 +- deps/v8/test/mjsunit/compiler/for-in-4.js | 2 +- deps/v8/test/mjsunit/compiler/for-in-5.js | 2 +- .../compiler/globals-change-writable.js | 2 +- .../compiler/globals-freeze-constant.js | 2 +- .../compiler/globals-freeze-constanttype.js | 2 +- .../compiler/globals-freeze-mutable.js | 2 +- .../compiler/increment-typefeedback.js | 2 +- .../mjsunit/compiler/inline-exception-1.js | 2 +- .../mjsunit/compiler/inline-exception-2.js | 2 +- .../mjsunit/compiler/inlined-array-pop-opt.js | 2 +- .../compiler/inlined-call-polymorphic.js | 2 +- deps/v8/test/mjsunit/compiler/inlined-call.js | 2 +- .../mjsunit/compiler/integral32-add-sub.js | 2 +- .../compiler/is-being-interpreted-1.js | 2 +- .../compiler/is-being-interpreted-2.js | 2 +- .../mjsunit/compiler/js-create-arguments.js | 2 +- deps/v8/test/mjsunit/compiler/js-create.js | 2 +- .../compiler/manual-concurrent-recompile.js | 2 +- deps/v8/test/mjsunit/compiler/math-imul.js | 2 +- ...ative-context-specialization-hole-check.js | 2 +- deps/v8/test/mjsunit/compiler/number-abs.js | 2 +- deps/v8/test/mjsunit/compiler/number-ceil.js | 2 +- .../compiler/number-comparison-truncations.js | 2 +- .../v8/test/mjsunit/compiler/number-divide.js | 2 +- deps/v8/test/mjsunit/compiler/number-floor.js | 2 +- deps/v8/test/mjsunit/compiler/number-max.js | 2 +- deps/v8/test/mjsunit/compiler/number-min.js | 2 +- .../test/mjsunit/compiler/number-modulus.js | 2 +- .../test/mjsunit/compiler/number-multiply.js | 2 +- deps/v8/test/mjsunit/compiler/number-round.js | 2 +- .../test/mjsunit/compiler/number-toboolean.js | 2 +- deps/v8/test/mjsunit/compiler/number-trunc.js | 2 +- .../compiler/opt-higher-order-functions.js | 2 +- .../mjsunit/compiler/opt-next-call-turbo.js | 2 +- .../v8/test/mjsunit/compiler/opt-next-call.js | 2 +- .../compiler/optimized-float32array-length.js | 2 +- .../compiler/optimized-float64array-length.js | 2 +- .../compiler/optimized-int32array-length.js | 2 +- .../compiler/optimized-uint32array-length.js | 2 +- .../compiler/promise-resolve-stable-maps.js | 2 +- .../compiler/redundancy-elimination.js | 2 +- .../compiler/reference-equal-boolean.js | 20 + .../test/mjsunit/compiler/regress-1092011.js | 2 +- .../test/mjsunit/compiler/regress-1125145.js | 2 +- .../test/mjsunit/compiler/regress-1199345.js | 2 +- .../test/mjsunit/compiler/regress-3185901.js | 2 +- .../test/mjsunit/compiler/regress-3260426.js | 2 +- .../test/mjsunit/compiler/regress-446647.js | 2 +- deps/v8/test/mjsunit/compiler/regress-5320.js | 2 +- deps/v8/test/mjsunit/compiler/regress-6.js | 2 +- deps/v8/test/mjsunit/compiler/regress-9017.js | 2 +- .../test/mjsunit/compiler/regress-905555-2.js | 2 +- .../test/mjsunit/compiler/regress-905555.js | 2 +- .../test/mjsunit/compiler/regress-9137-1.js | 2 +- .../test/mjsunit/compiler/regress-9137-2.js | 2 +- .../test/mjsunit/compiler/regress-957559.js | 2 +- .../test/mjsunit/compiler/regress-9945-1.js | 2 +- .../test/mjsunit/compiler/regress-9945-2.js | 2 +- .../compiler/regress-compare-negate.js | 2 +- .../mjsunit/compiler/regress-crbug-1223107.js | 2 +- .../mjsunit/compiler/regress-crbug-965513.js | 2 +- ...ss-nonextensiblearray-store-outofbounds.js | 2 +- .../regress-sealedarray-store-outofbounds.js | 2 +- .../test/mjsunit/compiler/regress-v8-9139.js | 2 +- .../mjsunit/compiler/serializer-accessors.js | 2 +- .../test/mjsunit/compiler/serializer-apply.js | 2 +- .../test/mjsunit/compiler/serializer-call.js | 2 +- .../compiler/serializer-dead-after-jump.js | 2 +- .../compiler/serializer-dead-after-return.js | 2 +- .../serializer-transition-propagation.js | 2 +- .../store-data-property-in-literal-private.js | 2 +- .../mjsunit/compiler/stress-deopt-count-1.js | 2 +- .../mjsunit/compiler/stress-deopt-count-2.js | 2 +- .../mjsunit/compiler/strict-equal-receiver.js | 2 +- .../compiler/string-from-code-point.js | 2 +- .../mjsunit/compiler/string-startswith.js | 2 +- .../compiler/test-literal-map-migration.js | 2 +- .../typedarray-resizablearraybuffer.js | 27 + .../mjsunit/compiler/uint8-clamped-array.js | 2 +- deps/v8/test/mjsunit/compiler/verify-type.js | 2 +- .../concurrent-initial-prototype-change-1.js | 2 +- .../concurrent-initial-prototype-change-2.js | 2 +- deps/v8/test/mjsunit/const-dict-tracking.js | 2 +- deps/v8/test/mjsunit/const-field-tracking.js | 2 +- deps/v8/test/mjsunit/constant-folding-2.js | 2 +- deps/v8/test/mjsunit/default-nospec.js | 2 +- deps/v8/test/mjsunit/deopt-minus-zero.js | 2 +- .../mjsunit/deopt-recursive-eager-once.js | 2 +- .../test/mjsunit/deopt-recursive-lazy-once.js | 2 +- .../test/mjsunit/deopt-recursive-soft-once.js | 2 +- deps/v8/test/mjsunit/deopt-unlinked.js | 2 +- deps/v8/test/mjsunit/deopt-with-fp-regs.js | 2 +- .../mjsunit/deserialize-optimize-inner.js | 2 +- deps/v8/test/mjsunit/div-mul-minus-one.js | 2 +- .../mjsunit/elements-transition-hoisting.js | 2 +- .../mjsunit/ensure-growing-store-learns.js | 2 +- .../test/mjsunit/es6/array-iterator-turbo.js | 4 +- .../mjsunit/es6/block-conflicts-sloppy.js | 2 +- .../v8/test/mjsunit/es6/block-const-assign.js | 2 +- .../es6/block-let-crankshaft-sloppy.js | 2 +- .../test/mjsunit/es6/block-let-crankshaft.js | 2 +- .../test/mjsunit/es6/block-scoping-sloppy.js | 2 +- deps/v8/test/mjsunit/es6/block-scoping.js | 2 +- ...collections-constructor-custom-iterator.js | 2 +- ...ctions-constructor-iterator-side-effect.js | 2 +- ...nstructor-with-modified-array-prototype.js | 2 +- ...ions-constructor-with-modified-protoype.js | 2 +- .../mjsunit/es6/iterator-call-lazy-deopt.js | 66 + .../test/mjsunit/es6/iterator-eager-deopt.js | 5 +- ...zy-deopt.js => iterator-get-lazy-deopt.js} | 7 +- .../es6/iterator-invalid-receiver-opt.js | 51 + .../mjsunit/es6/large-classes-properties.js | 2 +- .../es6/map-constructor-entry-side-effect.js | 2 +- .../es6/map-constructor-entry-side-effect2.js | 2 +- .../es6/map-constructor-entry-side-effect3.js | 2 +- .../es6/map-constructor-entry-side-effect4.js | 2 +- .../mjsunit/es6/super-ic-opt-no-turboprop.js | 4 +- deps/v8/test/mjsunit/es6/super-ic-opt.js | 4 +- deps/v8/test/mjsunit/field-type-tracking.js | 2 +- deps/v8/test/mjsunit/filter-element-kinds.js | 2 +- deps/v8/test/mjsunit/frozen-array-reduce.js | 2 +- deps/v8/test/mjsunit/getters-on-elements.js | 2 +- .../async-generators-return-broken-promise.js | 82 + .../harmony/bigint/rematerialize-on-deopt.js | 2 +- .../define-private-class-field-stress.js | 2 +- .../mjsunit/harmony/regexp-overriden-exec.js | 2 +- .../mjsunit/harmony/regress/regress-912504.js | 2 +- .../harmony/shadowrealm-importvalue.js | 67 + .../mjsunit/harmony/shadowrealm-skip-1.mjs | 7 + .../harmony/shadowrealm-skip-2-throw.mjs | 2 + .../ic-migrated-map-add-when-monomorphic.js | 2 +- .../ic-migrated-map-add-when-uninitialized.js | 2 +- .../ic-migrated-map-update-when-deprecated.js | 2 +- .../v8/test/mjsunit/ignition/throw-if-hole.js | 2 +- .../mjsunit/ignition/throw-if-not-hole.js | 2 +- .../ignition/throw-super-not-called.js | 2 +- .../test/mjsunit/interrupt-budget-override.js | 2 +- .../mjsunit/keyed-load-hole-to-undefined.js | 2 +- .../mjsunit/keyed-load-with-string-key.js | 2 +- .../mjsunit/keyed-load-with-symbol-key.js | 2 +- deps/v8/test/mjsunit/maglev/add-number.js | 88 + .../mjsunit/maglev/eager-deopt-in-inline.js | 23 + .../lazy-deopt-with-onstack-activation.js | 2 +- .../lazy-deopt-without-onstack-activation.js | 2 +- deps/v8/test/mjsunit/maglev/literals.js | 51 + deps/v8/test/mjsunit/maglev/load-named.js | 59 + .../test/mjsunit/maglev/lots-of-registers.js | 59 + .../mjsunit/maglev/mutable-context-access.js | 94 + .../v8/test/mjsunit/maglev/simple-inlining.js | 20 + deps/v8/test/mjsunit/maglev/spill-double.js | 37 + deps/v8/test/mjsunit/math-deopt.js | 2 +- .../mjsunit/math-floor-of-div-minus-zero.js | 2 +- .../test/mjsunit/math-floor-of-div-nosudiv.js | 2 +- deps/v8/test/mjsunit/math-floor-of-div.js | 2 +- deps/v8/test/mjsunit/messages.js | 12 +- deps/v8/test/mjsunit/mjsunit.js | 16 +- deps/v8/test/mjsunit/mjsunit.status | 52 +- .../mjsunit/modules-import-meta-turbo.mjs | 2 +- deps/v8/test/mjsunit/modules-turbo1.mjs | 2 +- deps/v8/test/mjsunit/never-optimize.js | 2 +- .../mjsunit/non-extensible-array-reduce.js | 2 +- deps/v8/test/mjsunit/noopt.js | 4 +- deps/v8/test/mjsunit/object-seal.js | 2 +- deps/v8/test/mjsunit/optimized-array-every.js | 4 +- deps/v8/test/mjsunit/optimized-array-find.js | 4 +- .../test/mjsunit/optimized-array-findindex.js | 4 +- deps/v8/test/mjsunit/optimized-array-some.js | 4 +- deps/v8/test/mjsunit/optimized-filter.js | 2 +- deps/v8/test/mjsunit/optimized-map.js | 2 +- deps/v8/test/mjsunit/optimized-reduce.js | 2 +- deps/v8/test/mjsunit/optimized-reduceright.js | 2 +- .../test/mjsunit/optimized-string-includes.js | 2 +- deps/v8/test/mjsunit/promise-hooks.js | 2 +- .../test/mjsunit/random-bit-correlations.js | 2 +- deps/v8/test/mjsunit/readonly.js | 2 +- .../mjsunit/regress/asm/regress-618608.js | 2 +- .../test/mjsunit/regress/regress-1016450.js | 2 +- .../test/mjsunit/regress/regress-1034449.js | 2 +- .../test/mjsunit/regress/regress-1049982-1.js | 2 +- .../test/mjsunit/regress/regress-1049982-2.js | 2 +- .../test/mjsunit/regress/regress-1073440.js | 2 +- .../test/mjsunit/regress/regress-1112155.js | 2 +- .../test/mjsunit/regress/regress-1125871.js | 2 +- .../test/mjsunit/regress/regress-1166136-0.js | 2 +- .../test/mjsunit/regress/regress-1166136-1.js | 2 +- .../test/mjsunit/regress/regress-1166136-2.js | 2 +- .../test/mjsunit/regress/regress-1212583.js | 2 +- deps/v8/test/mjsunit/regress/regress-12359.js | 2 +- .../test/mjsunit/regress/regress-1254191.js | 2 +- .../test/mjsunit/regress/regress-1320094.js | 25 + deps/v8/test/mjsunit/regress/regress-2132.js | 2 +- deps/v8/test/mjsunit/regress/regress-2250.js | 2 +- deps/v8/test/mjsunit/regress/regress-2315.js | 2 +- deps/v8/test/mjsunit/regress/regress-2339.js | 2 +- deps/v8/test/mjsunit/regress/regress-2451.js | 2 +- .../v8/test/mjsunit/regress/regress-252797.js | 2 +- deps/v8/test/mjsunit/regress/regress-2618.js | 12 +- deps/v8/test/mjsunit/regress/regress-2989.js | 2 +- deps/v8/test/mjsunit/regress/regress-3176.js | 2 +- .../v8/test/mjsunit/regress/regress-330046.js | 2 +- .../v8/test/mjsunit/regress/regress-347914.js | 2 +- .../v8/test/mjsunit/regress/regress-354357.js | 2 +- .../v8/test/mjsunit/regress/regress-3650-3.js | 2 +- deps/v8/test/mjsunit/regress/regress-3709.js | 2 +- .../v8/test/mjsunit/regress/regress-385565.js | 2 +- .../v8/test/mjsunit/regress/regress-410912.js | 2 +- deps/v8/test/mjsunit/regress/regress-4121.js | 2 +- deps/v8/test/mjsunit/regress/regress-4380.js | 2 +- .../v8/test/mjsunit/regress/regress-453481.js | 2 +- deps/v8/test/mjsunit/regress/regress-4578.js | 4 +- .../v8/test/mjsunit/regress/regress-475705.js | 2 +- .../v8/test/mjsunit/regress/regress-476488.js | 2 +- deps/v8/test/mjsunit/regress/regress-4908.js | 2 +- deps/v8/test/mjsunit/regress/regress-5404.js | 2 +- .../v8/test/mjsunit/regress/regress-543994.js | 2 +- deps/v8/test/mjsunit/regress/regress-5440.js | 2 +- deps/v8/test/mjsunit/regress/regress-5660.js | 2 +- deps/v8/test/mjsunit/regress/regress-5790.js | 2 +- deps/v8/test/mjsunit/regress/regress-5802.js | 2 +- .../v8/test/mjsunit/regress/regress-619382.js | 2 +- .../v8/test/mjsunit/regress/regress-632289.js | 2 +- .../v8/test/mjsunit/regress/regress-655573.js | 2 +- .../v8/test/mjsunit/regress/regress-6607-1.js | 2 +- .../v8/test/mjsunit/regress/regress-6607-2.js | 2 +- .../test/mjsunit/regress/regress-681171-1.js | 2 +- .../test/mjsunit/regress/regress-681171-2.js | 2 +- .../test/mjsunit/regress/regress-681171-3.js | 2 +- deps/v8/test/mjsunit/regress/regress-6941.js | 2 +- deps/v8/test/mjsunit/regress/regress-6948.js | 2 +- deps/v8/test/mjsunit/regress/regress-6989.js | 2 +- deps/v8/test/mjsunit/regress/regress-6991.js | 2 +- .../v8/test/mjsunit/regress/regress-7014-1.js | 2 +- .../v8/test/mjsunit/regress/regress-7014-2.js | 2 +- deps/v8/test/mjsunit/regress/regress-7135.js | 2 +- .../v8/test/mjsunit/regress/regress-722978.js | 2 +- deps/v8/test/mjsunit/regress/regress-7254.js | 2 +- .../v8/test/mjsunit/regress/regress-730254.js | 2 +- deps/v8/test/mjsunit/regress/regress-7510.js | 2 +- .../v8/test/mjsunit/regress/regress-772190.js | 2 +- .../v8/test/mjsunit/regress/regress-794825.js | 2 +- .../v8/test/mjsunit/regress/regress-804096.js | 2 +- .../v8/test/mjsunit/regress/regress-804837.js | 2 +- .../v8/test/mjsunit/regress/regress-818070.js | 2 +- deps/v8/test/mjsunit/regress/regress-84234.js | 2 +- .../v8/test/mjsunit/regress/regress-863155.js | 2 +- deps/v8/test/mjsunit/regress/regress-8913.js | 2 +- deps/v8/test/mjsunit/regress/regress-9002.js | 2 +- .../v8/test/mjsunit/regress/regress-919340.js | 2 +- deps/v8/test/mjsunit/regress/regress-9441.js | 2 +- .../regress/regress-961709-classes-opt.js | 2 +- .../regress-assignment-in-test-context.js | 2 +- ...binary-bitwise-bigint-smi-mix-opt-depot.js | 2 +- .../regress/regress-bind-deoptimize.js | 2 +- .../mjsunit/regress/regress-charat-empty.js | 2 +- .../regress/regress-conditional-position.js | 2 +- .../mjsunit/regress/regress-crbug-1002628.js | 2 +- .../mjsunit/regress/regress-crbug-1004037.js | 2 +- .../mjsunit/regress/regress-crbug-1065741.js | 2 +- .../mjsunit/regress/regress-crbug-1171954.js | 2 +- .../mjsunit/regress/regress-crbug-1249941.js | 2 +- .../mjsunit/regress/regress-crbug-1259902.js | 2 +- .../mjsunit/regress/regress-crbug-1262007.js | 2 +- .../mjsunit/regress/regress-crbug-1321573.js | 8 + .../mjsunit/regress/regress-crbug-157019.js | 2 +- .../mjsunit/regress/regress-crbug-157520.js | 2 +- .../mjsunit/regress/regress-crbug-245480.js | 2 +- .../mjsunit/regress/regress-crbug-431602.js | 2 +- .../mjsunit/regress/regress-crbug-467531.js | 2 +- .../mjsunit/regress/regress-crbug-480807.js | 2 +- .../mjsunit/regress/regress-crbug-480819.js | 2 +- .../mjsunit/regress/regress-crbug-500497.js | 2 +- .../mjsunit/regress/regress-crbug-554831.js | 2 +- .../mjsunit/regress/regress-crbug-587068.js | 2 +- .../mjsunit/regress/regress-crbug-594183.js | 2 +- .../mjsunit/regress/regress-crbug-608279.js | 2 +- .../mjsunit/regress/regress-crbug-609029.js | 2 +- .../mjsunit/regress/regress-crbug-617524.js | 2 +- .../mjsunit/regress/regress-crbug-630952.js | 2 +- .../mjsunit/regress/regress-crbug-633585.js | 2 +- .../mjsunit/regress/regress-crbug-644111.js | 2 +- .../mjsunit/regress/regress-crbug-644631.js | 2 +- .../regress/regress-crbug-651403-global.js | 2 +- .../mjsunit/regress/regress-crbug-651403.js | 2 +- .../regress/regress-crbug-652186-global.js | 2 +- .../regress/regress-crbug-652186-local.js | 2 +- .../mjsunit/regress/regress-crbug-691687.js | 2 +- .../mjsunit/regress/regress-crbug-768158.js | 2 +- .../mjsunit/regress/regress-crbug-808192.js | 2 +- .../mjsunit/regress/regress-crbug-882233-2.js | 2 +- .../mjsunit/regress/regress-crbug-936302.js | 2 +- .../mjsunit/regress/regress-crbug-937734.js | 2 +- .../mjsunit/regress/regress-crbug-941743.js | 2 +- .../mjsunit/regress/regress-crbug-961709-2.js | 2 +- .../mjsunit/regress/regress-crbug-980529.js | 2 +- .../regress/regress-embedded-cons-string.js | 2 +- .../regress-fast-literal-transition.js | 4 +- .../regress/regress-map-invalidation-2.js | 2 +- .../regress/regress-param-local-type.js | 2 +- .../regress/regress-store-uncacheable.js | 2 +- .../regress/regress-stringAt-boundsCheck.js | 2 +- .../regress-trap-allocation-memento.js | 2 +- .../regress-unlink-closures-on-deopt.js | 2 +- .../test/mjsunit/regress/regress-v8-12194.js | 2 +- .../test/mjsunit/regress/regress-v8-5697.js | 2 +- .../mjsunit/regress/string-next-encoding.js | 2 +- .../mjsunit/regress/wasm/regress-02256.js | 2 +- .../mjsunit/regress/wasm/regress-02256b.js | 2 +- .../mjsunit/regress/wasm/regress-12789.js | 38 + .../mjsunit/regress/wasm/regress-1314184.js | 24 + .../mjsunit/regress/wasm/regress-647649.js | 2 +- deps/v8/test/mjsunit/sealed-array-reduce.js | 2 +- deps/v8/test/mjsunit/setters-on-elements.js | 2 +- .../mjsunit/shared-function-tier-up-turbo.js | 2 +- .../shared-memory/shared-struct-surface.js | 21 + deps/v8/test/mjsunit/shift-for-integer-div.js | 2 +- deps/v8/test/mjsunit/sin-cos.js | 2 +- deps/v8/test/mjsunit/smi-mul-const.js | 2 +- deps/v8/test/mjsunit/smi-mul.js | 2 +- .../stack-trace-cpp-function-template-2.js | 2 +- .../mjsunit/stackoverflow-underapplication.js | 2 +- deps/v8/test/mjsunit/string-deopt.js | 2 +- .../v8/test/mjsunit/strong-rooted-literals.js | 2 +- deps/v8/test/mjsunit/turboshaft/simple.js | 17 + ...array-growablesharedarraybuffer-atomics.js | 168 + deps/v8/test/mjsunit/typedarray-helpers.js | 56 + ...typedarray-resizablearraybuffer-atomics.js | 370 + deps/v8/test/mjsunit/unary-minus-deopt.js | 2 +- deps/v8/test/mjsunit/value-serializer.js | 48 + deps/v8/test/mjsunit/wasm/gc-experiments.js | 26 + deps/v8/test/mjsunit/wasm/js-api.js | 2 +- deps/v8/test/mjsunit/wasm/stack-switching.js | 23 + .../test/mjsunit/wasm/wasm-module-builder.js | 1 + .../mjsunit/web-snapshot/web-snapshot-2.js | 106 + .../mjsunit/web-snapshot/web-snapshot-3.js | 17 + .../mjsunit/web-snapshot/web-snapshot-4.js | 375 + .../mjsunit/web-snapshot/web-snapshot-5.js | 43 + .../web-snapshot/web-snapshot-externals.js | 29 +- .../web-snapshot/web-snapshot-helpers.js | 5 +- deps/v8/test/test262/test262.status | 882 +- deps/v8/test/unittests/BUILD.gn | 24 +- .../test/unittests/api/exception-unittest.cc | 219 +- .../v8/test/unittests/api/isolate-unittest.cc | 12 + .../test/unittests/api/v8-maybe-unittest.cc | 42 + .../test/unittests/api/v8-script-unittest.cc | 51 + .../turbo-assembler-arm64-unittest.cc | 130 +- .../v8/test/unittests/base/bignum-unittest.cc | 1501 +++ .../base/platform/platform-unittest.cc | 132 +- .../codegen/code-layout-unittest.cc} | 36 +- .../codegen/code-pages-unittest.cc} | 302 +- .../instruction-selector-arm64-unittest.cc | 189 +- .../compiler/bytecode-analysis-unittest.cc | 12 +- .../compiler/common-operator-unittest.cc | 6 +- .../unittests/compiler/compiler-unittest.cc | 931 ++ .../test/unittests/compiler/graph-unittest.cc | 6 +- .../test/unittests/compiler/graph-unittest.h | 8 +- .../compiler/int64-lowering-unittest.cc | 9 +- .../machine-operator-reducer-unittest.cc | 35 +- .../instruction-selector-riscv64-unittest.cc | 4 +- .../compiler/simplified-lowering-unittest.cc | 2 +- .../simplified-operator-reducer-unittest.cc | 4 +- .../compiler/typed-optimization-unittest.cc | 20 + .../date/date-unittest.cc} | 102 +- .../unified-heap-snapshot-unittest.cc | 7 +- .../heap/cppgc/age-table-unittest.cc | 210 + .../heap/cppgc/concurrent-sweeper-unittest.cc | 45 +- .../cppgc/explicit-management-unittest.cc | 8 - .../unittests/heap/cppgc/heap-unittest.cc | 2 +- .../unittests/heap/cppgc/minor-gc-unittest.cc | 14 +- .../heap/cppgc/name-trait-unittest.cc | 63 +- .../unittests/heap/cppgc/sweeper-unittest.cc | 14 +- .../heap/cppgc/weak-container-unittest.cc | 41 +- .../heap/cppgc/write-barrier-unittest.cc | 11 +- .../heap/embedder-tracing-unittest.cc | 46 - deps/v8/test/unittests/heap/lab-unittest.cc | 3 +- .../v8/test/unittests/heap/spaces-unittest.cc | 3 +- .../test/unittests/heap/unmapper-unittest.cc | 86 +- .../bytecode-array-builder-unittest.cc | 15 +- .../bytecode-array-writer-unittest.cc | 23 +- .../unittests/logging/counters-unittest.cc | 24 - .../logging/log-unittest.cc} | 504 +- .../unittests/numbers/conversions-unittest.cc | 459 +- .../unittests/objects/array-list-unittest.cc | 43 + .../concurrent-descriptor-array-unittest.cc} | 69 +- .../concurrent-feedback-vector-unittest.cc} | 81 +- .../objects/concurrent-js-array-unittest.cc} | 39 +- .../objects/concurrent-prototype-unittest.cc} | 71 +- ...ncurrent-script-context-table-unittest.cc} | 57 +- .../objects/concurrent-string-unittest.cc} | 223 +- .../concurrent-transition-array-unittest.cc} | 236 +- .../objects/modules-unittest.cc} | 735 +- .../test/unittests/objects/object-unittest.cc | 478 + .../osr-optimized-code-cache-unittest.cc | 424 - .../profiler/circular-queue-unittest.cc} | 46 +- .../test/unittests/regexp/regexp-unittest.cc | 2334 ++++ deps/v8/test/unittests/test-utils.h | 128 +- deps/v8/test/unittests/unittests.status | 97 +- .../unittests/utils/bit-vector-unittest.cc | 134 + .../test/unittests/wasm/decoder-unittest.cc | 3 +- .../wasm/function-body-decoder-unittest.cc | 4 +- .../unittests/wasm/leb-helper-unittest.cc | 8 +- deps/v8/test/wasm-js/testcfg.py | 5 - deps/v8/test/wasm-js/tests.tar.gz.sha1 | 2 +- deps/v8/test/wasm-js/wasm-js.status | 20 +- .../v8/test/wasm-spec-tests/tests.tar.gz.sha1 | 2 +- .../wasm-spec-tests/wasm-spec-tests.status | 9 - deps/v8/third_party/zlib/BUILD.gn | 61 +- deps/v8/third_party/zlib/LICENSE | 4 +- deps/v8/third_party/zlib/README.chromium | 4 +- deps/v8/third_party/zlib/chromeconf.h | 3 + .../zlib/contrib/optimizations/inflate.c | 33 +- .../contrib/optimizations/insert_string.h | 55 +- .../contrib/optimizations/slide_hash_neon.h | 65 - deps/v8/third_party/zlib/crc32.c | 1283 ++- deps/v8/third_party/zlib/crc32.h | 9877 ++++++++++++++++- deps/v8/third_party/zlib/deflate.c | 97 +- deps/v8/third_party/zlib/deflate.h | 13 +- deps/v8/third_party/zlib/fill_window_sse.c | 182 - .../zlib/google/compression_utils.cc | 25 +- deps/v8/third_party/zlib/gzguts.h | 3 +- deps/v8/third_party/zlib/gzlib.c | 4 +- deps/v8/third_party/zlib/gzread.c | 2 +- deps/v8/third_party/zlib/gzwrite.c | 13 +- deps/v8/third_party/zlib/infback.c | 3 +- deps/v8/third_party/zlib/inflate.c | 33 +- deps/v8/third_party/zlib/inflate.h | 2 +- deps/v8/third_party/zlib/inftrees.c | 6 +- deps/v8/third_party/zlib/slide_hash_simd.h | 116 + deps/v8/third_party/zlib/trees.c | 26 +- deps/v8/third_party/zlib/zlib.h | 206 +- deps/v8/third_party/zlib/zutil.h | 13 +- .../foozzie/testdata/failure_output.txt | 2 +- .../foozzie/testdata/failure_output_arch.txt | 2 +- .../testdata/failure_output_second.txt | 2 +- .../foozzie/testdata/smoke_test_output.txt | 2 +- .../tools/clusterfuzz/foozzie/v8_foozzie.py | 114 +- .../trials/clusterfuzz_trials_config.json | 1 + deps/v8/tools/codemap.mjs | 47 +- deps/v8/tools/combine_hints.py | 136 + deps/v8/tools/dev/gm.py | 5 +- deps/v8/tools/disasm.py | 2 +- deps/v8/tools/gcmole/gcmole.py | 39 +- deps/v8/tools/gcmole/run-gcmole.py | 36 +- deps/v8/tools/gdbinit | 62 +- deps/v8/tools/gen-inlining-tests.py | 10 +- deps/v8/tools/get_hints.py | 145 + .../ignition/bytecode_dispatches_report.py | 284 - .../bytecode_dispatches_report_test.py | 62 - .../ignition/linux_perf_bytecode_annotate.py | 177 - .../linux_perf_bytecode_annotate_test.py | 85 - deps/v8/tools/ignition/linux_perf_report.py | 260 - .../tools/ignition/linux_perf_report_test.py | 166 - deps/v8/tools/logreader.mjs | 8 +- deps/v8/tools/profile.mjs | 24 +- deps/v8/tools/profiling/README.md | 8 + .../tools/{ => profiling}/android-ll-prof.sh | 0 .../linux-perf-chrome-renderer-cmd.sh} | 1 - .../linux-perf-chrome.py} | 63 +- deps/v8/tools/profiling/linux-perf-d8.py | 234 + deps/v8/tools/{ => profiling}/ll_prof.py | 0 deps/v8/tools/{ => profiling}/run-llprof.sh | 0 deps/v8/tools/run-perf.sh | 58 - deps/v8/tools/run_perf.py | 307 +- deps/v8/tools/sourcemap.mjs | 2 +- deps/v8/tools/system-analyzer/helper.mjs | 12 +- deps/v8/tools/system-analyzer/index.css | 6 + deps/v8/tools/system-analyzer/index.html | 3 +- deps/v8/tools/system-analyzer/index.mjs | 14 +- deps/v8/tools/system-analyzer/log/code.mjs | 40 +- deps/v8/tools/system-analyzer/log/log.mjs | 6 +- deps/v8/tools/system-analyzer/log/tick.mjs | 3 + .../tools/system-analyzer/lws-middleware.js | 5 +- deps/v8/tools/system-analyzer/processor.mjs | 54 +- deps/v8/tools/system-analyzer/profiling.mjs | 331 + deps/v8/tools/system-analyzer/timeline.mjs | 36 +- .../view/code-panel-template.html | 2 +- deps/v8/tools/system-analyzer/view/helper.mjs | 4 + .../tools/system-analyzer/view/list-panel.mjs | 3 +- .../view/map-panel/map-details.mjs | 3 +- .../view/map-panel/map-transitions.mjs | 3 +- .../view/profiler-panel-template.html | 145 + .../system-analyzer/view/profiler-panel.mjs | 274 + .../view/property-link-table-template.html | 1 + .../view/script-panel-template.html | 1 + .../timeline/timeline-overview-template.html | 73 + .../view/timeline/timeline-overview.mjs | 269 + .../view/timeline/timeline-track-base.mjs | 9 +- .../timeline/timeline-track-stacked-base.mjs | 1 + .../timeline/timeline-track-template.html | 21 +- .../view/timeline/timeline-track-tick.mjs | 95 +- deps/v8/tools/testrunner/base_runner.py | 6 - .../v8/tools/testrunner/local/junit_output.py | 49 - deps/v8/tools/testrunner/local/variants.py | 98 +- deps/v8/tools/testrunner/objects/testcase.py | 35 +- deps/v8/tools/testrunner/testproc/fuzzer.py | 6 +- deps/v8/tools/testrunner/testproc/progress.py | 40 - deps/v8/tools/turbolizer/index.html | 6 +- deps/v8/tools/turbolizer/src/constants.ts | 6 +- .../v8/tools/turbolizer/src/graphmultiview.ts | 1 + deps/v8/tools/turbolizer/src/range-view.ts | 94 +- deps/v8/tools/turbolizer/src/resizer.ts | 180 +- .../turbolizer/turbo-visualizer-ranges.css | 8 +- deps/v8/tools/unittests/run_perf_test.py | 149 +- deps/v8/tools/v8_presubmit.py | 10 +- deps/v8/tools/v8heapconst.py | 321 +- deps/v8/tools/wasm/update-wasm-spec-tests.sh | 5 +- 1540 files changed, 58420 insertions(+), 27616 deletions(-) delete mode 100644 deps/v8/src/base/atomicops_internals_atomicword_compat.h create mode 100644 deps/v8/src/base/platform/platform-linux.h rename deps/v8/src/builtins/{builtins-shadowrealm-gen.cc => builtins-shadow-realm-gen.cc} (54%) rename deps/v8/src/builtins/{builtins-shadow-realms.cc => builtins-shadow-realm.cc} (96%) create mode 100644 deps/v8/src/builtins/builtins-web-snapshots.cc create mode 100644 deps/v8/src/common/code-memory-access-inl.h create mode 100644 deps/v8/src/common/code-memory-access.cc create mode 100644 deps/v8/src/common/code-memory-access.h create mode 100644 deps/v8/src/compiler/turboshaft/assembler.h create mode 100644 deps/v8/src/compiler/turboshaft/deopt-data.h create mode 100644 deps/v8/src/compiler/turboshaft/graph-builder.cc create mode 100644 deps/v8/src/compiler/turboshaft/graph-builder.h create mode 100644 deps/v8/src/compiler/turboshaft/graph.cc create mode 100644 deps/v8/src/compiler/turboshaft/graph.h create mode 100644 deps/v8/src/compiler/turboshaft/operations.cc create mode 100644 deps/v8/src/compiler/turboshaft/operations.h create mode 100644 deps/v8/src/compiler/turboshaft/recreate-schedule.cc create mode 100644 deps/v8/src/compiler/turboshaft/recreate-schedule.h create mode 100644 deps/v8/src/compiler/wasm-graph-assembler.cc create mode 100644 deps/v8/src/compiler/wasm-graph-assembler.h rename deps/v8/src/logging/{log-utils.cc => log-file.cc} (67%) rename deps/v8/src/logging/{log-utils.h => log-file.h} (78%) rename deps/v8/src/objects/{js-shadow-realms-inl.h => js-shadow-realm-inl.h} (69%) rename deps/v8/src/objects/{js-shadow-realms.h => js-shadow-realm.h} (82%) rename deps/v8/src/objects/{js-shadow-realms.tq => js-shadow-realm.tq} (67%) delete mode 100644 deps/v8/src/objects/osr-optimized-code-cache-inl.h delete mode 100644 deps/v8/src/objects/osr-optimized-code-cache.cc delete mode 100644 deps/v8/src/objects/osr-optimized-code-cache.h create mode 100644 deps/v8/src/runtime/runtime-temporal.cc create mode 100644 deps/v8/src/utils/hex-format.cc create mode 100644 deps/v8/src/utils/hex-format.h create mode 100644 deps/v8/src/utils/sha-256.cc create mode 100644 deps/v8/src/utils/sha-256.h create mode 100644 deps/v8/src/wasm/assembler-buffer-cache.cc create mode 100644 deps/v8/src/wasm/assembler-buffer-cache.h rename deps/v8/test/cctest/compiler/{codegen-tester.cc => test-codegen.cc} (99%) rename deps/v8/test/cctest/compiler/{codegen-tester.h => test-codegen.h} (99%) create mode 100644 deps/v8/test/cctest/interpreter/bytecode_expectations/CompareBoolean.golden rename deps/v8/test/cctest/libsampler/{signals-and-mutexes.cc => test-signals-and-mutexes.cc} (100%) delete mode 100644 deps/v8/test/cctest/test-array-list.cc delete mode 100644 deps/v8/test/cctest/test-bignum.cc delete mode 100644 deps/v8/test/cctest/test-bit-vector.cc delete mode 100644 deps/v8/test/cctest/test-compiler.cc delete mode 100644 deps/v8/test/cctest/test-conversions.cc rename deps/v8/test/cctest/{disasm-regex-helper.cc => test-disasm-regex-helper.cc} (99%) rename deps/v8/test/cctest/{disasm-regex-helper.h => test-disasm-regex-helper.h} (100%) delete mode 100644 deps/v8/test/cctest/test-object.cc delete mode 100644 deps/v8/test/cctest/test-regexp.cc create mode 100644 deps/v8/test/inspector/debugger/regress-crbug-1319828-expected.txt create mode 100644 deps/v8/test/inspector/debugger/regress-crbug-1319828.js create mode 100644 deps/v8/test/inspector/debugger/restart-frame/fails-for-non-existant-index-expected.txt create mode 100644 deps/v8/test/inspector/debugger/restart-frame/fails-for-non-existant-index.js create mode 100644 deps/v8/test/inspector/debugger/restart-frame/fails-for-resumables-expected.txt create mode 100644 deps/v8/test/inspector/debugger/restart-frame/fails-for-resumables.js create mode 100644 deps/v8/test/inspector/debugger/restart-frame/fails-with-embedder-frames-expected.txt create mode 100644 deps/v8/test/inspector/debugger/restart-frame/fails-with-embedder-frames.js rename deps/v8/test/inspector/debugger/{restart-frame-expected.txt => restart-frame/fails-without-mode-param-expected.txt} (100%) rename deps/v8/test/inspector/debugger/{restart-frame.js => restart-frame/fails-without-mode-param.js} (100%) create mode 100644 deps/v8/test/inspector/debugger/restart-frame/restart-inlined-frame-expected.txt create mode 100644 deps/v8/test/inspector/debugger/restart-frame/restart-inlined-frame.js create mode 100644 deps/v8/test/inspector/debugger/restart-frame/restart-top-frame-debugger-stmt-expected.txt create mode 100644 deps/v8/test/inspector/debugger/restart-frame/restart-top-frame-debugger-stmt.js create mode 100644 deps/v8/test/inspector/debugger/restart-frame/restart-top-frame-local-variables-expected.txt create mode 100644 deps/v8/test/inspector/debugger/restart-frame/restart-top-frame-local-variables.js create mode 100644 deps/v8/test/inspector/debugger/restart-frame/restart-top-frame-with-breakpoint-expected.txt create mode 100644 deps/v8/test/inspector/debugger/restart-frame/restart-top-frame-with-breakpoint.js create mode 100644 deps/v8/test/inspector/debugger/restart-frame/restart-various-frames-expected.txt create mode 100644 deps/v8/test/inspector/debugger/restart-frame/restart-various-frames.js create mode 100644 deps/v8/test/inspector/debugger/wasm-terminate-execution-on-pause-expected.txt create mode 100644 deps/v8/test/inspector/debugger/wasm-terminate-execution-on-pause.js rename deps/v8/test/inspector/runtime/{add-web-driver-value-expected.txt => generate-web-driver-value-expected.txt} (93%) rename deps/v8/test/inspector/runtime/{add-web-driver-value.js => generate-web-driver-value.js} (94%) create mode 100644 deps/v8/test/inspector/runtime/regress-1321833-expected.txt create mode 100644 deps/v8/test/inspector/runtime/regress-1321833.js create mode 100644 deps/v8/test/intl/number-format/options-digits-v3.js create mode 100644 deps/v8/test/intl/number-format/options-digits.js create mode 100644 deps/v8/test/intl/temporal/calendar/fields.js create mode 100644 deps/v8/test/js-perf-test/GetOwnPropertyDescriptor/GetOwnPropertyDescriptor.json create mode 100644 deps/v8/test/js-perf-test/GetOwnPropertyDescriptor/get-own-property-descriptor.js create mode 100644 deps/v8/test/js-perf-test/GetOwnPropertyDescriptor/run.js create mode 100644 deps/v8/test/message/fail/array-spread-non-iterable-object.js create mode 100644 deps/v8/test/message/fail/array-spread-non-iterable-object.out create mode 100644 deps/v8/test/mjsunit/compiler/reference-equal-boolean.js create mode 100644 deps/v8/test/mjsunit/compiler/typedarray-resizablearraybuffer.js create mode 100644 deps/v8/test/mjsunit/es6/iterator-call-lazy-deopt.js rename deps/v8/test/mjsunit/es6/{iterator-lazy-deopt.js => iterator-get-lazy-deopt.js} (88%) create mode 100644 deps/v8/test/mjsunit/es6/iterator-invalid-receiver-opt.js create mode 100644 deps/v8/test/mjsunit/harmony/async-generators-return-broken-promise.js create mode 100644 deps/v8/test/mjsunit/harmony/shadowrealm-importvalue.js create mode 100644 deps/v8/test/mjsunit/harmony/shadowrealm-skip-1.mjs create mode 100644 deps/v8/test/mjsunit/harmony/shadowrealm-skip-2-throw.mjs create mode 100644 deps/v8/test/mjsunit/maglev/add-number.js create mode 100644 deps/v8/test/mjsunit/maglev/eager-deopt-in-inline.js create mode 100644 deps/v8/test/mjsunit/maglev/literals.js create mode 100644 deps/v8/test/mjsunit/maglev/load-named.js create mode 100644 deps/v8/test/mjsunit/maglev/lots-of-registers.js create mode 100644 deps/v8/test/mjsunit/maglev/mutable-context-access.js create mode 100644 deps/v8/test/mjsunit/maglev/simple-inlining.js create mode 100644 deps/v8/test/mjsunit/maglev/spill-double.js create mode 100644 deps/v8/test/mjsunit/regress/regress-1320094.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1321573.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-12789.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1314184.js create mode 100644 deps/v8/test/mjsunit/turboshaft/simple.js create mode 100644 deps/v8/test/mjsunit/typedarray-growablesharedarraybuffer-atomics.js create mode 100644 deps/v8/test/mjsunit/typedarray-resizablearraybuffer-atomics.js create mode 100644 deps/v8/test/mjsunit/value-serializer.js create mode 100644 deps/v8/test/mjsunit/wasm/gc-experiments.js create mode 100644 deps/v8/test/mjsunit/web-snapshot/web-snapshot-4.js create mode 100644 deps/v8/test/mjsunit/web-snapshot/web-snapshot-5.js create mode 100644 deps/v8/test/unittests/api/v8-maybe-unittest.cc create mode 100644 deps/v8/test/unittests/api/v8-script-unittest.cc create mode 100644 deps/v8/test/unittests/base/bignum-unittest.cc rename deps/v8/test/{cctest/test-code-layout.cc => unittests/codegen/code-layout-unittest.cc} (78%) rename deps/v8/test/{cctest/test-code-pages.cc => unittests/codegen/code-pages-unittest.cc} (60%) create mode 100644 deps/v8/test/unittests/compiler/compiler-unittest.cc rename deps/v8/test/{cctest/test-date.cc => unittests/date/date-unittest.cc} (56%) create mode 100644 deps/v8/test/unittests/heap/cppgc/age-table-unittest.cc rename deps/v8/test/{cctest/test-log.cc => unittests/logging/log-unittest.cc} (75%) create mode 100644 deps/v8/test/unittests/objects/array-list-unittest.cc rename deps/v8/test/{cctest/test-concurrent-descriptor-array.cc => unittests/objects/concurrent-descriptor-array-unittest.cc} (73%) rename deps/v8/test/{cctest/test-concurrent-feedback-vector.cc => unittests/objects/concurrent-feedback-vector-unittest.cc} (77%) rename deps/v8/test/{cctest/test-concurrent-js-array.cc => unittests/objects/concurrent-js-array-unittest.cc} (80%) rename deps/v8/test/{cctest/test-concurrent-prototype.cc => unittests/objects/concurrent-prototype-unittest.cc} (73%) rename deps/v8/test/{cctest/test-concurrent-script-context-table.cc => unittests/objects/concurrent-script-context-table-unittest.cc} (79%) rename deps/v8/test/{cctest/test-concurrent-string.cc => unittests/objects/concurrent-string-unittest.cc} (62%) rename deps/v8/test/{cctest/test-concurrent-transition-array.cc => unittests/objects/concurrent-transition-array-unittest.cc} (61%) rename deps/v8/test/{cctest/test-modules.cc => unittests/objects/modules-unittest.cc} (56%) delete mode 100644 deps/v8/test/unittests/objects/osr-optimized-code-cache-unittest.cc rename deps/v8/test/{cctest/test-circular-queue.cc => unittests/profiler/circular-queue-unittest.cc} (72%) create mode 100644 deps/v8/test/unittests/utils/bit-vector-unittest.cc delete mode 100644 deps/v8/third_party/zlib/contrib/optimizations/slide_hash_neon.h delete mode 100644 deps/v8/third_party/zlib/fill_window_sse.c create mode 100644 deps/v8/third_party/zlib/slide_hash_simd.h create mode 100644 deps/v8/tools/combine_hints.py create mode 100644 deps/v8/tools/get_hints.py delete mode 100755 deps/v8/tools/ignition/bytecode_dispatches_report.py delete mode 100644 deps/v8/tools/ignition/bytecode_dispatches_report_test.py delete mode 100755 deps/v8/tools/ignition/linux_perf_bytecode_annotate.py delete mode 100644 deps/v8/tools/ignition/linux_perf_bytecode_annotate_test.py delete mode 100755 deps/v8/tools/ignition/linux_perf_report.py delete mode 100644 deps/v8/tools/ignition/linux_perf_report_test.py create mode 100644 deps/v8/tools/profiling/README.md rename deps/v8/tools/{ => profiling}/android-ll-prof.sh (100%) rename deps/v8/tools/{chrome/linux-perf-renderer-cmd.sh => profiling/linux-perf-chrome-renderer-cmd.sh} (99%) rename deps/v8/tools/{chrome/linux_perf.py => profiling/linux-perf-chrome.py} (80%) create mode 100755 deps/v8/tools/profiling/linux-perf-d8.py rename deps/v8/tools/{ => profiling}/ll_prof.py (100%) rename deps/v8/tools/{ => profiling}/run-llprof.sh (100%) delete mode 100755 deps/v8/tools/run-perf.sh create mode 100644 deps/v8/tools/system-analyzer/profiling.mjs create mode 100644 deps/v8/tools/system-analyzer/view/profiler-panel-template.html create mode 100644 deps/v8/tools/system-analyzer/view/profiler-panel.mjs create mode 100644 deps/v8/tools/system-analyzer/view/timeline/timeline-overview-template.html create mode 100644 deps/v8/tools/system-analyzer/view/timeline/timeline-overview.mjs delete mode 100644 deps/v8/tools/testrunner/local/junit_output.py diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index e095f812659d7a..b39fbd633128d7 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -103,11 +103,13 @@ Dominic Chen Dominic Farolini Douglas Crosher Dusan Milosavljevic +Eden Wang Eric Rannaud Erich Ocean Evan Lucas Fedor Indutny Felix Geisendörfer +Feng Yu Filipe David Manana Franziska Hinkelmann Gao Sheng diff --git a/deps/v8/BUILD.bazel b/deps/v8/BUILD.bazel index 279e3e55a0dca8..bd03deb8069620 100644 --- a/deps/v8/BUILD.bazel +++ b/deps/v8/BUILD.bazel @@ -579,7 +579,6 @@ filegroup( "src/base/address-region.h", "src/base/atomic-utils.h", "src/base/atomicops.h", - "src/base/atomicops_internals_atomicword_compat.h", "src/base/base-export.h", "src/base/bit-field.h", "src/base/bits-iterator.h", @@ -689,6 +688,7 @@ filegroup( "@v8//bazel/config:is_linux": [ "src/base/debug/stack_trace_posix.cc", "src/base/platform/platform-linux.cc", + "src/base/platform/platform-linux.h", ], "@v8//bazel/config:is_android": [ "src/base/debug/stack_trace_android.cc", @@ -912,7 +912,7 @@ filegroup( "src/objects/js-proxy.tq", "src/objects/js-regexp-string-iterator.tq", "src/objects/js-regexp.tq", - "src/objects/js-shadow-realms.tq", + "src/objects/js-shadow-realm.tq", "src/objects/js-struct.tq", "src/objects/js-temporal-objects.tq", "src/objects/js-weak-refs.tq", @@ -1034,6 +1034,15 @@ filegroup( ], ) +# Default setting for v8_enable_pointer_compression when target is x64. +selects.config_setting_group( + name = "is_v8_enable_webassembly_on_non_android_posix_x64", + match_all = [ + ":is_v8_enable_webassembly", + "@v8//bazel/config:is_non_android_posix_x64", + ], +) + filegroup( name = "v8_base_without_compiler_files", srcs = [ @@ -1110,7 +1119,7 @@ filegroup( "src/builtins/builtins-promise.h", "src/builtins/builtins-reflect.cc", "src/builtins/builtins-regexp.cc", - "src/builtins/builtins-shadow-realms.cc", + "src/builtins/builtins-shadow-realm.cc", "src/builtins/builtins-sharedarraybuffer.cc", "src/builtins/builtins-string.cc", "src/builtins/builtins-struct.cc", @@ -1121,6 +1130,7 @@ filegroup( "src/builtins/builtins-utils-inl.h", "src/builtins/builtins-utils.h", "src/builtins/builtins-weak-refs.cc", + "src/builtins/builtins-web-snapshots.cc", "src/builtins/builtins.cc", "src/builtins/builtins.h", "src/builtins/constants-table-builder.cc", @@ -1205,6 +1215,9 @@ filegroup( "src/common/assert-scope.h", "src/common/allow-deprecated.h", "src/common/checks.h", + "src/common/code-memory-access-inl.h", + "src/common/code-memory-access.cc", + "src/common/code-memory-access.h", "src/common/high-allocation-throughput-scope.h", "src/common/message-template.h", "src/common/operation.h", @@ -1595,8 +1608,8 @@ filegroup( "src/logging/local-logger.cc", "src/logging/local-logger.h", "src/logging/log-inl.h", - "src/logging/log-utils.cc", - "src/logging/log-utils.h", + "src/logging/log-file.cc", + "src/logging/log-file.h", "src/logging/log.cc", "src/logging/log.h", "src/logging/metrics.cc", @@ -1714,8 +1727,8 @@ filegroup( "src/objects/js-regexp-string-iterator.h", "src/objects/js-regexp.cc", "src/objects/js-regexp.h", - "src/objects/js-shadow-realms.h", - "src/objects/js-shadow-realms-inl.h", + "src/objects/js-shadow-realm.h", + "src/objects/js-shadow-realm-inl.h", "src/objects/js-struct.h", "src/objects/js-struct-inl.h", "src/objects/js-temporal-objects.h", @@ -1771,9 +1784,6 @@ filegroup( "src/objects/ordered-hash-table-inl.h", "src/objects/ordered-hash-table.cc", "src/objects/ordered-hash-table.h", - "src/objects/osr-optimized-code-cache-inl.h", - "src/objects/osr-optimized-code-cache.cc", - "src/objects/osr-optimized-code-cache.h", "src/objects/primitive-heap-object-inl.h", "src/objects/primitive-heap-object.h", "src/objects/promise-inl.h", @@ -1994,6 +2004,7 @@ filegroup( "src/runtime/runtime-shadow-realm.cc", "src/runtime/runtime-strings.cc", "src/runtime/runtime-symbol.cc", + "src/runtime/runtime-temporal.cc", "src/runtime/runtime-test.cc", "src/runtime/runtime-trace.cc", "src/runtime/runtime-typedarray.cc", @@ -2097,12 +2108,6 @@ filegroup( "src/tracing/traced-value.h", "src/tracing/tracing-category-observer.cc", "src/tracing/tracing-category-observer.h", - "src/trap-handler/handler-inside-posix.h", - "src/trap-handler/handler-inside.cc", - "src/trap-handler/handler-outside.cc", - "src/trap-handler/handler-shared.cc", - "src/trap-handler/trap-handler-internal.h", - "src/trap-handler/trap-handler.h", "src/utils/address-map.cc", "src/utils/address-map.h", "src/utils/allocation.cc", @@ -2386,7 +2391,11 @@ filegroup( ], }) + select({ # Only for x64 builds and for arm64 with x64 host simulator. - "@v8//bazel/config:is_non_android_posix_x64": [ + ":is_v8_enable_webassembly_on_non_android_posix_x64": [ + "src/trap-handler/handler-inside-posix.cc", + "src/trap-handler/handler-outside-posix.cc", + ], + "@v8//bazel/config:is_macos_arm64": [ "src/trap-handler/handler-inside-posix.cc", "src/trap-handler/handler-outside-posix.cc", ], @@ -2423,6 +2432,7 @@ filegroup( "src/compiler/int64-lowering.h", "src/compiler/wasm-compiler.h", "src/compiler/wasm-escape-analysis.h", + "src/compiler/wasm-graph-assembler.h", "src/compiler/wasm-inlining.h", "src/compiler/wasm-loop-peeling.h", "src/debug/debug-wasm-objects.cc", @@ -2430,6 +2440,14 @@ filegroup( "src/debug/debug-wasm-objects-inl.h", "src/runtime/runtime-test-wasm.cc", "src/runtime/runtime-wasm.cc", + "src/trap-handler/handler-inside-posix.h", + "src/trap-handler/handler-inside.cc", + "src/trap-handler/handler-outside.cc", + "src/trap-handler/handler-shared.cc", + "src/trap-handler/trap-handler-internal.h", + "src/trap-handler/trap-handler.h", + "src/wasm/assembler-buffer-cache.cc", + "src/wasm/assembler-buffer-cache.h", "src/wasm/baseline/liftoff-assembler.cc", "src/wasm/baseline/liftoff-assembler-defs.h", "src/wasm/baseline/liftoff-assembler.h", @@ -2793,6 +2811,16 @@ filegroup( "src/compiler/state-values-utils.h", "src/compiler/store-store-elimination.cc", "src/compiler/store-store-elimination.h", + "src/compiler/turboshaft/assembler.h", + "src/compiler/turboshaft/deopt-data.h", + "src/compiler/turboshaft/graph-builder.cc", + "src/compiler/turboshaft/graph-builder.h", + "src/compiler/turboshaft/graph.cc", + "src/compiler/turboshaft/graph.h", + "src/compiler/turboshaft/operations.cc", + "src/compiler/turboshaft/operations.h", + "src/compiler/turboshaft/recreate-schedule.cc", + "src/compiler/turboshaft/recreate-schedule.h", "src/compiler/type-cache.cc", "src/compiler/type-cache.h", "src/compiler/type-narrowing-reducer.cc", @@ -2816,6 +2844,7 @@ filegroup( "src/compiler/wasm-compiler.cc", "src/compiler/wasm-loop-peeling.cc", "src/compiler/wasm-escape-analysis.cc", + "src/compiler/wasm-graph-assembler.cc", "src/compiler/wasm-inlining.cc", ], "//conditions:default": [], @@ -2863,7 +2892,7 @@ filegroup( "src/builtins/builtins-proxy-gen.h", "src/builtins/builtins-regexp-gen.cc", "src/builtins/builtins-regexp-gen.h", - "src/builtins/builtins-shadowrealm-gen.cc", + "src/builtins/builtins-shadow-realm-gen.cc", "src/builtins/builtins-sharedarraybuffer-gen.cc", "src/builtins/builtins-string-gen.cc", "src/builtins/builtins-string-gen.h", @@ -3136,6 +3165,8 @@ filegroup( "src/inspector/v8-string-conversions.h", "src/inspector/v8-value-utils.cc", "src/inspector/v8-value-utils.h", + "src/inspector/v8-webdriver-serializer.cc", + "src/inspector/v8-webdriver-serializer.h", "src/inspector/value-mirror.cc", "src/inspector/value-mirror.h", ":crdtp_platform_files", @@ -3596,7 +3627,7 @@ v8_binary_non_pointer_compression( alias( name = "v8ci", - actual = "icu/v8", + actual = "noicu/v8", ) # ================================================= diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 988c907d964a25..9ddff70ab939c8 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -180,10 +180,13 @@ declare_args() { # chrome --no-sandbox --disable-extensions # --js-flags="--turbo-profiling-log-builtins --logfile=path/to/v8.log" # "http://localhost/test-suite" - # 3. Optionally repeat step 2 for additional workloads, and concatenate all of - # the resulting log files into a single file. - # 4. Build again with v8_builtins_profiling_log_file set to the file created - # in steps 2-3. + # 3. Run tools/get_hints.py to produce the branch hints, selecting min_count + # and threshold_ratio as you wish. + # 4. Optionally repeat steps 2-3 for additional workloads, and use + # tools/combine_hints.py to combine the hints produced in step 3 into a + # single file. + # 5. Build again with v8_builtins_profiling_log_file set to the file created + # in step 3 or 4. v8_builtins_profiling_log_file = "" # Enables various testing features. @@ -418,7 +421,7 @@ if (v8_enable_zone_compression == "") { } if (v8_enable_short_builtin_calls == "") { v8_enable_short_builtin_calls = - v8_current_cpu == "x64" || (!is_android && v8_current_cpu == "arm64") + v8_current_cpu == "x64" || v8_current_cpu == "arm64" } if (v8_enable_external_code_space == "") { v8_enable_external_code_space = @@ -498,6 +501,18 @@ if (v8_enable_sandbox == "") { v8_enable_external_code_space } +# Enable sandboxed pointers on desktop when the sandbox is enabled. +if (v8_enable_sandbox) { + # When sanitizers are enabled, PartitionAlloc forwards allocations to malloc + # instead of allocating from its Pools and so isn't compatible with the + # sandbox. As such, disable the sandbox there. See https://crbug.com/1323174 + if (!is_asan && !is_hwasan && !is_lsan && !is_tsan && !is_msan) { + v8_enable_sandboxed_pointers = + target_os != "fuchsia" && target_os != "android" && + target_os != "chromeos" + } +} + # Enable all available sandbox features if sandbox future is enabled. if (v8_enable_sandbox_future) { v8_enable_sandboxed_pointers = true @@ -564,9 +579,6 @@ if (v8_enable_single_generation == true) { "Requires unconditional write barriers or none (which disables incremental marking)") } -assert(!v8_enable_conservative_stack_scanning || v8_enable_single_generation, - "Conservative stack scanning requires single generation") - if (v8_fuchsia_use_vmex_resource) { assert(target_os == "fuchsia", "VMEX resource only available on Fuchsia") } @@ -787,6 +799,9 @@ if (cppgc_enable_object_names) { } if (cppgc_enable_caged_heap) { enabled_external_cppgc_defines += [ "CPPGC_CAGED_HEAP" ] + + # Always enable young generation compile time flag if caged heap is enabled. + cppgc_enable_young_generation = true } if (cppgc_enable_young_generation) { enabled_external_cppgc_defines += [ "CPPGC_YOUNG_GENERATION" ] @@ -1470,7 +1485,7 @@ config("toolchain") { # For code that is hot during mksnapshot. In fast-mksnapshot builds, we # optimize some files even in debug builds to speed up mksnapshot times. -config("always_optimize") { +config("always_turbofanimize") { configs = [ ":internal_config" ] # TODO(crbug.com/621335) Rework this so that we don't have the confusion @@ -1786,7 +1801,7 @@ torque_files = [ "src/objects/js-proxy.tq", "src/objects/js-regexp-string-iterator.tq", "src/objects/js-regexp.tq", - "src/objects/js-shadow-realms.tq", + "src/objects/js-shadow-realm.tq", "src/objects/js-struct.tq", "src/objects/js-temporal-objects.tq", "src/objects/js-weak-refs.tq", @@ -2365,7 +2380,7 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-proxy-gen.h", "src/builtins/builtins-regexp-gen.cc", "src/builtins/builtins-regexp-gen.h", - "src/builtins/builtins-shadowrealm-gen.cc", + "src/builtins/builtins-shadow-realm-gen.cc", "src/builtins/builtins-sharedarraybuffer-gen.cc", "src/builtins/builtins-string-gen.cc", "src/builtins/builtins-string-gen.h", @@ -2750,6 +2765,8 @@ v8_header_set("v8_internal_headers") { "src/common/allow-deprecated.h", "src/common/assert-scope.h", "src/common/checks.h", + "src/common/code-memory-access-inl.h", + "src/common/code-memory-access.h", "src/common/high-allocation-throughput-scope.h", "src/common/message-template.h", "src/common/operation.h", @@ -2874,6 +2891,12 @@ v8_header_set("v8_internal_headers") { "src/compiler/simplified-operator.h", "src/compiler/state-values-utils.h", "src/compiler/store-store-elimination.h", + "src/compiler/turboshaft/assembler.h", + "src/compiler/turboshaft/deopt-data.h", + "src/compiler/turboshaft/graph-builder.h", + "src/compiler/turboshaft/graph.h", + "src/compiler/turboshaft/operations.h", + "src/compiler/turboshaft/recreate-schedule.h", "src/compiler/type-cache.h", "src/compiler/type-narrowing-reducer.h", "src/compiler/typed-optimization.h", @@ -3108,8 +3131,8 @@ v8_header_set("v8_internal_headers") { "src/logging/counters-scopes.h", "src/logging/counters.h", "src/logging/local-logger.h", + "src/logging/log-file.h", "src/logging/log-inl.h", - "src/logging/log-utils.h", "src/logging/log.h", "src/logging/metrics.h", "src/logging/runtime-call-stats-scope.h", @@ -3207,8 +3230,8 @@ v8_header_set("v8_internal_headers") { "src/objects/js-regexp.h", "src/objects/js-segments-inl.h", "src/objects/js-segments.h", - "src/objects/js-shadow-realms-inl.h", - "src/objects/js-shadow-realms.h", + "src/objects/js-shadow-realm-inl.h", + "src/objects/js-shadow-realm.h", "src/objects/js-struct-inl.h", "src/objects/js-struct.h", "src/objects/js-temporal-objects-inl.h", @@ -3251,8 +3274,6 @@ v8_header_set("v8_internal_headers") { "src/objects/option-utils.h", "src/objects/ordered-hash-table-inl.h", "src/objects/ordered-hash-table.h", - "src/objects/osr-optimized-code-cache-inl.h", - "src/objects/osr-optimized-code-cache.h", "src/objects/primitive-heap-object-inl.h", "src/objects/primitive-heap-object.h", "src/objects/promise-inl.h", @@ -3442,12 +3463,14 @@ v8_header_set("v8_internal_headers") { "src/utils/bit-vector.h", "src/utils/boxed-float.h", "src/utils/detachable-vector.h", + "src/utils/hex-format.h", "src/utils/identity-map.h", "src/utils/locked-queue-inl.h", "src/utils/locked-queue.h", "src/utils/memcopy.h", "src/utils/ostreams.h", "src/utils/scoped-list.h", + "src/utils/sha-256.h", "src/utils/utils-inl.h", "src/utils/utils.h", "src/utils/version.h", @@ -3507,12 +3530,14 @@ v8_header_set("v8_internal_headers") { "src/compiler/int64-lowering.h", "src/compiler/wasm-compiler.h", "src/compiler/wasm-escape-analysis.h", + "src/compiler/wasm-graph-assembler.h", "src/compiler/wasm-inlining.h", "src/compiler/wasm-loop-peeling.h", "src/debug/debug-wasm-objects-inl.h", "src/debug/debug-wasm-objects.h", "src/trap-handler/trap-handler-internal.h", "src/trap-handler/trap-handler.h", + "src/wasm/assembler-buffer-cache.h", "src/wasm/baseline/liftoff-assembler-defs.h", "src/wasm/baseline/liftoff-assembler.h", "src/wasm/baseline/liftoff-compiler.h", @@ -3991,6 +4016,8 @@ v8_compiler_sources = [ "src/compiler/value-numbering-reducer.cc", "src/compiler/verifier.cc", "src/compiler/zone-stats.cc", + "src/utils/hex-format.cc", + "src/utils/sha-256.cc", ] if (v8_enable_webassembly) { @@ -3998,6 +4025,7 @@ if (v8_enable_webassembly) { "src/compiler/int64-lowering.cc", "src/compiler/wasm-compiler.cc", "src/compiler/wasm-escape-analysis.cc", + "src/compiler/wasm-graph-assembler.cc", "src/compiler/wasm-inlining.cc", "src/compiler/wasm-loop-peeling.cc", ] @@ -4026,7 +4054,7 @@ v8_source_set("v8_compiler_opt") { if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) { # The :no_optimize config is added to v8_add_configs in v8.gni. remove_configs = [ "//build/config/compiler:no_optimize" ] - configs = [ ":always_optimize" ] + configs = [ ":always_turbofanimize" ] } else { # Without this else branch, gn fails to generate build files for non-debug # builds (because we try to remove a config that is not present). @@ -4058,6 +4086,34 @@ v8_source_set("v8_compiler") { configs = [ ":internal_config" ] } +# The src/compiler files with default optimization behavior. +v8_source_set("v8_turboshaft") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + sources = [ + "src/compiler/turboshaft/graph-builder.cc", + "src/compiler/turboshaft/graph.cc", + "src/compiler/turboshaft/operations.cc", + "src/compiler/turboshaft/recreate-schedule.cc", + ] + + public_deps = [ + ":generate_bytecode_builtins_list", + ":run_torque", + ":v8_internal_headers", + ":v8_maybe_icu", + ":v8_tracing", + ] + + deps = [ + ":v8_base_without_compiler", + ":v8_libbase", + ":v8_shared_internal_headers", + ] + + configs = [ ":internal_config" ] +} + group("v8_compiler_for_mksnapshot") { if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) { deps = [ ":v8_compiler_opt" ] @@ -4122,7 +4178,7 @@ v8_source_set("v8_base_without_compiler") { "src/builtins/builtins-object.cc", "src/builtins/builtins-reflect.cc", "src/builtins/builtins-regexp.cc", - "src/builtins/builtins-shadow-realms.cc", + "src/builtins/builtins-shadow-realm.cc", "src/builtins/builtins-sharedarraybuffer.cc", "src/builtins/builtins-string.cc", "src/builtins/builtins-struct.cc", @@ -4131,6 +4187,7 @@ v8_source_set("v8_base_without_compiler") { "src/builtins/builtins-trace.cc", "src/builtins/builtins-typed-array.cc", "src/builtins/builtins-weak-refs.cc", + "src/builtins/builtins-web-snapshots.cc", "src/builtins/builtins.cc", "src/builtins/constants-table-builder.cc", "src/codegen/aligned-slot-allocator.cc", @@ -4163,6 +4220,7 @@ v8_source_set("v8_base_without_compiler") { "src/codegen/turbo-assembler.cc", "src/codegen/unoptimized-compilation-info.cc", "src/common/assert-scope.cc", + "src/common/code-memory-access.cc", "src/compiler-dispatcher/lazy-compile-dispatcher.cc", "src/compiler-dispatcher/optimizing-compile-dispatcher.cc", "src/date/date.cc", @@ -4316,7 +4374,7 @@ v8_source_set("v8_base_without_compiler") { "src/libsampler/sampler.cc", "src/logging/counters.cc", "src/logging/local-logger.cc", - "src/logging/log-utils.cc", + "src/logging/log-file.cc", "src/logging/log.cc", "src/logging/metrics.cc", "src/logging/runtime-call-stats.cc", @@ -4366,7 +4424,6 @@ v8_source_set("v8_base_without_compiler") { "src/objects/objects.cc", "src/objects/option-utils.cc", "src/objects/ordered-hash-table.cc", - "src/objects/osr-optimized-code-cache.cc", "src/objects/property-descriptor.cc", "src/objects/property.cc", "src/objects/scope-info.cc", @@ -4458,6 +4515,7 @@ v8_source_set("v8_base_without_compiler") { "src/runtime/runtime-shadow-realm.cc", "src/runtime/runtime-strings.cc", "src/runtime/runtime-symbol.cc", + "src/runtime/runtime-temporal.cc", "src/runtime/runtime-test.cc", "src/runtime/runtime-trace.cc", "src/runtime/runtime-typedarray.cc", @@ -4544,6 +4602,7 @@ v8_source_set("v8_base_without_compiler") { "src/trap-handler/handler-inside.cc", "src/trap-handler/handler-outside.cc", "src/trap-handler/handler-shared.cc", + "src/wasm/assembler-buffer-cache.cc", "src/wasm/baseline/liftoff-assembler.cc", "src/wasm/baseline/liftoff-compiler.cc", "src/wasm/canonical-types.cc", @@ -4966,6 +5025,7 @@ group("v8_base") { public_deps = [ ":v8_base_without_compiler", ":v8_compiler", + ":v8_turboshaft", ] } @@ -5057,7 +5117,7 @@ v8_source_set("torque_base") { if (is_debug && !v8_optimized_debug && v8_enable_fast_torque) { # The :no_optimize config is added to v8_add_configs in v8.gni. remove_configs += [ "//build/config/compiler:no_optimize" ] - configs += [ ":always_optimize" ] + configs += [ ":always_turbofanimize" ] } } @@ -5101,7 +5161,6 @@ v8_component("v8_libbase") { "src/base/address-region.h", "src/base/atomic-utils.h", "src/base/atomicops.h", - "src/base/atomicops_internals_atomicword_compat.h", "src/base/base-export.h", "src/base/bit-field.h", "src/base/bits-iterator.h", @@ -5243,6 +5302,7 @@ v8_component("v8_libbase") { sources += [ "src/base/debug/stack_trace_posix.cc", "src/base/platform/platform-linux.cc", + "src/base/platform/platform-linux.h", ] libs = [ @@ -5874,6 +5934,7 @@ if (current_toolchain == v8_snapshot_toolchain) { ":v8_maybe_icu", ":v8_shared_internal_headers", ":v8_tracing", + ":v8_turboshaft", "//build/win:default_exe_manifest", ] } diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 54ac85a4bdbb8a..29936d4d23eb46 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -36,14 +36,22 @@ vars = { '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.40.0.40ff5a5', # GN CIPD package version. - 'gn_version': 'git_revision:ae110f8b525009255ba1f9ae96982176d3bfad3d', + 'gn_version': 'git_revision:bf4e17dc67b2a2007475415e3f9e1d1cf32f6e35', # luci-go CIPD package version. - 'luci_go': 'git_revision:6da0608e4fa8a3c6d1fa4f855485c0038b05bf72', + 'luci_go': 'git_revision:2aa3d7e5e8662c5193059a490f07b7d91331933e', + + # 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:8.20220510.2.1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_build-tools_version @@ -56,7 +64,7 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_extras_version # and whatever else without interference from each other. - 'android_sdk_extras_version': 'ppQ4TnqDvBHQ3lXx5KPq97egzF5X2FFyOrVHkGmiTMQC', + 'android_sdk_extras_version': 'bY55nDqO6FAm6FkGIj09sh2KW9oqAkCGKjYok5nUvBMC', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_patcher_version # and whatever else without interference from each other. @@ -83,20 +91,20 @@ deps = { 'base/trace_event/common': Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + 'd115b033c4e53666b535cbd1985ffe60badad082', 'build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + 'b37c340767cf9e7777d4ca5a588c34c5744df9b2', + Var('chromium_url') + '/chromium/src/build.git' + '@' + '1c34f36484f43be915b48b090527d87356c72ce8', 'buildtools': - Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + 'c2e4795660817c2776dbabd778b92ed58c074032', + Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '7208eddba161d85108097c3c5975264c04e3cad8', 'buildtools/clang_format/script': Var('chromium_url') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + 'e435ad79c17b1888b34df88d6a30a094936e3836', 'buildtools/linux64': { 'packages': [ { - 'package': 'gn/gn/linux-amd64', + 'package': 'gn/gn/linux-${{arch}}', 'version': Var('gn_version'), } ], 'dep_type': 'cipd', - 'condition': 'host_os == "linux"', + 'condition': 'host_os == "linux" and host_cpu != "s390" and host_cpu != "ppc"', }, 'buildtools/mac': { 'packages': [ @@ -111,9 +119,9 @@ deps = { 'buildtools/third_party/libc++/trunk': Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '79a2e924d96e2fc1e4b937c42efd08898fa472d7', 'buildtools/third_party/libc++abi/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + 'e025ba5dc85202540099d7cd8e72eae2d4ee9e33', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + 'ecff200716d0e23f46d01dfcebac61ac7e00b15b', 'buildtools/third_party/libunwind/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'c39fea88739be63a2d5590a938ce19d762b915fc', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '3d54d41c27afba1e3a83303c1bc005d303d40eb6', 'buildtools/win': { 'packages': [ { @@ -139,7 +147,7 @@ deps = { 'test/mozilla/data': Var('chromium_url') + '/v8/deps/third_party/mozilla-tests.git' + '@' + 'f6c578a10ea707b1a8ab0b88943fe5115ce2b9be', 'test/test262/data': - Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'd7c0a2076c2b0c1531aef7069d4abe70eec44ee3', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + '8f5c7aed093e753649500a538ce62f8b8c035aa4', 'third_party/aemu-linux-x64': { 'packages': [ { @@ -165,7 +173,7 @@ deps = { 'condition': 'checkout_android', }, 'third_party/android_platform': { - 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '2760db43ffc8b074cb7960c90b5254f74a5c299a', + 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '5ecb4635f03307cc461051c2d90b1e2397483f49', 'condition': 'checkout_android', }, 'third_party/android_sdk/public': { @@ -207,7 +215,7 @@ deps = { 'dep_type': 'cipd', }, 'third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '3a1ae18f882d024686144edbec3050aae055f146', + 'url': Var('chromium_url') + '/catapult.git' + '@' + 'd1ddc12119ab1365426dac869c09711ee3a463ed', 'condition': 'checkout_android', }, 'third_party/colorama/src': { @@ -215,18 +223,24 @@ deps = { 'condition': 'checkout_android', }, 'third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '3b97fa826eee4bd1978c4c049038b1e4f201e8f2', - 'third_party/fuchsia-sdk': { - 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + '7c9c220d13ab367d49420144a257886ebfbce278', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '31bfd519956b011b822769f227fd7dcf679f2f43', + 'third_party/fuchsia-sdk/sdk': { + 'packages': [ + { + 'package': Var('fuchsia_sdk_cipd_prefix') + '${{platform}}', + 'version': Var('fuchsia_version'), + }, + ], 'condition': 'checkout_fuchsia', + 'dep_type': 'cipd', }, 'third_party/google_benchmark/src': { - 'url': Var('chromium_url') + '/external/github.com/google/benchmark.git' + '@' + 'dc901ff9090e2b931433790cc44afc3af3b09ab2', + 'url': Var('chromium_url') + '/external/github.com/google/benchmark.git' + '@' + 'bc4639c15443d7bc134de57a39833cf97018f4c1', }, 'third_party/googletest/src': Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'af29db7ec28d6df1c7f0f745186884091e602e07', 'third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '1fd0dbea04448c3f73fe5cb7599f9472f0f107f1', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '585942f33d939a11f4600bd5042649b7ca189008', 'third_party/instrumented_libraries': Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + 'e09c4b66b6e87116eb190651421f1a6e2f3b9c52', 'third_party/ittapi': { @@ -272,9 +286,9 @@ deps = { 'condition': 'checkout_android', }, 'third_party/zlib': - Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + 'a6d209ab932df0f1c9d5b7dc67cfa74e8a3272c0', + Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '9979c19f11314156490b53da91df08c934a3c0d4', 'tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'b5e2f7c16bbf3aefc9354e8fbad3de0a543f2193', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '9da95105864734ee87f47e0de638a09eb088338b', 'tools/luci-go': { 'packages': [ { @@ -580,15 +594,6 @@ hooks = [ 'action': ['python3', 'build/util/lastchange.py', '-o', 'build/util/LASTCHANGE'], }, - { - 'name': 'Download Fuchsia SDK', - 'pattern': '.', - 'condition': 'checkout_fuchsia', - 'action': [ - 'python3', - 'build/fuchsia/update_sdk.py', - ], - }, { 'name': 'Download Fuchsia system images', 'pattern': '.', diff --git a/deps/v8/bazel/config/BUILD.bazel b/deps/v8/bazel/config/BUILD.bazel index ffa9ef040722b4..448260de88465d 100644 --- a/deps/v8/bazel/config/BUILD.bazel +++ b/deps/v8/bazel/config/BUILD.bazel @@ -290,6 +290,14 @@ selects.config_setting_group( ], ) +selects.config_setting_group( + name = "is_macos_arm64", + match_all = [ + ":is_macos", + ":is_arm64", + ], +) + config_setting( name = "is_compiler_default", flag_values = { diff --git a/deps/v8/gni/release_branch_toggle.gni b/deps/v8/gni/release_branch_toggle.gni index 43e3b6ae567631..c502c8c62e5836 100644 --- a/deps/v8/gni/release_branch_toggle.gni +++ b/deps/v8/gni/release_branch_toggle.gni @@ -4,4 +4,4 @@ declare_args() { is_on_release_branch = true -} +} \ No newline at end of file diff --git a/deps/v8/include/cppgc/heap-statistics.h b/deps/v8/include/cppgc/heap-statistics.h index 8e626596e5b07b..de3b435c735c8e 100644 --- a/deps/v8/include/cppgc/heap-statistics.h +++ b/deps/v8/include/cppgc/heap-statistics.h @@ -56,7 +56,7 @@ struct HeapStatistics final { /** Amount of memory actually used on the page. */ size_t used_size_bytes = 0; /** Statistics for object allocated on the page. Filled only when - * NameProvider::HideInternalNames() is false. */ + * NameProvider::SupportsCppClassNamesAsObjectNames() is true. */ std::vector object_statistics; }; diff --git a/deps/v8/include/cppgc/heap.h b/deps/v8/include/cppgc/heap.h index aa3c6f468a21de..2ebda47bf60ab4 100644 --- a/deps/v8/include/cppgc/heap.h +++ b/deps/v8/include/cppgc/heap.h @@ -59,7 +59,7 @@ class V8_EXPORT Heap { }; /** - * Specifies supported marking types + * Specifies supported marking types. */ enum class MarkingType : uint8_t { /** @@ -79,7 +79,7 @@ class V8_EXPORT Heap { }; /** - * Specifies supported sweeping types + * Specifies supported sweeping types. */ enum class SweepingType : uint8_t { /** diff --git a/deps/v8/include/cppgc/internal/caged-heap-local-data.h b/deps/v8/include/cppgc/internal/caged-heap-local-data.h index a27649c17fce5b..081c88e30e0bbb 100644 --- a/deps/v8/include/cppgc/internal/caged-heap-local-data.h +++ b/deps/v8/include/cppgc/internal/caged-heap-local-data.h @@ -14,6 +14,10 @@ #include "cppgc/platform.h" #include "v8config.h" // NOLINT(build/include_directory) +#if __cpp_lib_bitopts +#include +#endif // __cpp_lib_bitopts + namespace cppgc { namespace internal { @@ -22,24 +26,31 @@ class HeapBase; #if defined(CPPGC_YOUNG_GENERATION) // AgeTable is the bytemap needed for the fast generation check in the write -// barrier. AgeTable contains entries that correspond to 512 bytes memory +// barrier. AgeTable contains entries that correspond to 4096 bytes memory // regions (cards). Each entry in the table represents generation of the objects // that reside on the corresponding card (young, old or mixed). -class AgeTable final { +class V8_EXPORT AgeTable final { static constexpr size_t kRequiredSize = 1 * api_constants::kMB; static constexpr size_t kAllocationGranularity = api_constants::kAllocationGranularity; public: + // Represents age of the objects living on a single card. enum class Age : uint8_t { kOld, kYoung, kMixed }; + // When setting age for a range, consider or ignore ages of the adjacent + // cards. + enum class AdjacentCardsPolicy : uint8_t { kConsider, kIgnore }; static constexpr size_t kCardSizeInBytes = - (api_constants::kCagedHeapReservationSize / kAllocationGranularity) / - kRequiredSize; + api_constants::kCagedHeapReservationSize / kRequiredSize; void SetAge(uintptr_t cage_offset, Age age) { table_[card(cage_offset)] = age; } + + void SetAgeForRange(uintptr_t cage_offset_begin, uintptr_t cage_offset_end, + Age age, AdjacentCardsPolicy adjacent_cards_policy); + V8_INLINE Age GetAge(uintptr_t cage_offset) const { return table_[card(cage_offset)]; } @@ -49,7 +60,15 @@ class AgeTable final { private: V8_INLINE size_t card(uintptr_t offset) const { constexpr size_t kGranularityBits = +#if __cpp_lib_bitopts + std::countr_zero(static_cast(kCardSizeInBytes)); +#elif V8_HAS_BUILTIN_CTZ __builtin_ctz(static_cast(kCardSizeInBytes)); +#else //! V8_HAS_BUILTIN_CTZ + // Hardcode and check with assert. + 12; +#endif // !V8_HAS_BUILTIN_CTZ + static_assert((1 << kGranularityBits) == kCardSizeInBytes); const size_t entry = offset >> kGranularityBits; CPPGC_DCHECK(table_.size() > entry); return entry; @@ -67,6 +86,7 @@ struct CagedHeapLocalData final { CagedHeapLocalData(HeapBase&, PageAllocator&); bool is_incremental_marking_in_progress = false; + bool is_young_generation_enabled = false; HeapBase& heap_base; #if defined(CPPGC_YOUNG_GENERATION) AgeTable age_table; diff --git a/deps/v8/include/cppgc/internal/name-trait.h b/deps/v8/include/cppgc/internal/name-trait.h index 32a334785926d7..ece49cbe75e721 100644 --- a/deps/v8/include/cppgc/internal/name-trait.h +++ b/deps/v8/include/cppgc/internal/name-trait.h @@ -6,6 +6,7 @@ #define INCLUDE_CPPGC_INTERNAL_NAME_TRAIT_H_ #include +#include #include #include "cppgc/name-provider.h" @@ -58,6 +59,11 @@ struct HeapObjectName { bool name_was_hidden; }; +enum class HeapObjectNameForUnnamedObject : uint8_t { + kUseClassNameIfSupported, + kUseHiddenName, +}; + class V8_EXPORT NameTraitBase { protected: static HeapObjectName GetNameFromTypeSignature(const char*); @@ -78,16 +84,24 @@ class NameTrait final : public NameTraitBase { #endif // !CPPGC_SUPPORTS_OBJECT_NAMES } - static HeapObjectName GetName(const void* obj) { - return GetNameFor(static_cast(obj)); + static HeapObjectName GetName( + const void* obj, HeapObjectNameForUnnamedObject name_retrieval_mode) { + return GetNameFor(static_cast(obj), name_retrieval_mode); } private: - static HeapObjectName GetNameFor(const NameProvider* name_provider) { + static HeapObjectName GetNameFor(const NameProvider* name_provider, + HeapObjectNameForUnnamedObject) { + // Objects inheriting from `NameProvider` are not considered unnamed as + // users already provided a name for them. return {name_provider->GetHumanReadableName(), false}; } - static HeapObjectName GetNameFor(...) { + static HeapObjectName GetNameFor( + const void*, HeapObjectNameForUnnamedObject name_retrieval_mode) { + if (name_retrieval_mode == HeapObjectNameForUnnamedObject::kUseHiddenName) + return {NameProvider::kHiddenName, true}; + #if CPPGC_SUPPORTS_COMPILE_TIME_TYPENAME return {GetTypename(), false}; #elif CPPGC_SUPPORTS_OBJECT_NAMES @@ -112,7 +126,8 @@ class NameTrait final : public NameTraitBase { } }; -using NameCallback = HeapObjectName (*)(const void*); +using NameCallback = HeapObjectName (*)(const void*, + HeapObjectNameForUnnamedObject); } // namespace internal } // namespace cppgc diff --git a/deps/v8/include/cppgc/internal/write-barrier.h b/deps/v8/include/cppgc/internal/write-barrier.h index bfabc31e13a969..555d3269382a03 100644 --- a/deps/v8/include/cppgc/internal/write-barrier.h +++ b/deps/v8/include/cppgc/internal/write-barrier.h @@ -95,12 +95,10 @@ class V8_EXPORT WriteBarrier final { static void CheckParams(Type expected_type, const Params& params) {} #endif // !V8_ENABLE_CHECKS - // The IncrementalOrConcurrentUpdater class allows cppgc internal to update - // |incremental_or_concurrent_marking_flag_|. - class IncrementalOrConcurrentMarkingFlagUpdater; - static bool IsAnyIncrementalOrConcurrentMarking() { - return incremental_or_concurrent_marking_flag_.MightBeEntered(); - } + // The FlagUpdater class allows cppgc internal to update + // |write_barrier_enabled_|. + class FlagUpdater; + static bool IsEnabled() { return write_barrier_enabled_.MightBeEntered(); } private: WriteBarrier() = delete; @@ -130,12 +128,13 @@ class V8_EXPORT WriteBarrier final { const CagedHeapLocalData& local_data, const void* object); #endif // CPPGC_YOUNG_GENERATION - static AtomicEntryFlag incremental_or_concurrent_marking_flag_; + static AtomicEntryFlag write_barrier_enabled_; }; template V8_INLINE WriteBarrier::Type SetAndReturnType(WriteBarrier::Params& params) { - if (type == WriteBarrier::Type::kNone) return WriteBarrier::Type::kNone; + if constexpr (type == WriteBarrier::Type::kNone) + return WriteBarrier::Type::kNone; #if V8_ENABLE_CHECKS params.type = type; #endif // !V8_ENABLE_CHECKS @@ -180,18 +179,24 @@ class V8_EXPORT WriteBarrierTypeForCagedHeapPolicy final { static V8_INLINE bool TryGetCagedHeap(const void* slot, const void* value, WriteBarrier::Params& params) { - // TODO(chromium:1056170): Check if the null check can be folded in with - // the rest of the write barrier. - if (!value) return false; - params.start = reinterpret_cast(value) & - ~(api_constants::kCagedHeapReservationAlignment - 1); - const uintptr_t slot_offset = - reinterpret_cast(slot) - params.start; - if (slot_offset > api_constants::kCagedHeapReservationSize) { - // Check if slot is on stack or value is sentinel or nullptr. This relies - // on the fact that kSentinelPointer is encoded as 0x1. - return false; - } + // The compiler must fold these checks into a single one. + if (!value || value == kSentinelPointer) return false; + + // Now we are certain that |value| points within the cage. + const uintptr_t real_cage_base = + reinterpret_cast(value) & + ~(api_constants::kCagedHeapReservationAlignment - 1); + + const uintptr_t cage_base_from_slot = + reinterpret_cast(slot) & + ~(api_constants::kCagedHeapReservationAlignment - 1); + + // If |cage_base_from_slot| is different from |real_cage_base|, the slot + // must be on stack, bail out. + if (V8_UNLIKELY(real_cage_base != cage_base_from_slot)) return false; + + // Otherwise, set params.start and return. + params.start = real_cage_base; return true; } @@ -209,17 +214,17 @@ struct WriteBarrierTypeForCagedHeapPolicy::ValueModeDispatch< static V8_INLINE WriteBarrier::Type Get(const void* slot, const void* value, WriteBarrier::Params& params, HeapHandleCallback) { -#if !defined(CPPGC_YOUNG_GENERATION) - if (V8_LIKELY(!WriteBarrier::IsAnyIncrementalOrConcurrentMarking())) { + if (V8_LIKELY(!WriteBarrier::IsEnabled())) return SetAndReturnType(params); - } -#endif // !CPPGC_YOUNG_GENERATION - bool within_cage = TryGetCagedHeap(slot, value, params); - if (!within_cage) { - return WriteBarrier::Type::kNone; - } - if (V8_LIKELY(!params.caged_heap().is_incremental_marking_in_progress)) { + + const bool within_cage = TryGetCagedHeap(slot, value, params); + if (!within_cage) return WriteBarrier::Type::kNone; + + const auto& caged_heap = params.caged_heap(); + if (V8_LIKELY(!caged_heap.is_incremental_marking_in_progress)) { #if defined(CPPGC_YOUNG_GENERATION) + if (!caged_heap.is_young_generation_enabled) + return WriteBarrier::Type::kNone; params.heap = reinterpret_cast(params.start); params.slot_offset = reinterpret_cast(slot) - params.start; params.value_offset = reinterpret_cast(value) - params.start; @@ -228,6 +233,8 @@ struct WriteBarrierTypeForCagedHeapPolicy::ValueModeDispatch< return SetAndReturnType(params); #endif // !CPPGC_YOUNG_GENERATION } + + // Use marking barrier. params.heap = reinterpret_cast(params.start); return SetAndReturnType(params); } @@ -240,10 +247,15 @@ struct WriteBarrierTypeForCagedHeapPolicy::ValueModeDispatch< static V8_INLINE WriteBarrier::Type Get(const void* slot, const void*, WriteBarrier::Params& params, HeapHandleCallback callback) { + if (V8_LIKELY(!WriteBarrier::IsEnabled())) + return SetAndReturnType(params); + #if defined(CPPGC_YOUNG_GENERATION) HeapHandle& handle = callback(); if (V8_LIKELY(!IsMarking(handle, params))) { // params.start is populated by IsMarking(). + if (!params.caged_heap().is_young_generation_enabled) + return WriteBarrier::Type::kNone; params.heap = &handle; params.slot_offset = reinterpret_cast(slot) - params.start; // params.value_offset stays 0. @@ -253,15 +265,12 @@ struct WriteBarrierTypeForCagedHeapPolicy::ValueModeDispatch< } return SetAndReturnType(params); } -#else // !CPPGC_YOUNG_GENERATION - if (V8_LIKELY(!WriteBarrier::IsAnyIncrementalOrConcurrentMarking())) { - return SetAndReturnType(params); - } +#else // !defined(CPPGC_YOUNG_GENERATION) HeapHandle& handle = callback(); if (V8_UNLIKELY(!subtle::HeapState::IsMarking(handle))) { return SetAndReturnType(params); } -#endif // !CPPGC_YOUNG_GENERATION +#endif // !defined(CPPGC_YOUNG_GENERATION) params.heap = &handle; return SetAndReturnType(params); } @@ -310,7 +319,7 @@ struct WriteBarrierTypeForNonCagedHeapPolicy::ValueModeDispatch< if (object <= static_cast(kSentinelPointer)) { return SetAndReturnType(params); } - if (V8_LIKELY(!WriteBarrier::IsAnyIncrementalOrConcurrentMarking())) { + if (V8_LIKELY(!WriteBarrier::IsEnabled())) { return SetAndReturnType(params); } if (IsMarking(object, ¶ms.heap)) { @@ -327,7 +336,7 @@ struct WriteBarrierTypeForNonCagedHeapPolicy::ValueModeDispatch< static V8_INLINE WriteBarrier::Type Get(const void*, const void*, WriteBarrier::Params& params, HeapHandleCallback callback) { - if (V8_UNLIKELY(WriteBarrier::IsAnyIncrementalOrConcurrentMarking())) { + if (V8_UNLIKELY(WriteBarrier::IsEnabled())) { HeapHandle& handle = callback(); if (IsMarking(handle)) { params.heap = &handle; diff --git a/deps/v8/include/cppgc/name-provider.h b/deps/v8/include/cppgc/name-provider.h index 224dd4b5d678ec..216f6098d99dd1 100644 --- a/deps/v8/include/cppgc/name-provider.h +++ b/deps/v8/include/cppgc/name-provider.h @@ -37,15 +37,15 @@ class V8_EXPORT NameProvider { static constexpr const char kNoNameDeducible[] = ""; /** - * Indicating whether internal names are hidden or not. + * Indicating whether the build supports extracting C++ names as object names. * * @returns true if C++ names should be hidden and represented by kHiddenName. */ - static constexpr bool HideInternalNames() { + static constexpr bool SupportsCppClassNamesAsObjectNames() { #if CPPGC_SUPPORTS_OBJECT_NAMES - return false; -#else // !CPPGC_SUPPORTS_OBJECT_NAMES return true; +#else // !CPPGC_SUPPORTS_OBJECT_NAMES + return false; #endif // !CPPGC_SUPPORTS_OBJECT_NAMES } diff --git a/deps/v8/include/js_protocol.pdl b/deps/v8/include/js_protocol.pdl index 53a5f4c11dcc02..0421ecdef4cfd0 100644 --- a/deps/v8/include/js_protocol.pdl +++ b/deps/v8/include/js_protocol.pdl @@ -113,6 +113,11 @@ domain Debugger Runtime.RemoteObject this # The value being returned, if the function is at return point. optional Runtime.RemoteObject returnValue + # Valid only while the VM is paused and indicates whether this frame + # can be restarted or not. Note that a `true` value here does not + # guarantee that Debugger#restartFrame with this CallFrameId will be + # successful, but it is very likely. + experimental optional boolean canBeRestarted # Scope description. type Scope extends object @@ -554,7 +559,7 @@ domain Debugger integer endColumn # Specifies script creation context. Runtime.ExecutionContextId executionContextId - # Content hash of the script. + # Content hash of the script, SHA-256. string hash # Embedder-specific auxiliary data. optional object executionContextAuxData @@ -593,7 +598,7 @@ domain Debugger integer endColumn # Specifies script creation context. Runtime.ExecutionContextId executionContextId - # Content hash of the script. + # Content hash of the script, SHA-256. string hash # Embedder-specific auxiliary data. optional object executionContextAuxData @@ -708,18 +713,24 @@ experimental domain HeapProfiler # If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken # when the tracking is stopped. optional boolean reportProgress - optional boolean treatGlobalObjectsAsRoots + # Deprecated in favor of `exposeInternals`. + deprecated optional boolean treatGlobalObjectsAsRoots # If true, numerical values are included in the snapshot optional boolean captureNumericValue + # If true, exposes internals of the snapshot. + experimental optional boolean exposeInternals command takeHeapSnapshot parameters # If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. optional boolean reportProgress - # If true, a raw snapshot without artificial roots will be generated - optional boolean treatGlobalObjectsAsRoots + # If true, a raw snapshot without artificial roots will be generated. + # Deprecated in favor of `exposeInternals`. + deprecated optional boolean treatGlobalObjectsAsRoots # If true, numerical values are included in the snapshot optional boolean captureNumericValue + # If true, exposes internals of the snapshot. + experimental optional boolean exposeInternals event addHeapSnapshotChunk parameters @@ -1342,7 +1353,9 @@ domain Runtime optional string objectGroup # Whether to throw an exception if side effect cannot be ruled out during evaluation. experimental optional boolean throwOnSideEffect - # Whether the result should be serialized according to https://w3c.github.io/webdriver-bidi. + # Whether the result should contain `webDriverValue`, serialized according to + # https://w3c.github.io/webdriver-bidi. This is mutually exclusive with `returnByValue`, but + # resulting `objectId` is still provided. experimental optional boolean generateWebDriverValue returns # Call result. diff --git a/deps/v8/include/v8-callbacks.h b/deps/v8/include/v8-callbacks.h index 70b9c2ae9308a5..51b974ed1f3e5f 100644 --- a/deps/v8/include/v8-callbacks.h +++ b/deps/v8/include/v8-callbacks.h @@ -216,7 +216,14 @@ using AddHistogramSampleCallback = void (*)(void* histogram, int sample); using FatalErrorCallback = void (*)(const char* location, const char* message); -using OOMErrorCallback = void (*)(const char* location, bool is_heap_oom); +using LegacyOOMErrorCallback = void (*)(const char* location, bool is_heap_oom); + +// TODO(chromium:1323177): Add a parameter for details, once this is deprecated +// for at least one branch. +using OOMErrorCallback V8_DEPRECATED( + "Use LegacyOOMErrorCallback; OOMErrorCallback will be changed " + "(https://crbug.com/1323177)") = void (*)(const char* location, + bool is_heap_oom); using MessageCallback = void (*)(Local message, Local data); @@ -233,6 +240,8 @@ enum class CrashKeyId { kMapSpaceFirstPageAddress, kCodeSpaceFirstPageAddress, kDumpType, + kSnapshotChecksumCalculated, + kSnapshotChecksumExpected, }; using AddCrashKeyCallback = void (*)(CrashKeyId id, const std::string& value); diff --git a/deps/v8/include/v8-cppgc.h b/deps/v8/include/v8-cppgc.h index 401e492210609f..412154930f7d92 100644 --- a/deps/v8/include/v8-cppgc.h +++ b/deps/v8/include/v8-cppgc.h @@ -77,9 +77,6 @@ struct WrapperDescriptor final { }; struct V8_EXPORT CppHeapCreateParams { - CppHeapCreateParams(const CppHeapCreateParams&) = delete; - CppHeapCreateParams& operator=(const CppHeapCreateParams&) = delete; - std::vector> custom_spaces; WrapperDescriptor wrapper_descriptor; }; diff --git a/deps/v8/include/v8-embedder-heap.h b/deps/v8/include/v8-embedder-heap.h index 09dbae1fd8778b..01b74dbebc2479 100644 --- a/deps/v8/include/v8-embedder-heap.h +++ b/deps/v8/include/v8-embedder-heap.h @@ -205,10 +205,10 @@ class V8_EXPORT EmbedderHeapTracer { * Returns the v8::Isolate this tracer is attached too and |nullptr| if it * is not attached to any v8::Isolate. */ - v8::Isolate* isolate() const { return isolate_; } + v8::Isolate* isolate() const { return v8_isolate_; } protected: - v8::Isolate* isolate_ = nullptr; + v8::Isolate* v8_isolate_ = nullptr; friend class internal::LocalEmbedderHeapTracer; }; diff --git a/deps/v8/include/v8-exception.h b/deps/v8/include/v8-exception.h index 64126c420a6928..bc058e3fc7b874 100644 --- a/deps/v8/include/v8-exception.h +++ b/deps/v8/include/v8-exception.h @@ -197,7 +197,7 @@ class V8_EXPORT TryCatch { void ResetInternal(); - internal::Isolate* isolate_; + internal::Isolate* i_isolate_; TryCatch* next_; void* exception_; void* message_obj_; diff --git a/deps/v8/include/v8-fast-api-calls.h b/deps/v8/include/v8-fast-api-calls.h index 3403de93eca852..6ef950c10f22b0 100644 --- a/deps/v8/include/v8-fast-api-calls.h +++ b/deps/v8/include/v8-fast-api-calls.h @@ -881,31 +881,6 @@ static constexpr CTypeInfo kTypeInfoFloat64 = * to the requested destination type, is considered unsupported. The operation * returns true on success. `type_info` will be used for conversions. */ -template -V8_DEPRECATED( - "Use TryToCopyAndConvertArrayToCppBuffer()") -bool V8_EXPORT V8_WARN_UNUSED_RESULT - TryCopyAndConvertArrayToCppBuffer(Local src, T* dst, - uint32_t max_length); - -template <> -V8_DEPRECATED( - "Use TryToCopyAndConvertArrayToCppBuffer()") -inline bool V8_WARN_UNUSED_RESULT - TryCopyAndConvertArrayToCppBuffer<&kTypeInfoInt32, int32_t>( - Local src, int32_t* dst, uint32_t max_length) { - return false; -} - -template <> -V8_DEPRECATED( - "Use TryToCopyAndConvertArrayToCppBuffer()") -inline bool V8_WARN_UNUSED_RESULT - TryCopyAndConvertArrayToCppBuffer<&kTypeInfoFloat64, double>( - Local src, double* dst, uint32_t max_length) { - return false; -} - template bool V8_EXPORT V8_WARN_UNUSED_RESULT TryToCopyAndConvertArrayToCppBuffer( Local src, T* dst, uint32_t max_length); diff --git a/deps/v8/include/v8-initialization.h b/deps/v8/include/v8-initialization.h index 3d59c73f7c9caf..48c7fb6b481bc8 100644 --- a/deps/v8/include/v8-initialization.h +++ b/deps/v8/include/v8-initialization.h @@ -184,8 +184,6 @@ class V8_EXPORT V8 { * V8 was disposed. */ static void DisposePlatform(); - V8_DEPRECATED("Use DisposePlatform()") - static void ShutdownPlatform() { DisposePlatform(); } #ifdef V8_SANDBOX // @@ -206,7 +204,7 @@ class V8_EXPORT V8 { * as part of V8::Initialize, at which point this function should be removed. */ static bool InitializeSandbox(); - V8_DEPRECATE_SOON("Use InitializeSandbox()") + V8_DEPRECATED("Use InitializeSandbox()") static bool InitializeVirtualMemoryCage() { return InitializeSandbox(); } /** @@ -224,7 +222,7 @@ class V8_EXPORT V8 { * This function must only be called after initializing the sandbox. */ static VirtualAddressSpace* GetSandboxAddressSpace(); - V8_DEPRECATE_SOON("Use GetSandboxAddressSpace()") + V8_DEPRECATED("Use GetSandboxAddressSpace()") static PageAllocator* GetVirtualMemoryCagePageAllocator(); /** @@ -234,7 +232,7 @@ class V8_EXPORT V8 { * this returns zero. */ static size_t GetSandboxSizeInBytes(); - V8_DEPRECATE_SOON("Use GetSandboxSizeInBytes()") + V8_DEPRECATED("Use GetSandboxSizeInBytes()") static size_t GetVirtualMemoryCageSizeInBytes() { return GetSandboxSizeInBytes(); } @@ -248,7 +246,7 @@ class V8_EXPORT V8 { * insecure sandbox is being used, in which case it will return false. */ static bool IsSandboxConfiguredSecurely(); - V8_DEPRECATE_SOON("Use IsSandboxConfiguredSecurely()") + V8_DEPRECATED("Use IsSandboxConfiguredSecurely()") static bool IsUsingSecureVirtualMemoryCage() { return IsSandboxConfiguredSecurely(); } @@ -273,7 +271,7 @@ class V8_EXPORT V8 { * exceptions in V8-generated code. */ static void SetUnhandledExceptionCallback( - UnhandledExceptionCallback unhandled_exception_callback); + UnhandledExceptionCallback callback); #endif /** @@ -281,8 +279,7 @@ class V8_EXPORT V8 { * v8 has encountered a fatal failure to allocate memory and is about to * terminate. */ - - static void SetFatalMemoryErrorCallback(OOMErrorCallback oom_error_callback); + static void SetFatalMemoryErrorCallback(LegacyOOMErrorCallback callback); /** * Get statistics about the shared memory usage. diff --git a/deps/v8/include/v8-inspector.h b/deps/v8/include/v8-inspector.h index ce5430bd039870..1fb1c2c61a574c 100644 --- a/deps/v8/include/v8-inspector.h +++ b/deps/v8/include/v8-inspector.h @@ -207,10 +207,10 @@ class V8_EXPORT V8InspectorSession { class V8_EXPORT WebDriverValue { public: - explicit WebDriverValue(StringView type, v8::MaybeLocal value = {}) - : type(type), value(value) {} - - StringView type; + explicit WebDriverValue(std::unique_ptr type, + v8::MaybeLocal value = {}) + : type(std::move(type)), value(value) {} + std::unique_ptr type; v8::MaybeLocal value; }; @@ -361,9 +361,18 @@ class V8_EXPORT V8Inspector { virtual void sendNotification(std::unique_ptr message) = 0; virtual void flushProtocolNotifications() = 0; }; + V8_DEPRECATED("Use version with client_is_trusted argument") virtual std::unique_ptr connect(int contextGroupId, - Channel*, - StringView state) = 0; + Channel* channel, + StringView state) { + return connect(contextGroupId, channel, state, kFullyTrusted); + } + enum ClientTrustLevel { kUntrusted, kFullyTrusted }; + virtual std::unique_ptr connect( + int contextGroupId, Channel*, StringView state, + ClientTrustLevel client_trust_level) { + return nullptr; + } // API methods. virtual std::unique_ptr createStackTrace( diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index e6e9cc5f9f5bbc..71784915de8f37 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -187,8 +187,15 @@ using ExternalPointer_t = Address; #ifdef V8_SANDBOX_IS_AVAILABLE -// Size of the sandbox, excluding the guard regions surrounding it. +#ifdef V8_OS_ANDROID +// On Android, most 64-bit devices seem to be configured with only 39 bits of +// virtual address space for userspace. As such, limit the sandbox to 128GB (a +// quarter of the total available address space). +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 constexpr size_t kSandboxSize = 1ULL << kSandboxSizeLog2; // Required alignment of the sandbox. For simplicity, we require the @@ -365,8 +372,8 @@ class Internals { static const uint32_t kNumIsolateDataSlots = 4; static const int kStackGuardSize = 7 * kApiSystemPointerSize; - static const int kBuiltinTier0EntryTableSize = 10 * kApiSystemPointerSize; - static const int kBuiltinTier0TableSize = 10 * kApiSystemPointerSize; + static const int kBuiltinTier0EntryTableSize = 9 * kApiSystemPointerSize; + static const int kBuiltinTier0TableSize = 9 * kApiSystemPointerSize; // IsolateData layout guarantees. static const int kIsolateCageBaseOffset = 0; @@ -406,7 +413,6 @@ class Internals { static const int kNodeFlagsOffset = 1 * kApiSystemPointerSize + 3; static const int kNodeStateMask = 0x7; static const int kNodeStateIsWeakValue = 2; - static const int kNodeStateIsPendingValue = 3; static const int kFirstNonstringType = 0x80; static const int kOddballType = 0x83; diff --git a/deps/v8/include/v8-isolate.h b/deps/v8/include/v8-isolate.h index 2849d7cae1e9e8..215d80a920227c 100644 --- a/deps/v8/include/v8-isolate.h +++ b/deps/v8/include/v8-isolate.h @@ -286,6 +286,10 @@ class V8_EXPORT Isolate { * Callbacks to invoke in case of fatal or OOM errors. */ FatalErrorCallback fatal_error_callback = nullptr; + LegacyOOMErrorCallback legacy_oom_error_callback = nullptr; + V8_DEPRECATED( + "Use legacy_oom_error_callback; OOMErrorCallback will be changed soon " + "(https://crbug.com/1323177)") OOMErrorCallback oom_error_callback = nullptr; /** @@ -301,16 +305,18 @@ class V8_EXPORT Isolate { */ class V8_EXPORT V8_NODISCARD Scope { public: - explicit Scope(Isolate* isolate) : isolate_(isolate) { isolate->Enter(); } + explicit Scope(Isolate* isolate) : v8_isolate_(isolate) { + v8_isolate_->Enter(); + } - ~Scope() { isolate_->Exit(); } + ~Scope() { v8_isolate_->Exit(); } // Prevent copying of Scope objects. Scope(const Scope&) = delete; Scope& operator=(const Scope&) = delete; private: - Isolate* const isolate_; + Isolate* const v8_isolate_; }; /** @@ -331,7 +337,7 @@ class V8_EXPORT Isolate { private: OnFailure on_failure_; - Isolate* isolate_; + v8::Isolate* v8_isolate_; bool was_execution_allowed_assert_; bool was_execution_allowed_throws_; @@ -353,7 +359,7 @@ class V8_EXPORT Isolate { const AllowJavascriptExecutionScope&) = delete; private: - Isolate* isolate_; + Isolate* v8_isolate_; bool was_execution_allowed_assert_; bool was_execution_allowed_throws_; bool was_execution_allowed_dump_; @@ -376,7 +382,7 @@ class V8_EXPORT Isolate { const SuppressMicrotaskExecutionScope&) = delete; private: - internal::Isolate* const isolate_; + internal::Isolate* const i_isolate_; internal::MicrotaskQueue* const microtask_queue_; internal::Address previous_stack_height_; @@ -389,7 +395,7 @@ class V8_EXPORT Isolate { */ class V8_EXPORT V8_NODISCARD SafeForTerminationScope { public: - explicit SafeForTerminationScope(v8::Isolate* isolate); + explicit SafeForTerminationScope(v8::Isolate* v8_isolate); ~SafeForTerminationScope(); // Prevent copying of Scope objects. @@ -397,7 +403,7 @@ class V8_EXPORT Isolate { SafeForTerminationScope& operator=(const SafeForTerminationScope&) = delete; private: - internal::Isolate* isolate_; + internal::Isolate* i_isolate_; bool prev_value_; }; @@ -636,9 +642,6 @@ class V8_EXPORT Isolate { * This specifies the callback called by the upcoming dynamic * import() language feature to load modules. */ - V8_DEPRECATED("Use HostImportModuleDynamicallyCallback") - void SetHostImportModuleDynamicallyCallback( - HostImportModuleDynamicallyWithImportAssertionsCallback callback); void SetHostImportModuleDynamicallyCallback( HostImportModuleDynamicallyCallback callback); @@ -843,6 +846,9 @@ class V8_EXPORT Isolate { * Returns the number of phantom handles without callbacks that were reset * by the garbage collector since the last call to this function. */ + V8_DEPRECATE_SOON( + "Information cannot be relied on anymore as internal representation may " + "change.") size_t NumberOfPhantomHandleResetsSinceLastCall(); /** @@ -1473,7 +1479,7 @@ class V8_EXPORT Isolate { void SetFatalErrorHandler(FatalErrorCallback that); /** Set the callback to invoke in case of OOM errors. */ - void SetOOMErrorHandler(OOMErrorCallback that); + void SetOOMErrorHandler(LegacyOOMErrorCallback that); /** * Add a callback to invoke in case the heap size is close to the heap limit. @@ -1602,6 +1608,9 @@ class V8_EXPORT Isolate { * Iterates through all the persistent handles in the current isolate's heap * that have class_ids. */ + V8_DEPRECATE_SOON( + "Information cannot be relied on anymore as internal representation may " + "change.") void VisitHandlesWithClassIds(PersistentHandleVisitor* visitor); /** @@ -1609,6 +1618,9 @@ class V8_EXPORT Isolate { * that have class_ids and are weak to be marked as inactive if there is no * pending activity for the handle. */ + V8_DEPRECATE_SOON( + "Information cannot be relied on anymore as internal representation may " + "change.") void VisitWeakHandles(PersistentHandleVisitor* visitor); /** diff --git a/deps/v8/include/v8-local-handle.h b/deps/v8/include/v8-local-handle.h index 5ae974081f8e32..cbf87f949d09fa 100644 --- a/deps/v8/include/v8-local-handle.h +++ b/deps/v8/include/v8-local-handle.h @@ -86,7 +86,7 @@ class V8_EXPORT V8_NODISCARD HandleScope { static int NumberOfHandles(Isolate* isolate); V8_INLINE Isolate* GetIsolate() const { - return reinterpret_cast(isolate_); + return reinterpret_cast(i_isolate_); } HandleScope(const HandleScope&) = delete; @@ -97,7 +97,7 @@ class V8_EXPORT V8_NODISCARD HandleScope { void Initialize(Isolate* isolate); - static internal::Address* CreateHandle(internal::Isolate* isolate, + static internal::Address* CreateHandle(internal::Isolate* i_isolate, internal::Address value); private: @@ -108,7 +108,7 @@ class V8_EXPORT V8_NODISCARD HandleScope { void operator delete(void*, size_t); void operator delete[](void*, size_t); - internal::Isolate* isolate_; + internal::Isolate* i_isolate_; internal::Address* prev_next_; internal::Address* prev_limit_; @@ -354,7 +354,7 @@ class MaybeLocal { /** * Converts this MaybeLocal<> to a Local<>. If this MaybeLocal<> is empty, - * |false| is returned and |out| is left untouched. + * |false| is returned and |out| is assigned with nullptr. */ template V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local* out) const { @@ -445,7 +445,7 @@ class V8_EXPORT V8_NODISCARD SealHandleScope { void operator delete(void*, size_t); void operator delete[](void*, size_t); - internal::Isolate* const isolate_; + internal::Isolate* const i_isolate_; internal::Address* prev_limit_; int prev_sealed_level_; }; diff --git a/deps/v8/include/v8-locker.h b/deps/v8/include/v8-locker.h index 7ca5bf6e421e41..17ea88cb814a98 100644 --- a/deps/v8/include/v8-locker.h +++ b/deps/v8/include/v8-locker.h @@ -127,10 +127,8 @@ class V8_EXPORT Locker { * The current implementation is quite confusing and leads to unexpected * results if anybody uses v8::Locker in the current process. */ - V8_DEPRECATE_SOON("This method will be removed.") + V8_DEPRECATED("This method will be removed.") static bool WasEverUsed(); - V8_DEPRECATED("Use WasEverUsed instead") - static bool IsActive(); // Disallow copying and assigning. Locker(const Locker&) = delete; diff --git a/deps/v8/include/v8-maybe.h b/deps/v8/include/v8-maybe.h index 0532a510059d02..8d3aeabe02af45 100644 --- a/deps/v8/include/v8-maybe.h +++ b/deps/v8/include/v8-maybe.h @@ -5,6 +5,9 @@ #ifndef INCLUDE_V8_MAYBE_H_ #define INCLUDE_V8_MAYBE_H_ +#include +#include + #include "v8-internal.h" // NOLINT(build/include_directory) #include "v8config.h" // NOLINT(build/include_directory) @@ -57,11 +60,20 @@ class Maybe { * Converts this Maybe<> to a value of type T. If this Maybe<> is * nothing (empty), V8 will crash the process. */ - V8_INLINE T FromJust() const { + V8_INLINE T FromJust() const& { if (V8_UNLIKELY(!IsJust())) api_internal::FromJustIsNothing(); return value_; } + /** + * Converts this Maybe<> to a value of type T. If this Maybe<> is + * nothing (empty), V8 will crash the process. + */ + V8_INLINE T FromJust() && { + if (V8_UNLIKELY(!IsJust())) api_internal::FromJustIsNothing(); + return std::move(value_); + } + /** * Converts this Maybe<> to a value of type T, using a default value if this * Maybe<> is nothing (empty). @@ -82,6 +94,7 @@ class Maybe { private: Maybe() : has_value_(false) {} explicit Maybe(const T& t) : has_value_(true), value_(t) {} + explicit Maybe(T&& t) : has_value_(true), value_(std::move(t)) {} bool has_value_; T value_; @@ -90,6 +103,8 @@ class Maybe { friend Maybe Nothing(); template friend Maybe Just(const U& u); + template >*> + friend Maybe Just(U&& u); }; template @@ -102,6 +117,14 @@ inline Maybe Just(const T& t) { return Maybe(t); } +// Don't use forwarding references here but instead use two overloads. +// Forwarding references only work when type deduction takes place, which is not +// the case for callsites such as Just(t). +template >* = nullptr> +inline Maybe Just(T&& t) { + return Maybe(std::move(t)); +} + // A template specialization of Maybe for the case of T = void. template <> class Maybe { diff --git a/deps/v8/include/v8-message.h b/deps/v8/include/v8-message.h index a13276412a8152..15325e423428e2 100644 --- a/deps/v8/include/v8-message.h +++ b/deps/v8/include/v8-message.h @@ -70,7 +70,7 @@ class V8_EXPORT ScriptOrigin { bool resource_is_opaque = false, bool is_wasm = false, bool is_module = false, Local host_defined_options = Local()) - : isolate_(isolate), + : v8_isolate_(isolate), resource_name_(resource_name), resource_line_offset_(resource_line_offset), resource_column_offset_(resource_column_offset), @@ -87,14 +87,14 @@ class V8_EXPORT ScriptOrigin { V8_INLINE int ColumnOffset() const; V8_INLINE int ScriptId() const; V8_INLINE Local SourceMapUrl() const; - V8_DEPRECATE_SOON("Use GetHostDefinedOptions") + V8_DEPRECATED("Use GetHostDefinedOptions") Local HostDefinedOptions() const; V8_INLINE Local GetHostDefinedOptions() const; V8_INLINE ScriptOriginOptions Options() const { return options_; } private: void VerifyHostDefinedOptions() const; - Isolate* isolate_; + Isolate* v8_isolate_; Local resource_name_; int resource_line_offset_; int resource_column_offset_; diff --git a/deps/v8/include/v8-microtask-queue.h b/deps/v8/include/v8-microtask-queue.h index af9caa54a8ff51..f1624b903b13c1 100644 --- a/deps/v8/include/v8-microtask-queue.h +++ b/deps/v8/include/v8-microtask-queue.h @@ -142,7 +142,7 @@ class V8_EXPORT V8_NODISCARD MicrotasksScope { MicrotasksScope& operator=(const MicrotasksScope&) = delete; private: - internal::Isolate* const isolate_; + internal::Isolate* const i_isolate_; internal::MicrotaskQueue* const microtask_queue_; bool run_; }; diff --git a/deps/v8/include/v8-object.h b/deps/v8/include/v8-object.h index bad299fc42948d..cc3ddcda2f3803 100644 --- a/deps/v8/include/v8-object.h +++ b/deps/v8/include/v8-object.h @@ -594,8 +594,6 @@ class V8_EXPORT Object : public Value { /** * Returns the context in which the object was created. */ - V8_DEPRECATED("Use MaybeLocal GetCreationContext()") - Local CreationContext(); MaybeLocal GetCreationContext(); /** @@ -604,10 +602,6 @@ class V8_EXPORT Object : public Value { Local GetCreationContextChecked(); /** Same as above, but works for Persistents */ - V8_DEPRECATED( - "Use MaybeLocal GetCreationContext(const " - "PersistentBase& object)") - static Local CreationContext(const PersistentBase& object); V8_INLINE static MaybeLocal GetCreationContext( const PersistentBase& object) { return object.val_->GetCreationContext(); diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 91b3fd9cc3f9a3..efe5402969bde2 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -429,6 +429,17 @@ class PageAllocator { virtual bool SetPermissions(void* address, size_t length, Permission permissions) = 0; + /** + * Recommits discarded pages in the given range with given permissions. + * Discarded pages must be recommitted with their original permissions + * before they are used again. + */ + virtual bool RecommitPages(void* address, size_t length, + Permission permissions) { + // TODO(v8:12797): make it pure once it's implemented on Chromium side. + return false; + } + /** * Frees memory in the given [address, address + size) range. address and size * should be operating system page-aligned. The next write to this @@ -698,6 +709,10 @@ class VirtualAddressSpace { /** * Sets permissions of all allocated pages in the given range. * + * This operation can fail due to OOM, in which case false is returned. If + * the operation fails for a reason other than OOM, this function will + * terminate the process as this implies a bug in the client. + * * \param address The start address of the range. Must be aligned to * page_size(). * @@ -706,7 +721,7 @@ class VirtualAddressSpace { * * \param permissions The new permissions for the range. * - * \returns true on success, false otherwise. + * \returns true on success, false on OOM. */ virtual V8_WARN_UNUSED_RESULT bool SetPagePermissions( Address address, size_t size, PagePermissions permissions) = 0; @@ -820,6 +835,24 @@ class VirtualAddressSpace { // takes a command enum as parameter. // + /** + * Recommits discarded pages in the given range with given permissions. + * Discarded pages must be recommitted with their original permissions + * before they are used again. + * + * \param address The start address of the range. Must be aligned to + * page_size(). + * + * \param size The size in bytes of the range. Must be a multiple + * of page_size(). + * + * \param permissions The permissions for the range that the pages must have. + * + * \returns true on success, false otherwise. + */ + virtual V8_WARN_UNUSED_RESULT bool RecommitPages( + Address address, size_t size, PagePermissions permissions) = 0; + /** * Frees memory in the given [address, address + size) range. address and * size should be aligned to the page_size(). The next write to this memory diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 268104073231c6..77e42606d8e3db 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -542,7 +542,9 @@ class V8_EXPORT HeapGraphNode { kConsString = 10, // Concatenated string. A pair of pointers to strings. kSlicedString = 11, // Sliced string. A fragment of another string. kSymbol = 12, // A Symbol (ES6). - kBigInt = 13 // BigInt. + kBigInt = 13, // BigInt. + kObjectShape = 14, // Internal data used for tracking the shapes (or + // "hidden classes") of JS objects. }; /** Returns node type (see HeapGraphNode::Type). */ @@ -975,14 +977,71 @@ class V8_EXPORT HeapProfiler { virtual ~ObjectNameResolver() = default; }; + enum class HeapSnapshotMode { + /** + * Heap snapshot for regular developers. + */ + kRegular, + /** + * Heap snapshot is exposing internals that may be useful for experts. + */ + kExposeInternals, + }; + + enum class NumericsMode { + /** + * Numeric values are hidden as they are values of the corresponding + * objects. + */ + kHideNumericValues, + /** + * Numeric values are exposed in artificial fields. + */ + kExposeNumericValues + }; + + struct HeapSnapshotOptions final { + // Manually define default constructor here to be able to use it in + // `TakeSnapshot()` below. + // NOLINTNEXTLINE + HeapSnapshotOptions() {} + + /** + * The control used to report intermediate progress to. + */ + ActivityControl* control = nullptr; + /** + * The resolver used by the snapshot generator to get names for V8 objects. + */ + ObjectNameResolver* global_object_name_resolver = nullptr; + /** + * Mode for taking the snapshot, see `HeapSnapshotMode`. + */ + HeapSnapshotMode snapshot_mode = HeapSnapshotMode::kRegular; + /** + * Mode for dealing with numeric values, see `NumericsMode`. + */ + NumericsMode numerics_mode = NumericsMode::kHideNumericValues; + }; + /** - * Takes a heap snapshot and returns it. + * Takes a heap snapshot. + * + * \returns the snapshot. + */ + const HeapSnapshot* TakeHeapSnapshot( + const HeapSnapshotOptions& options = HeapSnapshotOptions()); + + /** + * Takes a heap snapshot. See `HeapSnapshotOptions` for details on the + * parameters. + * + * \returns the snapshot. */ const HeapSnapshot* TakeHeapSnapshot( - ActivityControl* control = nullptr, + ActivityControl* control, ObjectNameResolver* global_object_name_resolver = nullptr, - bool treat_global_objects_as_roots = true, - bool capture_numeric_value = false); + bool hide_internals = true, bool capture_numeric_value = false); /** * Starts tracking of heap objects population statistics. After calling diff --git a/deps/v8/include/v8-script.h b/deps/v8/include/v8-script.h index 5644a3bb70c6b1..b51dbc3dfd3880 100644 --- a/deps/v8/include/v8-script.h +++ b/deps/v8/include/v8-script.h @@ -78,7 +78,13 @@ class V8_EXPORT UnboundScript { * Returns zero based line number of the code_pos location in the script. * -1 will be returned if no information available. */ - int GetLineNumber(int code_pos); + int GetLineNumber(int code_pos = 0); + + /** + * Returns zero based column number of the code_pos location in the script. + * -1 will be returned if no information available. + */ + int GetColumnNumber(int code_pos = 0); static const int kNoScriptId = 0; }; @@ -650,6 +656,7 @@ class V8_EXPORT ScriptCompiler { * It is possible to specify multiple context extensions (obj in the above * example). */ + V8_DEPRECATED("Use CompileFunction") static V8_WARN_UNUSED_RESULT MaybeLocal CompileFunctionInContext( Local context, Source* source, size_t arguments_count, Local arguments[], size_t context_extension_count, diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 37abe105b74e3c..b7bd6d531a4d81 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -9,9 +9,9 @@ // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. #define V8_MAJOR_VERSION 10 -#define V8_MINOR_VERSION 2 -#define V8_BUILD_NUMBER 154 -#define V8_PATCH_LEVEL 4 +#define V8_MINOR_VERSION 3 +#define V8_BUILD_NUMBER 174 +#define V8_PATCH_LEVEL 8 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/include/v8-wasm.h b/deps/v8/include/v8-wasm.h index 59b2a69b1244ca..fc074d17e0a20e 100644 --- a/deps/v8/include/v8-wasm.h +++ b/deps/v8/include/v8-wasm.h @@ -235,7 +235,7 @@ class V8_EXPORT WasmModuleObjectBuilderStreaming final { const WasmModuleObjectBuilderStreaming&) = delete; WasmModuleObjectBuilderStreaming& operator=( WasmModuleObjectBuilderStreaming&&) = default; - Isolate* isolate_ = nullptr; + Isolate* v8_isolate_ = nullptr; #if V8_CC_MSVC /** diff --git a/deps/v8/include/v8-weak-callback-info.h b/deps/v8/include/v8-weak-callback-info.h index 6d0fb3ac1d40f8..df4dcb8eb9644c 100644 --- a/deps/v8/include/v8-weak-callback-info.h +++ b/deps/v8/include/v8-weak-callback-info.h @@ -63,13 +63,6 @@ enum class WeakCallbackType { * Passes the first two internal fields of the object back to the callback. */ kInternalFields, - /** - * Passes a user-defined void* parameter back to the callback. Will do so - * before the object is actually reclaimed, allowing it to be resurrected. In - * this case it is not possible to set a second-pass callback. - */ - kFinalizer V8_ENUM_DEPRECATED("Resurrecting finalizers are deprecated " - "and will not be supported going forward.") }; template diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index 769582188a11d5..2082517c4c9340 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -67,7 +67,6 @@ 'V8 Linux64 - builder (reclient)': 'release_x64_reclient', 'V8 Linux64 - builder (reclient compare)': 'release_x64_reclient', 'V8 Linux64 - debug builder': 'debug_x64', - 'V8 Linux64 - dict tracking - debug - builder': 'debug_x64_dict_tracking_trybot', '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', @@ -173,6 +172,7 @@ 'V8 Android Arm64 - builder - perf': 'official_android_arm64', 'V8 Linux - builder - perf': 'official_x86', 'V8 Linux64 - builder - perf': 'official_x64', + 'V8 Mac Arm64 - builder - perf': 'official_mac_arm64', }, 'client.v8.ports': { # Arm. @@ -475,6 +475,8 @@ 'official_android_arm64': [ 'release_bot', 'arm64', 'android', 'minimal_symbols', 'android_strip_outputs', 'official', 'disable_pgo'], + 'official_mac_arm64': [ + 'release_bot', 'arm64', 'official', 'disable_pgo'], # Release configs for x64. 'release_x64': [ diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl index 11db9b11f714a3..eba1b8ca05aaa9 100644 --- a/deps/v8/infra/testing/builders.pyl +++ b/deps/v8/infra/testing/builders.pyl @@ -156,10 +156,10 @@ {'name': 'mozilla', 'variant': 'extra'}, {'name': 'optimize_for_size'}, {'name': 'test262', 'shards': 4}, - {'name': 'test262', 'variant': 'extra', 'shards': 3}, - {'name': 'v8testing', 'shards': 2}, - {'name': 'v8testing', 'suffix': 'isolates', 'test_args': ['--isolates'], 'shards': 2}, - {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + {'name': 'test262', 'variant': 'extra', 'shards': 6}, + {'name': 'v8testing', 'shards': 4}, + {'name': 'v8testing', 'suffix': 'isolates', 'test_args': ['--isolates'], 'shards': 4}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 4}, ], }, 'v8_linux_optional_rel_ng_triggered': { @@ -314,9 +314,9 @@ 'os': 'Ubuntu-18.04', }, 'tests': [ - {'name': 'test262', 'shards': 7}, - {'name': 'v8testing', 'shards': 3}, - {'name': 'v8testing', 'variant': 'extra', 'shards': 3}, + {'name': 'test262', 'shards': 12}, + {'name': 'v8testing', 'shards': 5}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 5}, {'name': 'v8testing', 'variant': 'slow_path'}, ], }, @@ -408,6 +408,8 @@ {'name': 'webkit', 'variant': 'stress_sampling'}, # Stress snapshot. {'name': 'mjsunit', 'variant': 'stress_snapshot'}, + # Maglev. + {'name': 'mjsunit', 'variant': 'maglev'}, # Experimental regexp engine. {'name': 'mjsunit', 'variant': 'experimental_regexp'}, # Wasm write protect code space. @@ -1231,15 +1233,6 @@ }, ], }, - 'V8 Linux64 - dict tracking - debug': { - 'swarming_dimensions': { - 'cpu': 'x86-64-avx2', - 'os': 'Ubuntu-18.04', - }, - 'tests': [ - {'name': 'v8testing', 'shards': 3}, - ], - }, 'V8 Linux64 - disable runtime call stats': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -1260,6 +1253,8 @@ {'name': 'webkit', 'variant': 'stress_sampling'}, # Stress snapshot. {'name': 'mjsunit', 'variant': 'stress_snapshot'}, + # Maglev. + {'name': 'mjsunit', 'variant': 'maglev'}, # Experimental regexp engine. {'name': 'mjsunit', 'variant': 'experimental_regexp'}, # Wasm write protect code space. @@ -1322,6 +1317,8 @@ {'name': 'webkit', 'variant': 'stress_sampling'}, # Stress snapshot. {'name': 'mjsunit', 'variant': 'stress_snapshot'}, + # Maglev. + {'name': 'mjsunit', 'variant': 'maglev'}, # Experimental regexp engine. {'name': 'mjsunit', 'variant': 'experimental_regexp'}, # Wasm write protect code space. diff --git a/deps/v8/src/api/api-inl.h b/deps/v8/src/api/api-inl.h index 975976ae096ae2..9a507fc1355543 100644 --- a/deps/v8/src/api/api-inl.h +++ b/deps/v8/src/api/api-inl.h @@ -233,14 +233,6 @@ class V8_NODISCARD InternalEscapableScope : public EscapableHandleScope { : EscapableHandleScope(reinterpret_cast(isolate)) {} }; -inline bool IsExecutionTerminatingCheck(i::Isolate* isolate) { - if (isolate->has_scheduled_exception()) { - return isolate->scheduled_exception() == - i::ReadOnlyRoots(isolate).termination_exception(); - } - return false; -} - template void CopySmiElementsToTypedBuffer(T* dst, uint32_t length, i::FixedArray elements) { diff --git a/deps/v8/src/api/api-macros-undef.h b/deps/v8/src/api/api-macros-undef.h index d3eea83a5f0c21..ab1116d9cee7b7 100644 --- a/deps/v8/src/api/api-macros-undef.h +++ b/deps/v8/src/api/api-macros-undef.h @@ -5,8 +5,8 @@ // PRESUBMIT_INTENTIONALLY_MISSING_INCLUDE_GUARD #undef LOG_API -#undef ENTER_V8_DO_NOT_USE -#undef ENTER_V8_HELPER_DO_NOT_USE +#undef ENTER_V8_BASIC +#undef ENTER_V8_HELPER_INTERNAL #undef PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE #undef PREPARE_FOR_EXECUTION_WITH_CONTEXT #undef PREPARE_FOR_EXECUTION diff --git a/deps/v8/src/api/api-macros.h b/deps/v8/src/api/api-macros.h index 9fbe9a973903ae..149dd0555a69be 100644 --- a/deps/v8/src/api/api-macros.h +++ b/deps/v8/src/api/api-macros.h @@ -35,98 +35,117 @@ * TODO(verwaest): Remove calls form API methods to DO_NOT_USE macros. */ -#define API_RCS_SCOPE(isolate, class_name, function_name) \ - RCS_SCOPE(isolate, \ +#define API_RCS_SCOPE(i_isolate, class_name, function_name) \ + RCS_SCOPE(i_isolate, \ i::RuntimeCallCounterId::kAPI_##class_name##_##function_name); -#define ENTER_V8_DO_NOT_USE(isolate) i::VMState __state__((isolate)) - -#define ENTER_V8_HELPER_DO_NOT_USE(isolate, context, class_name, \ - function_name, bailout_value, \ - HandleScopeClass, do_callback) \ - if (IsExecutionTerminatingCheck(isolate)) { \ - return bailout_value; \ - } \ - HandleScopeClass handle_scope(isolate); \ - CallDepthScope call_depth_scope(isolate, context); \ - API_RCS_SCOPE(isolate, class_name, function_name); \ - i::VMState __state__((isolate)); \ +#define ENTER_V8_BASIC(i_isolate) \ + /* Embedders should never enter V8 after terminating it */ \ + DCHECK(!i_isolate->is_execution_terminating()); \ + i::VMState __state__((i_isolate)) + +#define ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, \ + function_name, bailout_value, \ + HandleScopeClass, do_callback) \ + if (i_isolate->is_execution_terminating()) { \ + return bailout_value; \ + } \ + HandleScopeClass handle_scope(i_isolate); \ + CallDepthScope call_depth_scope(i_isolate, context); \ + API_RCS_SCOPE(i_isolate, class_name, function_name); \ + i::VMState __state__((i_isolate)); \ bool has_pending_exception = false -#define PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE(isolate, T) \ - if (IsExecutionTerminatingCheck(isolate)) { \ - return MaybeLocal(); \ - } \ - InternalEscapableScope handle_scope(isolate); \ - CallDepthScope call_depth_scope(isolate, v8::Local()); \ - i::VMState __state__((isolate)); \ +#define PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE(i_isolate, T) \ + if (i_isolate->is_execution_terminating()) { \ + return MaybeLocal(); \ + } \ + InternalEscapableScope handle_scope(i_isolate); \ + CallDepthScope call_depth_scope(i_isolate, v8::Local()); \ + i::VMState __state__((i_isolate)); \ bool has_pending_exception = false #define PREPARE_FOR_EXECUTION_WITH_CONTEXT(context, class_name, function_name, \ bailout_value, HandleScopeClass, \ do_callback) \ - auto isolate = context.IsEmpty() \ - ? i::Isolate::Current() \ - : reinterpret_cast(context->GetIsolate()); \ - ENTER_V8_HELPER_DO_NOT_USE(isolate, context, class_name, function_name, \ - bailout_value, HandleScopeClass, do_callback); + auto i_isolate = context.IsEmpty() \ + ? i::Isolate::Current() \ + : reinterpret_cast(context->GetIsolate()); \ + ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, function_name, \ + bailout_value, HandleScopeClass, do_callback); #define PREPARE_FOR_EXECUTION(context, class_name, function_name, T) \ PREPARE_FOR_EXECUTION_WITH_CONTEXT(context, class_name, function_name, \ MaybeLocal(), InternalEscapableScope, \ false) -#define ENTER_V8(isolate, context, class_name, function_name, bailout_value, \ - HandleScopeClass) \ - ENTER_V8_HELPER_DO_NOT_USE(isolate, context, class_name, function_name, \ - bailout_value, HandleScopeClass, true) +#define ENTER_V8(i_isolate, context, class_name, function_name, bailout_value, \ + HandleScopeClass) \ + ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, function_name, \ + bailout_value, HandleScopeClass, true) #ifdef DEBUG -#define ENTER_V8_NO_SCRIPT(isolate, context, class_name, function_name, \ +#define ENTER_V8_NO_SCRIPT(i_isolate, context, class_name, function_name, \ bailout_value, HandleScopeClass) \ - ENTER_V8_HELPER_DO_NOT_USE(isolate, context, class_name, function_name, \ - bailout_value, HandleScopeClass, false); \ - i::DisallowJavascriptExecutionDebugOnly __no_script__((isolate)) + ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, function_name, \ + bailout_value, HandleScopeClass, false); \ + i::DisallowJavascriptExecutionDebugOnly __no_script__((i_isolate)) + +#define DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate) \ + i::DisallowJavascriptExecutionDebugOnly __no_script__((i_isolate)); \ + i::DisallowExceptions __no_exceptions__((i_isolate)) // Lightweight version for APIs that don't require an active context. -#define ASSERT_NO_SCRIPT_NO_EXCEPTION(isolate) \ - i::DisallowJavascriptExecutionDebugOnly __no_script__((isolate)); \ - i::DisallowExceptions __no_exceptions__((isolate)) - -#define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate) \ - i::VMState __state__((isolate)); \ - ASSERT_NO_SCRIPT_NO_EXCEPTION(isolate) - -#define ENTER_V8_FOR_NEW_CONTEXT(isolate) \ - i::VMState __state__((isolate)); \ - i::DisallowExceptions __no_exceptions__((isolate)) -#else -#define ENTER_V8_NO_SCRIPT(isolate, context, class_name, function_name, \ +#define DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate) \ + /* Embedders should never enter V8 after terminating it */ \ + DCHECK(!i_isolate->is_execution_terminating()); \ + DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate) + +#define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate) \ + i::VMState __state__((i_isolate)); \ + DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate) + +// Used instead of ENTER_V8_NO_SCRIPT_NO_EXCEPTION where the V8 Api is entered +// during termination sequences. +#define ENTER_V8_MAYBE_TEARDOWN(i_isolate) \ + i::VMState __state__((i_isolate)); \ + DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate) + +#define ENTER_V8_FOR_NEW_CONTEXT(i_isolate) \ + DCHECK(!(i_isolate)->is_execution_terminating()); \ + i::VMState __state__((i_isolate)); \ + i::DisallowExceptions __no_exceptions__((i_isolate)) +#else // DEBUG +#define ENTER_V8_NO_SCRIPT(i_isolate, context, class_name, function_name, \ bailout_value, HandleScopeClass) \ - ENTER_V8_HELPER_DO_NOT_USE(isolate, context, class_name, function_name, \ - bailout_value, HandleScopeClass, false) + ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, function_name, \ + bailout_value, HandleScopeClass, false) + +#define DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate) +#define DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate) -#define ASSERT_NO_SCRIPT_NO_EXCEPTION(isolate) +#define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate) \ + i::VMState __state__((i_isolate)); -#define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate) \ - i::VMState __state__((isolate)); +#define ENTER_V8_MAYBE_TEARDOWN(i_isolate) \ + i::VMState __state__((i_isolate)); -#define ENTER_V8_FOR_NEW_CONTEXT(isolate) \ - i::VMState __state__((isolate)); +#define ENTER_V8_FOR_NEW_CONTEXT(i_isolate) \ + i::VMState __state__((i_isolate)); #endif // DEBUG -#define EXCEPTION_BAILOUT_CHECK_SCOPED_DO_NOT_USE(isolate, value) \ - do { \ - if (has_pending_exception) { \ - call_depth_scope.Escape(); \ - return value; \ - } \ +#define EXCEPTION_BAILOUT_CHECK_SCOPED_DO_NOT_USE(i_isolate, value) \ + do { \ + if (has_pending_exception) { \ + call_depth_scope.Escape(); \ + return value; \ + } \ } while (false) #define RETURN_ON_FAILED_EXECUTION(T) \ - EXCEPTION_BAILOUT_CHECK_SCOPED_DO_NOT_USE(isolate, MaybeLocal()) + EXCEPTION_BAILOUT_CHECK_SCOPED_DO_NOT_USE(i_isolate, MaybeLocal()) #define RETURN_ON_FAILED_EXECUTION_PRIMITIVE(T) \ - EXCEPTION_BAILOUT_CHECK_SCOPED_DO_NOT_USE(isolate, Nothing()) + EXCEPTION_BAILOUT_CHECK_SCOPED_DO_NOT_USE(i_isolate, Nothing()) #define RETURN_ESCAPED(value) return handle_scope.Escape(value); diff --git a/deps/v8/src/api/api.cc b/deps/v8/src/api/api.cc index a0ab21d71a378a..8423f288efa3f0 100644 --- a/deps/v8/src/api/api.cc +++ b/deps/v8/src/api/api.cc @@ -140,9 +140,13 @@ #if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD #include + +#if V8_ENABLE_WEBASSEMBLY #include "include/v8-wasm-trap-handler-posix.h" #include "src/trap-handler/handler-inside-posix.h" -#endif +#endif // V8_ENABLE_WEBASSEMBLY + +#endif // V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD #if V8_OS_WIN #include @@ -168,21 +172,23 @@ namespace v8 { -static OOMErrorCallback g_oom_error_callback = nullptr; +// TODO(chromium:1323177): Add a separate global for OOMErrorCallback once the +// types diverge. +static LegacyOOMErrorCallback g_oom_error_callback = nullptr; -static ScriptOrigin GetScriptOriginForScript(i::Isolate* isolate, +static ScriptOrigin GetScriptOriginForScript(i::Isolate* i_isolate, i::Handle script) { - i::Handle scriptName(script->GetNameOrSourceURL(), isolate); - i::Handle source_map_url(script->source_mapping_url(), isolate); + i::Handle scriptName(script->GetNameOrSourceURL(), i_isolate); + i::Handle source_map_url(script->source_mapping_url(), i_isolate); i::Handle host_defined_options(script->host_defined_options(), - isolate); + i_isolate); ScriptOriginOptions options(script->origin_options()); bool is_wasm = false; #if V8_ENABLE_WEBASSEMBLY is_wasm = script->type() == i::Script::TYPE_WASM; #endif // V8_ENABLE_WEBASSEMBLY v8::ScriptOrigin origin( - reinterpret_cast(isolate), Utils::ToLocal(scriptName), + reinterpret_cast(i_isolate), Utils::ToLocal(scriptName), script->line_offset(), script->column_offset(), options.IsSharedCrossOrigin(), script->id(), Utils::ToLocal(source_map_url), options.IsOpaque(), is_wasm, @@ -203,23 +209,23 @@ Local ScriptOrigin::HostDefinedOptions() const { // --- E x c e p t i o n B e h a v i o r --- -void i::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location) { - i::V8::FatalProcessOutOfMemory(isolate, location, false); +void i::FatalProcessOutOfMemory(i::Isolate* i_isolate, const char* location) { + i::V8::FatalProcessOutOfMemory(i_isolate, location, false); } // When V8 cannot allocate memory FatalProcessOutOfMemory is called. The default // OOM error handler is called and execution is stopped. -void i::V8::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location, +void i::V8::FatalProcessOutOfMemory(i::Isolate* i_isolate, const char* location, bool is_heap_oom) { char last_few_messages[Heap::kTraceRingBufferSize + 1]; char js_stacktrace[Heap::kStacktraceBufferSize + 1]; i::HeapStats heap_stats; - if (isolate == nullptr) { - isolate = Isolate::TryGetCurrent(); + if (i_isolate == nullptr) { + i_isolate = Isolate::TryGetCurrent(); } - if (isolate == nullptr) { + if (i_isolate == nullptr) { // If the Isolate is not available for the current thread we cannot retrieve // memory information from the Isolate. Write easy-to-recognize values on // the stack. @@ -290,10 +296,10 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location, heap_stats.js_stacktrace = js_stacktrace; intptr_t end_marker; heap_stats.end_marker = &end_marker; - if (isolate->heap()->HasBeenSetUp()) { + if (i_isolate->heap()->HasBeenSetUp()) { // BUG(1718): Don't use the take_snapshot since we don't support // HeapObjectIterator here without doing a special GC. - isolate->heap()->RecordStats(&heap_stats, false); + i_isolate->heap()->RecordStats(&heap_stats, false); if (!FLAG_correctness_fuzzer_suppressions) { char* first_newline = strchr(last_few_messages, '\n'); if (first_newline == nullptr || first_newline[1] == '\0') @@ -302,17 +308,17 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* isolate, const char* location, base::OS::PrintError("\n<--- JS stacktrace --->\n%s\n", js_stacktrace); } } - Utils::ReportOOMFailure(isolate, location, is_heap_oom); + Utils::ReportOOMFailure(i_isolate, location, is_heap_oom); if (g_oom_error_callback) g_oom_error_callback(location, is_heap_oom); // If the fatal error handler returns, we stop execution. FATAL("API fatal error handler returned after process out of memory"); } void Utils::ReportApiFailure(const char* location, const char* message) { - i::Isolate* isolate = i::Isolate::TryGetCurrent(); + i::Isolate* i_isolate = i::Isolate::TryGetCurrent(); FatalErrorCallback callback = nullptr; - if (isolate != nullptr) { - callback = isolate->exception_behavior(); + if (i_isolate != nullptr) { + callback = i_isolate->exception_behavior(); } if (callback == nullptr) { base::OS::PrintError("\n#\n# Fatal error in %s\n# %s\n#\n\n", location, @@ -321,16 +327,16 @@ void Utils::ReportApiFailure(const char* location, const char* message) { } else { callback(location, message); } - isolate->SignalFatalError(); + i_isolate->SignalFatalError(); } -void Utils::ReportOOMFailure(i::Isolate* isolate, const char* location, +void Utils::ReportOOMFailure(i::Isolate* i_isolate, const char* location, bool is_heap_oom) { - OOMErrorCallback oom_callback = isolate->oom_behavior(); + LegacyOOMErrorCallback oom_callback = i_isolate->oom_behavior(); if (oom_callback == nullptr) { // TODO(wfh): Remove this fallback once Blink is setting OOM handler. See // crbug.com/614440. - FatalErrorCallback fatal_callback = isolate->exception_behavior(); + FatalErrorCallback fatal_callback = i_isolate->exception_behavior(); if (fatal_callback == nullptr) { base::OS::PrintError("\n#\n# Fatal %s OOM in %s\n#\n\n", is_heap_oom ? "javascript" : "process", location); @@ -348,7 +354,7 @@ void Utils::ReportOOMFailure(i::Isolate* isolate, const char* location, } else { oom_callback(location, is_heap_oom); } - isolate->SignalFatalError(); + i_isolate->SignalFatalError(); } void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { @@ -432,10 +438,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { #endif // V8_SANDBOXED_POINTERS struct SnapshotCreatorData { - explicit SnapshotCreatorData(Isolate* isolate) - : isolate_(isolate), + explicit SnapshotCreatorData(Isolate* v8_isolate) + : isolate_(v8_isolate), default_context_(), - contexts_(isolate), + contexts_(v8_isolate), created_(false) {} static SnapshotCreatorData* cast(void* data) { @@ -453,27 +459,27 @@ struct SnapshotCreatorData { } // namespace -SnapshotCreator::SnapshotCreator(Isolate* isolate, +SnapshotCreator::SnapshotCreator(Isolate* v8_isolate, const intptr_t* external_references, StartupData* existing_snapshot) { - SnapshotCreatorData* data = new SnapshotCreatorData(isolate); - i::Isolate* internal_isolate = reinterpret_cast(isolate); - internal_isolate->set_array_buffer_allocator(&data->allocator_); - internal_isolate->set_api_external_references(external_references); - internal_isolate->enable_serializer(); - isolate->Enter(); + SnapshotCreatorData* data = new SnapshotCreatorData(v8_isolate); + i::Isolate* i_isolate = reinterpret_cast(v8_isolate); + i_isolate->set_array_buffer_allocator(&data->allocator_); + i_isolate->set_api_external_references(external_references); + i_isolate->enable_serializer(); + v8_isolate->Enter(); const StartupData* blob = existing_snapshot ? existing_snapshot : i::Snapshot::DefaultSnapshotBlob(); if (blob && blob->raw_size > 0) { - internal_isolate->set_snapshot_blob(blob); - i::Snapshot::Initialize(internal_isolate); + i_isolate->set_snapshot_blob(blob); + i::Snapshot::Initialize(i_isolate); } else { - internal_isolate->InitWithoutSnapshot(); + i_isolate->InitWithoutSnapshot(); } data_ = data; // Disable batch compilation during snapshot creation. - internal_isolate->baseline_batch_compiler()->set_enabled(false); + i_isolate->baseline_batch_compiler()->set_enabled(false); } SnapshotCreator::SnapshotCreator(const intptr_t* external_references, @@ -484,9 +490,9 @@ SnapshotCreator::SnapshotCreator(const intptr_t* external_references, SnapshotCreator::~SnapshotCreator() { SnapshotCreatorData* data = SnapshotCreatorData::cast(data_); DCHECK(data->created_); - Isolate* isolate = data->isolate_; - isolate->Exit(); - isolate->Dispose(); + Isolate* v8_isolate = data->isolate_; + v8_isolate->Exit(); + v8_isolate->Dispose(); delete data; } @@ -500,9 +506,9 @@ void SnapshotCreator::SetDefaultContext( SnapshotCreatorData* data = SnapshotCreatorData::cast(data_); DCHECK(!data->created_); DCHECK(data->default_context_.IsEmpty()); - Isolate* isolate = data->isolate_; - CHECK_EQ(isolate, context->GetIsolate()); - data->default_context_.Reset(isolate, context); + Isolate* v8_isolate = data->isolate_; + CHECK_EQ(v8_isolate, context->GetIsolate()); + data->default_context_.Reset(v8_isolate, context); data->default_embedder_fields_serializer_ = callback; } @@ -511,8 +517,8 @@ size_t SnapshotCreator::AddContext(Local context, DCHECK(!context.IsEmpty()); SnapshotCreatorData* data = SnapshotCreatorData::cast(data_); DCHECK(!data->created_); - Isolate* isolate = data->isolate_; - CHECK_EQ(isolate, context->GetIsolate()); + Isolate* v8_isolate = data->isolate_; + CHECK_EQ(v8_isolate, context->GetIsolate()); size_t index = data->contexts_.Size(); data->contexts_.Append(context); data->embedder_fields_serializers_.push_back(callback); @@ -523,19 +529,19 @@ size_t SnapshotCreator::AddData(i::Address object) { DCHECK_NE(object, i::kNullAddress); SnapshotCreatorData* data = SnapshotCreatorData::cast(data_); DCHECK(!data->created_); - i::Isolate* isolate = reinterpret_cast(data->isolate_); - i::HandleScope scope(isolate); - i::Handle obj(i::Object(object), isolate); + i::Isolate* i_isolate = reinterpret_cast(data->isolate_); + i::HandleScope scope(i_isolate); + i::Handle obj(i::Object(object), i_isolate); i::Handle list; - if (!isolate->heap()->serialized_objects().IsArrayList()) { - list = i::ArrayList::New(isolate, 1); + if (!i_isolate->heap()->serialized_objects().IsArrayList()) { + list = i::ArrayList::New(i_isolate, 1); } else { list = i::Handle( - i::ArrayList::cast(isolate->heap()->serialized_objects()), isolate); + i::ArrayList::cast(i_isolate->heap()->serialized_objects()), i_isolate); } size_t index = static_cast(list->Length()); - list = i::ArrayList::Add(isolate, list, obj); - isolate->heap()->SetSerializedObjects(*list); + list = i::ArrayList::Add(i_isolate, list, obj); + i_isolate->heap()->SetSerializedObjects(*list); return index; } @@ -543,18 +549,18 @@ size_t SnapshotCreator::AddData(Local context, i::Address object) { DCHECK_NE(object, i::kNullAddress); DCHECK(!SnapshotCreatorData::cast(data_)->created_); i::Handle ctx = Utils::OpenHandle(*context); - i::Isolate* isolate = ctx->GetIsolate(); - i::HandleScope scope(isolate); - i::Handle obj(i::Object(object), isolate); + i::Isolate* i_isolate = ctx->GetIsolate(); + i::HandleScope scope(i_isolate); + i::Handle obj(i::Object(object), i_isolate); i::Handle list; if (!ctx->serialized_objects().IsArrayList()) { - list = i::ArrayList::New(isolate, 1); + list = i::ArrayList::New(i_isolate, 1); } else { list = i::Handle( - i::ArrayList::cast(ctx->serialized_objects()), isolate); + i::ArrayList::cast(ctx->serialized_objects()), i_isolate); } size_t index = static_cast(list->Length()); - list = i::ArrayList::Add(isolate, list, obj); + list = i::ArrayList::Add(i_isolate, list, obj); ctx->set_serialized_objects(*list); return index; } @@ -562,26 +568,27 @@ size_t SnapshotCreator::AddData(Local context, i::Address object) { namespace { void ConvertSerializedObjectsToFixedArray(Local context) { i::Handle ctx = Utils::OpenHandle(*context); - i::Isolate* isolate = ctx->GetIsolate(); + i::Isolate* i_isolate = ctx->GetIsolate(); if (!ctx->serialized_objects().IsArrayList()) { - ctx->set_serialized_objects(i::ReadOnlyRoots(isolate).empty_fixed_array()); + ctx->set_serialized_objects( + i::ReadOnlyRoots(i_isolate).empty_fixed_array()); } else { i::Handle list(i::ArrayList::cast(ctx->serialized_objects()), - isolate); - i::Handle elements = i::ArrayList::Elements(isolate, list); + i_isolate); + i::Handle elements = i::ArrayList::Elements(i_isolate, list); ctx->set_serialized_objects(*elements); } } -void ConvertSerializedObjectsToFixedArray(i::Isolate* isolate) { - if (!isolate->heap()->serialized_objects().IsArrayList()) { - isolate->heap()->SetSerializedObjects( - i::ReadOnlyRoots(isolate).empty_fixed_array()); +void ConvertSerializedObjectsToFixedArray(i::Isolate* i_isolate) { + if (!i_isolate->heap()->serialized_objects().IsArrayList()) { + i_isolate->heap()->SetSerializedObjects( + i::ReadOnlyRoots(i_isolate).empty_fixed_array()); } else { i::Handle list( - i::ArrayList::cast(isolate->heap()->serialized_objects()), isolate); - i::Handle elements = i::ArrayList::Elements(isolate, list); - isolate->heap()->SetSerializedObjects(*elements); + i::ArrayList::cast(i_isolate->heap()->serialized_objects()), i_isolate); + i::Handle elements = i::ArrayList::Elements(i_isolate, list); + i_isolate->heap()->SetSerializedObjects(*elements); } } } // anonymous namespace @@ -589,7 +596,7 @@ void ConvertSerializedObjectsToFixedArray(i::Isolate* isolate) { StartupData SnapshotCreator::CreateBlob( SnapshotCreator::FunctionCodeHandling function_code_handling) { SnapshotCreatorData* data = SnapshotCreatorData::cast(data_); - i::Isolate* isolate = reinterpret_cast(data->isolate_); + i::Isolate* i_isolate = reinterpret_cast(data->isolate_); DCHECK(!data->created_); DCHECK(!data->default_context_.IsEmpty()); @@ -599,9 +606,9 @@ StartupData SnapshotCreator::CreateBlob( // Create and store lists of embedder-provided data needed during // serialization. { - i::HandleScope scope(isolate); + i::HandleScope scope(i_isolate); // Convert list of context-independent data to FixedArray. - ConvertSerializedObjectsToFixedArray(isolate); + ConvertSerializedObjectsToFixedArray(i_isolate); // Convert lists of context-dependent data to FixedArray. ConvertSerializedObjectsToFixedArray( @@ -613,33 +620,33 @@ StartupData SnapshotCreator::CreateBlob( // We need to store the global proxy size upfront in case we need the // bootstrapper to create a global proxy before we deserialize the context. i::Handle global_proxy_sizes = - isolate->factory()->NewFixedArray(num_additional_contexts, - i::AllocationType::kOld); + i_isolate->factory()->NewFixedArray(num_additional_contexts, + i::AllocationType::kOld); for (int i = 0; i < num_additional_contexts; i++) { i::Handle context = v8::Utils::OpenHandle(*data->contexts_.Get(i)); global_proxy_sizes->set(i, i::Smi::FromInt(context->global_proxy().Size())); } - isolate->heap()->SetSerializedGlobalProxySizes(*global_proxy_sizes); + i_isolate->heap()->SetSerializedGlobalProxySizes(*global_proxy_sizes); } // We might rehash strings and re-sort descriptors. Clear the lookup cache. - isolate->descriptor_lookup_cache()->Clear(); + i_isolate->descriptor_lookup_cache()->Clear(); // If we don't do this then we end up with a stray root pointing at the // context even after we have disposed of the context. - isolate->heap()->CollectAllAvailableGarbage( + i_isolate->heap()->CollectAllAvailableGarbage( i::GarbageCollectionReason::kSnapshotCreator); { - i::HandleScope scope(isolate); - isolate->heap()->CompactWeakArrayLists(); + i::HandleScope scope(i_isolate); + i_isolate->heap()->CompactWeakArrayLists(); } i::Snapshot::ClearReconstructableDataForSerialization( - isolate, function_code_handling == FunctionCodeHandling::kClear); + i_isolate, function_code_handling == FunctionCodeHandling::kClear); - i::GlobalSafepointScope global_safepoint(isolate); + i::GlobalSafepointScope global_safepoint(i_isolate); i::DisallowGarbageCollection no_gc_from_here_on; // Create a vector with all contexts and clear associated Persistent fields. @@ -649,7 +656,7 @@ StartupData SnapshotCreator::CreateBlob( std::vector contexts; contexts.reserve(num_contexts); { - i::HandleScope scope(isolate); + i::HandleScope scope(i_isolate); contexts.push_back( *v8::Utils::OpenHandle(*data->default_context_.Get(data->isolate_))); data->default_context_.Reset(); @@ -662,7 +669,7 @@ StartupData SnapshotCreator::CreateBlob( } // Check that values referenced by global/eternal handles are accounted for. - i::SerializedHandleChecker handle_checker(isolate, &contexts); + i::SerializedHandleChecker handle_checker(i_isolate, &contexts); CHECK(handle_checker.CheckGlobalAndEternalHandles()); // Create a vector with all embedder fields serializers. @@ -676,7 +683,7 @@ StartupData SnapshotCreator::CreateBlob( } data->created_ = true; - return i::Snapshot::Create(isolate, &contexts, embedder_fields_serializers, + return i::Snapshot::Create(i_isolate, &contexts, embedder_fields_serializers, global_safepoint, no_gc_from_here_on); } @@ -807,19 +814,19 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory, namespace internal { -i::Address* GlobalizeTracedReference(i::Isolate* isolate, i::Address* obj, +i::Address* GlobalizeTracedReference(i::Isolate* i_isolate, i::Address* obj, internal::Address* slot, GlobalHandleStoreMode store_mode) { - API_RCS_SCOPE(isolate, TracedGlobal, New); + API_RCS_SCOPE(i_isolate, TracedGlobal, New); #ifdef DEBUG Utils::ApiCheck((slot != nullptr), "v8::GlobalizeTracedReference", "the address slot must be not null"); #endif i::Handle result = - isolate->global_handles()->CreateTraced(*obj, slot, store_mode); + i_isolate->global_handles()->CreateTraced(*obj, slot, store_mode); #ifdef VERIFY_HEAP if (i::FLAG_verify_heap) { - i::Object(*obj).ObjectVerify(isolate); + i::Object(*obj).ObjectVerify(i_isolate); } #endif // VERIFY_HEAP return result.location(); @@ -842,12 +849,12 @@ void DisposeTracedReference(internal::Address* location) { namespace api_internal { -i::Address* GlobalizeReference(i::Isolate* isolate, i::Address* obj) { - API_RCS_SCOPE(isolate, Persistent, New); - i::Handle result = isolate->global_handles()->Create(*obj); +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) { - i::Object(*obj).ObjectVerify(isolate); + i::Object(*obj).ObjectVerify(i_isolate); } #endif // VERIFY_HEAP return result.location(); @@ -885,12 +892,12 @@ void DisposeGlobal(i::Address* location) { } Value* Eternalize(Isolate* v8_isolate, Value* value) { - i::Isolate* isolate = reinterpret_cast(v8_isolate); + i::Isolate* i_isolate = reinterpret_cast(v8_isolate); i::Object object = *Utils::OpenHandle(value); int index = -1; - isolate->eternal_handles()->Create(isolate, object, &index); + i_isolate->eternal_handles()->Create(i_isolate, object, &index); return reinterpret_cast( - isolate->eternal_handles()->Get(index).location()); + i_isolate->eternal_handles()->Get(index).location()); } void FromJustIsNothing() { @@ -911,30 +918,29 @@ void InternalFieldOutOfBounds(int index) { // --- H a n d l e s --- -HandleScope::HandleScope(Isolate* isolate) { Initialize(isolate); } +HandleScope::HandleScope(Isolate* v8_isolate) { Initialize(v8_isolate); } -void HandleScope::Initialize(Isolate* isolate) { - i::Isolate* internal_isolate = reinterpret_cast(isolate); +void HandleScope::Initialize(Isolate* v8_isolate) { + i::Isolate* i_isolate = reinterpret_cast(v8_isolate); // We do not want to check the correct usage of the Locker class all over the // place, so we do it only here: Without a HandleScope, an embedder can do // almost nothing, so it is enough to check in this central place. // We make an exception if the serializer is enabled, which means that the // Isolate is exclusively used to create a snapshot. - Utils::ApiCheck( - !internal_isolate->was_locker_ever_used() || - internal_isolate->thread_manager()->IsLockedByCurrentThread() || - internal_isolate->serializer_enabled(), - "HandleScope::HandleScope", - "Entering the V8 API without proper locking in place"); - i::HandleScopeData* current = internal_isolate->handle_scope_data(); - isolate_ = internal_isolate; + Utils::ApiCheck(!i_isolate->was_locker_ever_used() || + i_isolate->thread_manager()->IsLockedByCurrentThread() || + i_isolate->serializer_enabled(), + "HandleScope::HandleScope", + "Entering the V8 API without proper locking in place"); + i::HandleScopeData* current = i_isolate->handle_scope_data(); + i_isolate_ = i_isolate; prev_next_ = current->next; prev_limit_ = current->limit; current->level++; } HandleScope::~HandleScope() { - i::HandleScope::CloseScope(isolate_, prev_next_, prev_limit_); + i::HandleScope::CloseScope(i_isolate_, prev_next_, prev_limit_); } void* HandleScope::operator new(size_t) { base::OS::Abort(); } @@ -942,19 +948,19 @@ void* HandleScope::operator new[](size_t) { base::OS::Abort(); } void HandleScope::operator delete(void*, size_t) { base::OS::Abort(); } void HandleScope::operator delete[](void*, size_t) { base::OS::Abort(); } -int HandleScope::NumberOfHandles(Isolate* isolate) { +int HandleScope::NumberOfHandles(Isolate* v8_isolate) { return i::HandleScope::NumberOfHandles( - reinterpret_cast(isolate)); + reinterpret_cast(v8_isolate)); } -i::Address* HandleScope::CreateHandle(i::Isolate* isolate, i::Address value) { - return i::HandleScope::CreateHandle(isolate, value); +i::Address* HandleScope::CreateHandle(i::Isolate* i_isolate, i::Address value) { + return i::HandleScope::CreateHandle(i_isolate, value); } EscapableHandleScope::EscapableHandleScope(Isolate* v8_isolate) { - i::Isolate* isolate = reinterpret_cast(v8_isolate); - escape_slot_ = - CreateHandle(isolate, i::ReadOnlyRoots(isolate).the_hole_value().ptr()); + i::Isolate* i_isolate = reinterpret_cast(v8_isolate); + escape_slot_ = CreateHandle( + i_isolate, i::ReadOnlyRoots(i_isolate).the_hole_value().ptr()); Initialize(v8_isolate); } @@ -977,9 +983,9 @@ void EscapableHandleScope::operator delete[](void*, size_t) { base::OS::Abort(); } -SealHandleScope::SealHandleScope(Isolate* isolate) - : isolate_(reinterpret_cast(isolate)) { - i::HandleScopeData* current = isolate_->handle_scope_data(); +SealHandleScope::SealHandleScope(Isolate* v8_isolate) + : i_isolate_(reinterpret_cast(v8_isolate)) { + i::HandleScopeData* current = i_isolate_->handle_scope_data(); prev_limit_ = current->limit; current->limit = current->next; prev_sealed_level_ = current->sealed_level; @@ -987,7 +993,7 @@ SealHandleScope::SealHandleScope(Isolate* isolate) } SealHandleScope::~SealHandleScope() { - i::HandleScopeData* current = isolate_->handle_scope_data(); + i::HandleScopeData* current = i_isolate_->handle_scope_data(); DCHECK_EQ(current->next, current->limit); current->limit = prev_limit_; DCHECK_EQ(current->level, current->sealed_level); @@ -1031,26 +1037,30 @@ bool Data::IsFunctionTemplate() const { bool Data::IsContext() const { return Utils::OpenHandle(this)->IsContext(); } void Context::Enter() { - i::Handle env = Utils::OpenHandle(this); - i::Isolate* isolate = env->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScopeImplementer* impl = isolate->handle_scope_implementer(); - impl->EnterContext(*env); - impl->SaveContext(isolate->context()); - isolate->set_context(*env); + i::DisallowGarbageCollection no_gc; + i::Context env = *Utils::OpenHandle(this); + i::Isolate* i_isolate = env.GetIsolate(); + // TODO(cbruni): Use ENTER_V8_NO_SCRIPT_NO_EXCEPTION which also checks + // Isolate::is_execution_terminating + // ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + ENTER_V8_MAYBE_TEARDOWN(i_isolate); + i::HandleScopeImplementer* impl = i_isolate->handle_scope_implementer(); + impl->EnterContext(env); + impl->SaveContext(i_isolate->context()); + i_isolate->set_context(env); } void Context::Exit() { i::Handle env = Utils::OpenHandle(this); - i::Isolate* isolate = env->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScopeImplementer* impl = isolate->handle_scope_implementer(); + i::Isolate* i_isolate = env->GetIsolate(); + ENTER_V8_MAYBE_TEARDOWN(i_isolate); + i::HandleScopeImplementer* impl = i_isolate->handle_scope_implementer(); if (!Utils::ApiCheck(impl->LastEnteredContextWas(*env), "v8::Context::Exit()", "Cannot exit non-entered context")) { return; } impl->LeaveContext(); - isolate->set_context(impl->RestoreContext()); + i_isolate->set_context(impl->RestoreContext()); } Context::BackupIncumbentScope::BackupIncumbentScope( @@ -1059,22 +1069,22 @@ Context::BackupIncumbentScope::BackupIncumbentScope( DCHECK(!backup_incumbent_context_.IsEmpty()); i::Handle env = Utils::OpenHandle(*backup_incumbent_context_); - i::Isolate* isolate = env->GetIsolate(); + i::Isolate* i_isolate = env->GetIsolate(); js_stack_comparable_address_ = - i::SimulatorStack::RegisterJSStackComparableAddress(isolate); + i::SimulatorStack::RegisterJSStackComparableAddress(i_isolate); - prev_ = isolate->top_backup_incumbent_scope(); - isolate->set_top_backup_incumbent_scope(this); + prev_ = i_isolate->top_backup_incumbent_scope(); + i_isolate->set_top_backup_incumbent_scope(this); } Context::BackupIncumbentScope::~BackupIncumbentScope() { i::Handle env = Utils::OpenHandle(*backup_incumbent_context_); - i::Isolate* isolate = env->GetIsolate(); + i::Isolate* i_isolate = env->GetIsolate(); - i::SimulatorStack::UnregisterJSStackComparableAddress(isolate); + i::SimulatorStack::UnregisterJSStackComparableAddress(i_isolate); - isolate->set_top_backup_incumbent_scope(prev_); + i_isolate->set_top_backup_incumbent_scope(prev_); } STATIC_ASSERT(i::Internals::kEmbedderDataSlotSize == i::kEmbedderDataSlotSize); @@ -1083,28 +1093,28 @@ static i::Handle EmbedderDataFor(Context* context, int index, bool can_grow, const char* location) { i::Handle env = Utils::OpenHandle(context); - i::Isolate* isolate = env->GetIsolate(); - ASSERT_NO_SCRIPT_NO_EXCEPTION(isolate); + i::Isolate* i_isolate = env->GetIsolate(); + DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate); bool ok = Utils::ApiCheck(env->IsNativeContext(), location, "Not a native context") && Utils::ApiCheck(index >= 0, location, "Negative index"); if (!ok) return i::Handle(); // TODO(ishell): remove cast once embedder_data slot has a proper type. i::Handle data( - i::EmbedderDataArray::cast(env->embedder_data()), isolate); + i::EmbedderDataArray::cast(env->embedder_data()), i_isolate); if (index < data->length()) return data; if (!Utils::ApiCheck(can_grow && index < i::EmbedderDataArray::kMaxLength, location, "Index too large")) { return i::Handle(); } - data = i::EmbedderDataArray::EnsureCapacity(isolate, data, index); + data = i::EmbedderDataArray::EnsureCapacity(i_isolate, data, index); env->set_embedder_data(*data); return data; } uint32_t Context::GetNumberOfEmbedderDataFields() { i::Handle context = Utils::OpenHandle(this); - ASSERT_NO_SCRIPT_NO_EXCEPTION(context->GetIsolate()); + DCHECK_NO_SCRIPT_NO_EXCEPTION(context->GetIsolate()); Utils::ApiCheck(context->IsNativeContext(), "Context::GetNumberOfEmbedderDataFields", "Not a native context"); @@ -1118,9 +1128,9 @@ v8::Local Context::SlowGetEmbedderData(int index) { i::Handle data = EmbedderDataFor(this, index, false, location); if (data.is_null()) return Local(); - i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); + i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate(); i::Handle result(i::EmbedderDataSlot(*data, index).load_tagged(), - isolate); + i_isolate); return Utils::ToLocal(result); } @@ -1137,25 +1147,25 @@ void Context::SetEmbedderData(int index, v8::Local value) { void* Context::SlowGetAlignedPointerFromEmbedderData(int index) { const char* location = "v8::Context::GetAlignedPointerFromEmbedderData()"; - i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); - i::HandleScope handle_scope(isolate); + i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate(); + i::HandleScope handle_scope(i_isolate); i::Handle data = EmbedderDataFor(this, index, false, location); if (data.is_null()) return nullptr; void* result; Utils::ApiCheck( - i::EmbedderDataSlot(*data, index).ToAlignedPointer(isolate, &result), + i::EmbedderDataSlot(*data, index).ToAlignedPointer(i_isolate, &result), location, "Pointer is not aligned"); return result; } void Context::SetAlignedPointerInEmbedderData(int index, void* value) { const char* location = "v8::Context::SetAlignedPointerInEmbedderData()"; - i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); + i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate(); i::Handle data = EmbedderDataFor(this, index, true, location); bool ok = - i::EmbedderDataSlot(*data, index).store_aligned_pointer(isolate, value); + i::EmbedderDataSlot(*data, index).store_aligned_pointer(i_isolate, value); Utils::ApiCheck(ok, location, "Pointer is not aligned"); DCHECK_EQ(value, GetAlignedPointerFromEmbedderData(index)); } @@ -1174,9 +1184,9 @@ static void InitializeTemplate(i::TemplateInfo that, int type, void Template::Set(v8::Local name, v8::Local value, v8::PropertyAttribute attribute) { auto templ = Utils::OpenHandle(this); - i::Isolate* isolate = templ->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScope scope(isolate); + i::Isolate* i_isolate = templ->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::HandleScope scope(i_isolate); auto value_obj = Utils::OpenHandle(*value); Utils::ApiCheck(!value_obj->IsJSReceiver() || value_obj->IsTemplateInfo(), @@ -1190,7 +1200,7 @@ void Template::Set(v8::Local name, v8::Local value, templ->set_serial_number(i::TemplateInfo::kDoNotCache); } - i::ApiNatives::AddDataProperty(isolate, templ, Utils::OpenHandle(*name), + i::ApiNatives::AddDataProperty(i_isolate, templ, Utils::OpenHandle(*name), value_obj, static_cast(attribute)); } @@ -1209,13 +1219,13 @@ void Template::SetAccessorProperty(v8::Local name, // TODO(verwaest): Remove |access_control|. DCHECK_EQ(v8::DEFAULT, access_control); auto templ = Utils::OpenHandle(this); - auto isolate = templ->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + auto i_isolate = templ->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); DCHECK(!name.IsEmpty()); DCHECK(!getter.IsEmpty() || !setter.IsEmpty()); - i::HandleScope scope(isolate); + i::HandleScope scope(i_isolate); i::ApiNatives::AddAccessorProperty( - isolate, templ, Utils::OpenHandle(*name), + i_isolate, templ, Utils::OpenHandle(*name), Utils::OpenHandle(*getter, true), Utils::OpenHandle(*setter, true), static_cast(attribute)); } @@ -1227,9 +1237,29 @@ static void InitializeFunctionTemplate(i::FunctionTemplateInfo info, info.set_flag(0); } -static Local ObjectTemplateNew( - i::Isolate* isolate, v8::Local constructor, - bool do_not_cache); +namespace { +Local ObjectTemplateNew(i::Isolate* i_isolate, + v8::Local constructor, + bool do_not_cache) { + API_RCS_SCOPE(i_isolate, ObjectTemplate, New); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::Handle struct_obj = i_isolate->factory()->NewStruct( + i::OBJECT_TEMPLATE_INFO_TYPE, i::AllocationType::kOld); + i::Handle obj = + i::Handle::cast(struct_obj); + { + // Disallow GC until all fields of obj have acceptable types. + i::DisallowGarbageCollection no_gc; + i::ObjectTemplateInfo raw = *obj; + InitializeTemplate(raw, Consts::OBJECT_TEMPLATE, do_not_cache); + raw.set_data(0); + if (!constructor.IsEmpty()) { + raw.set_constructor(*Utils::OpenHandle(*constructor)); + } + } + return Utils::ToLocal(obj); +} +} // namespace Local FunctionTemplate::PrototypeTemplate() { auto self = Utils::OpenHandle(this); @@ -1262,6 +1292,7 @@ void FunctionTemplate::SetPrototypeProviderTemplate( result); } +namespace { static void EnsureNotPublished(i::Handle info, const char* func) { DCHECK_IMPLIES(info->instantiated(), info->published()); @@ -1269,20 +1300,8 @@ static void EnsureNotPublished(i::Handle info, "FunctionTemplate already instantiated"); } -void FunctionTemplate::Inherit(v8::Local value) { - auto info = Utils::OpenHandle(this); - EnsureNotPublished(info, "v8::FunctionTemplate::Inherit"); - i::Isolate* i_isolate = info->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); - Utils::ApiCheck(info->GetPrototypeProviderTemplate().IsUndefined(i_isolate), - "v8::FunctionTemplate::Inherit", - "Protoype provider must be empty"); - i::FunctionTemplateInfo::SetParentTemplate(i_isolate, info, - Utils::OpenHandle(*value)); -} - -static Local FunctionTemplateNew( - i::Isolate* isolate, FunctionCallback callback, v8::Local data, +Local FunctionTemplateNew( + i::Isolate* i_isolate, FunctionCallback callback, v8::Local data, v8::Local signature, int length, ConstructorBehavior behavior, bool do_not_cache, v8::Local cached_property_name = v8::Local(), @@ -1291,7 +1310,7 @@ static Local FunctionTemplateNew( uint8_t instance_type = 0, uint8_t allowed_receiver_instance_type_range_start = 0, uint8_t allowed_receiver_instance_type_range_end = 0) { - i::Handle struct_obj = isolate->factory()->NewStruct( + i::Handle struct_obj = i_isolate->factory()->NewStruct( i::FUNCTION_TEMPLATE_INFO_TYPE, i::AllocationType::kOld); i::Handle obj = i::Handle::cast(struct_obj); @@ -1309,7 +1328,7 @@ static Local FunctionTemplateNew( } raw.set_cached_property_name( cached_property_name.IsEmpty() - ? i::ReadOnlyRoots(isolate).the_hole_value() + ? i::ReadOnlyRoots(i_isolate).the_hole_value() : *Utils::OpenHandle(*cached_property_name)); if (behavior == ConstructorBehavior::kThrow) raw.set_remove_prototype(true); raw.SetInstanceType(instance_type); @@ -1324,14 +1343,27 @@ static Local FunctionTemplateNew( } return Utils::ToLocal(obj); } +} // namespace + +void FunctionTemplate::Inherit(v8::Local value) { + auto info = Utils::OpenHandle(this); + EnsureNotPublished(info, "v8::FunctionTemplate::Inherit"); + i::Isolate* i_isolate = info->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + Utils::ApiCheck(info->GetPrototypeProviderTemplate().IsUndefined(i_isolate), + "v8::FunctionTemplate::Inherit", + "Protoype provider must be empty"); + i::FunctionTemplateInfo::SetParentTemplate(i_isolate, info, + Utils::OpenHandle(*value)); +} Local FunctionTemplate::New( - Isolate* isolate, FunctionCallback callback, v8::Local data, + Isolate* v8_isolate, FunctionCallback callback, v8::Local data, v8::Local signature, int length, ConstructorBehavior behavior, SideEffectType side_effect_type, const CFunction* c_function, uint16_t instance_type, uint16_t allowed_receiver_instance_type_range_start, uint16_t allowed_receiver_instance_type_range_end) { - i::Isolate* i_isolate = reinterpret_cast(isolate); + i::Isolate* i_isolate = reinterpret_cast(v8_isolate); // Changes to the environment cannot be captured in the snapshot. Expect no // function templates when the isolate is created for serialization. API_RCS_SCOPE(i_isolate, FunctionTemplate, New); @@ -1354,11 +1386,11 @@ Local FunctionTemplate::New( } Local FunctionTemplate::NewWithCFunctionOverloads( - Isolate* isolate, FunctionCallback callback, v8::Local data, + Isolate* v8_isolate, FunctionCallback callback, v8::Local data, v8::Local signature, int length, ConstructorBehavior behavior, SideEffectType side_effect_type, const MemorySpan& c_function_overloads) { - i::Isolate* i_isolate = reinterpret_cast(isolate); + i::Isolate* i_isolate = reinterpret_cast(v8_isolate); API_RCS_SCOPE(i_isolate, FunctionTemplate, New); if (!Utils::ApiCheck( @@ -1376,10 +1408,10 @@ Local FunctionTemplate::NewWithCFunctionOverloads( } Local FunctionTemplate::NewWithCache( - Isolate* isolate, FunctionCallback callback, Local cache_property, - Local data, Local signature, int length, - SideEffectType side_effect_type) { - i::Isolate* i_isolate = reinterpret_cast(isolate); + Isolate* v8_isolate, FunctionCallback callback, + Local cache_property, Local data, + Local signature, int length, SideEffectType side_effect_type) { + i::Isolate* i_isolate = reinterpret_cast(v8_isolate); API_RCS_SCOPE(i_isolate, FunctionTemplate, NewWithCache); ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); return FunctionTemplateNew(i_isolate, callback, data, signature, length, @@ -1387,20 +1419,20 @@ Local FunctionTemplate::NewWithCache( side_effect_type); } -Local Signature::New(Isolate* isolate, +Local Signature::New(Isolate* v8_isolate, Local receiver) { return Utils::SignatureToLocal(Utils::OpenHandle(*receiver)); } Local AccessorSignature::New( - Isolate* isolate, Local receiver) { + Isolate* v8_isolate, Local receiver) { return Utils::AccessorSignatureToLocal(Utils::OpenHandle(*receiver)); } -#define SET_FIELD_WRAPPED(isolate, obj, setter, cdata) \ - do { \ - i::Handle foreign = FromCData(isolate, cdata); \ - (obj)->setter(*foreign); \ +#define SET_FIELD_WRAPPED(i_isolate, obj, setter, cdata) \ + do { \ + i::Handle foreign = FromCData(i_isolate, cdata); \ + (obj)->setter(*foreign); \ } while (false) void FunctionTemplate::SetCallHandler( @@ -1409,38 +1441,39 @@ void FunctionTemplate::SetCallHandler( const MemorySpan& c_function_overloads) { auto info = Utils::OpenHandle(this); EnsureNotPublished(info, "v8::FunctionTemplate::SetCallHandler"); - i::Isolate* isolate = info->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScope scope(isolate); - i::Handle obj = isolate->factory()->NewCallHandlerInfo( + i::Isolate* i_isolate = info->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::HandleScope scope(i_isolate); + i::Handle obj = i_isolate->factory()->NewCallHandlerInfo( side_effect_type == SideEffectType::kHasNoSideEffect); - SET_FIELD_WRAPPED(isolate, obj, set_callback, callback); - SET_FIELD_WRAPPED(isolate, obj, set_js_callback, obj->redirected_callback()); + SET_FIELD_WRAPPED(i_isolate, obj, set_callback, callback); + SET_FIELD_WRAPPED(i_isolate, obj, set_js_callback, + obj->redirected_callback()); if (data.IsEmpty()) { - data = v8::Undefined(reinterpret_cast(isolate)); + data = v8::Undefined(reinterpret_cast(i_isolate)); } obj->set_data(*Utils::OpenHandle(*data)); if (c_function_overloads.size() > 0) { // Stores the data for a sequence of CFunction overloads into a single // FixedArray, as [address_0, signature_0, ... address_n-1, signature_n-1]. i::Handle function_overloads = - isolate->factory()->NewFixedArray(static_cast( + i_isolate->factory()->NewFixedArray(static_cast( c_function_overloads.size() * i::FunctionTemplateInfo::kFunctionOverloadEntrySize)); int function_count = static_cast(c_function_overloads.size()); for (int i = 0; i < function_count; i++) { const CFunction& c_function = c_function_overloads.data()[i]; i::Handle address = - FromCData(isolate, c_function.GetAddress()); + FromCData(i_isolate, c_function.GetAddress()); function_overloads->set( i::FunctionTemplateInfo::kFunctionOverloadEntrySize * i, *address); i::Handle signature = - FromCData(isolate, c_function.GetTypeInfo()); + FromCData(i_isolate, c_function.GetTypeInfo()); function_overloads->set( i::FunctionTemplateInfo::kFunctionOverloadEntrySize * i + 1, *signature); } - i::FunctionTemplateInfo::SetCFunctionOverloads(isolate, info, + i::FunctionTemplateInfo::SetCFunctionOverloads(i_isolate, info, function_overloads); } info->set_call_code(*obj, kReleaseStore); @@ -1450,32 +1483,32 @@ namespace { template i::Handle MakeAccessorInfo( - i::Isolate* isolate, v8::Local name, Getter getter, Setter setter, + i::Isolate* i_isolate, v8::Local name, Getter getter, Setter setter, v8::Local data, v8::AccessControl settings, v8::Local signature, bool is_special_data_property, bool replace_on_access) { - i::Handle obj = isolate->factory()->NewAccessorInfo(); - SET_FIELD_WRAPPED(isolate, obj, set_getter, getter); + i::Handle obj = i_isolate->factory()->NewAccessorInfo(); + SET_FIELD_WRAPPED(i_isolate, obj, set_getter, getter); DCHECK_IMPLIES(replace_on_access, is_special_data_property && setter == nullptr); if (is_special_data_property && setter == nullptr) { setter = reinterpret_cast(&i::Accessors::ReconfigureToDataProperty); } - SET_FIELD_WRAPPED(isolate, obj, set_setter, setter); + SET_FIELD_WRAPPED(i_isolate, obj, set_setter, setter); i::Address redirected = obj->redirected_getter(); if (redirected != i::kNullAddress) { - SET_FIELD_WRAPPED(isolate, obj, set_js_getter, redirected); + SET_FIELD_WRAPPED(i_isolate, obj, set_js_getter, redirected); } i::Handle accessor_name = Utils::OpenHandle(*name); if (!accessor_name->IsUniqueName()) { - accessor_name = isolate->factory()->InternalizeString( + accessor_name = i_isolate->factory()->InternalizeString( i::Handle::cast(accessor_name)); } i::DisallowGarbageCollection no_gc; i::AccessorInfo raw_obj = *obj; if (data.IsEmpty()) { - raw_obj.set_data(i::ReadOnlyRoots(isolate).undefined_value()); + raw_obj.set_data(i::ReadOnlyRoots(i_isolate).undefined_value()); } else { raw_obj.set_data(*Utils::OpenHandle(*data)); } @@ -1500,125 +1533,105 @@ Local FunctionTemplate::InstanceTemplate() { "Reading from empty handle")) { return Local(); } - i::Isolate* isolate = handle->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - if (handle->GetInstanceTemplate().IsUndefined(isolate)) { + i::Isolate* i_isolate = handle->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + if (handle->GetInstanceTemplate().IsUndefined(i_isolate)) { Local templ = - ObjectTemplate::New(isolate, ToApiHandle(handle)); - i::FunctionTemplateInfo::SetInstanceTemplate(isolate, handle, + ObjectTemplate::New(i_isolate, ToApiHandle(handle)); + i::FunctionTemplateInfo::SetInstanceTemplate(i_isolate, handle, Utils::OpenHandle(*templ)); } i::Handle result( - i::ObjectTemplateInfo::cast(handle->GetInstanceTemplate()), isolate); + i::ObjectTemplateInfo::cast(handle->GetInstanceTemplate()), i_isolate); return Utils::ToLocal(result); } void FunctionTemplate::SetLength(int length) { auto info = Utils::OpenHandle(this); EnsureNotPublished(info, "v8::FunctionTemplate::SetLength"); - auto isolate = info->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + auto i_isolate = info->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); info->set_length(length); } void FunctionTemplate::SetClassName(Local name) { auto info = Utils::OpenHandle(this); EnsureNotPublished(info, "v8::FunctionTemplate::SetClassName"); - auto isolate = info->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + auto i_isolate = info->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); info->set_class_name(*Utils::OpenHandle(*name)); } void FunctionTemplate::SetAcceptAnyReceiver(bool value) { auto info = Utils::OpenHandle(this); EnsureNotPublished(info, "v8::FunctionTemplate::SetAcceptAnyReceiver"); - auto isolate = info->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + auto i_isolate = info->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); info->set_accept_any_receiver(value); } void FunctionTemplate::ReadOnlyPrototype() { auto info = Utils::OpenHandle(this); EnsureNotPublished(info, "v8::FunctionTemplate::ReadOnlyPrototype"); - auto isolate = info->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + auto i_isolate = info->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); info->set_read_only_prototype(true); } void FunctionTemplate::RemovePrototype() { auto info = Utils::OpenHandle(this); EnsureNotPublished(info, "v8::FunctionTemplate::RemovePrototype"); - auto isolate = info->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + auto i_isolate = info->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); info->set_remove_prototype(true); } // --- O b j e c t T e m p l a t e --- Local ObjectTemplate::New( - Isolate* isolate, v8::Local constructor) { - return New(reinterpret_cast(isolate), constructor); -} - -static Local ObjectTemplateNew( - i::Isolate* isolate, v8::Local constructor, - bool do_not_cache) { - API_RCS_SCOPE(isolate, ObjectTemplate, New); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::Handle struct_obj = isolate->factory()->NewStruct( - i::OBJECT_TEMPLATE_INFO_TYPE, i::AllocationType::kOld); - i::Handle obj = - i::Handle::cast(struct_obj); - { - // Disallow GC until all fields of obj have acceptable types. - i::DisallowGarbageCollection no_gc; - i::ObjectTemplateInfo raw = *obj; - InitializeTemplate(raw, Consts::OBJECT_TEMPLATE, do_not_cache); - raw.set_data(0); - if (!constructor.IsEmpty()) { - raw.set_constructor(*Utils::OpenHandle(*constructor)); - } - } - return Utils::ToLocal(obj); + Isolate* v8_isolate, v8::Local constructor) { + return New(reinterpret_cast(v8_isolate), constructor); } Local ObjectTemplate::New( - i::Isolate* isolate, v8::Local constructor) { - return ObjectTemplateNew(isolate, constructor, false); + i::Isolate* i_isolate, v8::Local constructor) { + return ObjectTemplateNew(i_isolate, constructor, false); } +namespace { // Ensure that the object template has a constructor. If no // constructor is available we create one. -static i::Handle EnsureConstructor( - i::Isolate* isolate, ObjectTemplate* object_template) { +i::Handle EnsureConstructor( + i::Isolate* i_isolate, ObjectTemplate* object_template) { i::Object obj = Utils::OpenHandle(object_template)->constructor(); - if (!obj.IsUndefined(isolate)) { + if (!obj.IsUndefined(i_isolate)) { i::FunctionTemplateInfo info = i::FunctionTemplateInfo::cast(obj); - return i::Handle(info, isolate); + return i::Handle(info, i_isolate); } Local templ = - FunctionTemplate::New(reinterpret_cast(isolate)); + FunctionTemplate::New(reinterpret_cast(i_isolate)); i::Handle constructor = Utils::OpenHandle(*templ); i::FunctionTemplateInfo::SetInstanceTemplate( - isolate, constructor, Utils::OpenHandle(object_template)); + i_isolate, constructor, Utils::OpenHandle(object_template)); Utils::OpenHandle(object_template)->set_constructor(*constructor); return constructor; } template -static void TemplateSetAccessor( - Template* template_obj, v8::Local name, Getter getter, Setter setter, - Data data, AccessControl settings, PropertyAttribute attribute, - v8::Local signature, bool is_special_data_property, - bool replace_on_access, SideEffectType getter_side_effect_type, - SideEffectType setter_side_effect_type) { +void TemplateSetAccessor(Template* template_obj, v8::Local name, + Getter getter, Setter setter, Data data, + AccessControl settings, PropertyAttribute attribute, + v8::Local signature, + bool is_special_data_property, bool replace_on_access, + SideEffectType getter_side_effect_type, + SideEffectType setter_side_effect_type) { auto info = Utils::OpenHandle(template_obj); - auto isolate = info->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScope scope(isolate); + auto i_isolate = info->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::HandleScope scope(i_isolate); i::Handle accessor_info = - MakeAccessorInfo(isolate, name, getter, setter, data, settings, signature, - is_special_data_property, replace_on_access); + MakeAccessorInfo(i_isolate, name, getter, setter, data, settings, + signature, is_special_data_property, replace_on_access); { i::DisallowGarbageCollection no_gc; i::AccessorInfo raw = *accessor_info; @@ -1627,8 +1640,9 @@ static void TemplateSetAccessor( raw.set_getter_side_effect_type(getter_side_effect_type); raw.set_setter_side_effect_type(setter_side_effect_type); } - i::ApiNatives::AddNativeDataProperty(isolate, info, accessor_info); + i::ApiNatives::AddNativeDataProperty(i_isolate, info, accessor_info); } +} // namespace void Template::SetNativeDataProperty(v8::Local name, AccessorGetterCallback getter, @@ -1693,10 +1707,10 @@ void Template::SetLazyDataProperty(v8::Local name, void Template::SetIntrinsicDataProperty(Local name, Intrinsic intrinsic, PropertyAttribute attribute) { auto templ = Utils::OpenHandle(this); - i::Isolate* isolate = templ->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScope scope(isolate); - i::ApiNatives::AddDataProperty(isolate, templ, Utils::OpenHandle(*name), + i::Isolate* i_isolate = templ->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::HandleScope scope(i_isolate); + i::ApiNatives::AddDataProperty(i_isolate, templ, Utils::OpenHandle(*name), intrinsic, static_cast(attribute)); } @@ -1753,25 +1767,29 @@ void ObjectTemplate::SetAccessor(v8::Local name, getter_side_effect_type, setter_side_effect_type); } +namespace { template -static i::Handle CreateInterceptorInfo( - i::Isolate* isolate, Getter getter, Setter setter, Query query, +i::Handle CreateInterceptorInfo( + i::Isolate* i_isolate, Getter getter, Setter setter, Query query, Descriptor descriptor, Deleter remover, Enumerator enumerator, Definer definer, Local data, PropertyHandlerFlags flags) { - auto obj = i::Handle::cast(isolate->factory()->NewStruct( - i::INTERCEPTOR_INFO_TYPE, i::AllocationType::kOld)); + auto obj = + i::Handle::cast(i_isolate->factory()->NewStruct( + i::INTERCEPTOR_INFO_TYPE, i::AllocationType::kOld)); obj->set_flags(0); - if (getter != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_getter, getter); - if (setter != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_setter, setter); - if (query != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_query, query); + if (getter != nullptr) SET_FIELD_WRAPPED(i_isolate, obj, set_getter, getter); + if (setter != nullptr) SET_FIELD_WRAPPED(i_isolate, obj, set_setter, setter); + if (query != nullptr) SET_FIELD_WRAPPED(i_isolate, obj, set_query, query); if (descriptor != nullptr) - SET_FIELD_WRAPPED(isolate, obj, set_descriptor, descriptor); - if (remover != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_deleter, remover); + SET_FIELD_WRAPPED(i_isolate, obj, set_descriptor, descriptor); + if (remover != nullptr) + SET_FIELD_WRAPPED(i_isolate, obj, set_deleter, remover); if (enumerator != nullptr) - SET_FIELD_WRAPPED(isolate, obj, set_enumerator, enumerator); - if (definer != nullptr) SET_FIELD_WRAPPED(isolate, obj, set_definer, definer); + SET_FIELD_WRAPPED(i_isolate, obj, set_enumerator, enumerator); + if (definer != nullptr) + SET_FIELD_WRAPPED(i_isolate, obj, set_definer, definer); obj->set_can_intercept_symbols( !(static_cast(flags) & static_cast(PropertyHandlerFlags::kOnlyInterceptStrings))); @@ -1784,7 +1802,7 @@ static i::Handle CreateInterceptorInfo( static_cast(PropertyHandlerFlags::kHasNoSideEffect)); if (data.IsEmpty()) { - data = v8::Undefined(reinterpret_cast(isolate)); + data = v8::Undefined(reinterpret_cast(i_isolate)); } obj->set_data(*Utils::OpenHandle(*data)); return obj; @@ -1792,46 +1810,47 @@ static i::Handle CreateInterceptorInfo( template -static i::Handle CreateNamedInterceptorInfo( - i::Isolate* isolate, Getter getter, Setter setter, Query query, +i::Handle CreateNamedInterceptorInfo( + i::Isolate* i_isolate, Getter getter, Setter setter, Query query, Descriptor descriptor, Deleter remover, Enumerator enumerator, Definer definer, Local data, PropertyHandlerFlags flags) { auto interceptor = - CreateInterceptorInfo(isolate, getter, setter, query, descriptor, remover, - enumerator, definer, data, flags); + CreateInterceptorInfo(i_isolate, getter, setter, query, descriptor, + remover, enumerator, definer, data, flags); interceptor->set_is_named(true); return interceptor; } template -static i::Handle CreateIndexedInterceptorInfo( - i::Isolate* isolate, Getter getter, Setter setter, Query query, +i::Handle CreateIndexedInterceptorInfo( + i::Isolate* i_isolate, Getter getter, Setter setter, Query query, Descriptor descriptor, Deleter remover, Enumerator enumerator, Definer definer, Local data, PropertyHandlerFlags flags) { auto interceptor = - CreateInterceptorInfo(isolate, getter, setter, query, descriptor, remover, - enumerator, definer, data, flags); + CreateInterceptorInfo(i_isolate, getter, setter, query, descriptor, + remover, enumerator, definer, data, flags); interceptor->set_is_named(false); return interceptor; } template -static void ObjectTemplateSetNamedPropertyHandler( +void ObjectTemplateSetNamedPropertyHandler( ObjectTemplate* templ, Getter getter, Setter setter, Query query, Descriptor descriptor, Deleter remover, Enumerator enumerator, Definer definer, Local data, PropertyHandlerFlags flags) { - i::Isolate* isolate = Utils::OpenHandle(templ)->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScope scope(isolate); - auto cons = EnsureConstructor(isolate, templ); + i::Isolate* i_isolate = Utils::OpenHandle(templ)->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::HandleScope scope(i_isolate); + auto cons = EnsureConstructor(i_isolate, templ); EnsureNotPublished(cons, "ObjectTemplateSetNamedPropertyHandler"); auto obj = - CreateNamedInterceptorInfo(isolate, getter, setter, query, descriptor, + CreateNamedInterceptorInfo(i_isolate, getter, setter, query, descriptor, remover, enumerator, definer, data, flags); - i::FunctionTemplateInfo::SetNamedPropertyHandler(isolate, cons, obj); + i::FunctionTemplateInfo::SetNamedPropertyHandler(i_isolate, cons, obj); } +} // namespace void ObjectTemplate::SetHandler( const NamedPropertyHandlerConfiguration& config) { @@ -1842,37 +1861,37 @@ void ObjectTemplate::SetHandler( } void ObjectTemplate::MarkAsUndetectable() { - i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScope scope(isolate); - auto cons = EnsureConstructor(isolate, this); + i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::HandleScope scope(i_isolate); + auto cons = EnsureConstructor(i_isolate, this); EnsureNotPublished(cons, "v8::ObjectTemplate::MarkAsUndetectable"); cons->set_undetectable(true); } void ObjectTemplate::SetAccessCheckCallback(AccessCheckCallback callback, Local data) { - i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScope scope(isolate); - auto cons = EnsureConstructor(isolate, this); + i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::HandleScope scope(i_isolate); + auto cons = EnsureConstructor(i_isolate, this); EnsureNotPublished(cons, "v8::ObjectTemplate::SetAccessCheckCallback"); - i::Handle struct_info = isolate->factory()->NewStruct( + i::Handle struct_info = i_isolate->factory()->NewStruct( i::ACCESS_CHECK_INFO_TYPE, i::AllocationType::kOld); i::Handle info = i::Handle::cast(struct_info); - SET_FIELD_WRAPPED(isolate, info, set_callback, callback); + SET_FIELD_WRAPPED(i_isolate, info, set_callback, callback); info->set_named_interceptor(i::Object()); info->set_indexed_interceptor(i::Object()); if (data.IsEmpty()) { - data = v8::Undefined(reinterpret_cast(isolate)); + data = v8::Undefined(reinterpret_cast(i_isolate)); } info->set_data(*Utils::OpenHandle(*data)); - i::FunctionTemplateInfo::SetAccessCheckInfo(isolate, cons, info); + i::FunctionTemplateInfo::SetAccessCheckInfo(i_isolate, cons, info); cons->set_needs_access_check(true); } @@ -1881,69 +1900,72 @@ void ObjectTemplate::SetAccessCheckCallbackAndHandler( const NamedPropertyHandlerConfiguration& named_handler, const IndexedPropertyHandlerConfiguration& indexed_handler, Local data) { - i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScope scope(isolate); - auto cons = EnsureConstructor(isolate, this); + i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::HandleScope scope(i_isolate); + auto cons = EnsureConstructor(i_isolate, this); EnsureNotPublished(cons, "v8::ObjectTemplate::SetAccessCheckCallbackWithHandler"); - i::Handle struct_info = isolate->factory()->NewStruct( + i::Handle struct_info = i_isolate->factory()->NewStruct( i::ACCESS_CHECK_INFO_TYPE, i::AllocationType::kOld); i::Handle info = i::Handle::cast(struct_info); - SET_FIELD_WRAPPED(isolate, info, set_callback, callback); + SET_FIELD_WRAPPED(i_isolate, info, set_callback, callback); auto named_interceptor = CreateNamedInterceptorInfo( - isolate, named_handler.getter, named_handler.setter, named_handler.query, - named_handler.descriptor, named_handler.deleter, named_handler.enumerator, - named_handler.definer, named_handler.data, named_handler.flags); + i_isolate, named_handler.getter, named_handler.setter, + named_handler.query, named_handler.descriptor, named_handler.deleter, + named_handler.enumerator, named_handler.definer, named_handler.data, + named_handler.flags); info->set_named_interceptor(*named_interceptor); auto indexed_interceptor = CreateIndexedInterceptorInfo( - isolate, indexed_handler.getter, indexed_handler.setter, + i_isolate, indexed_handler.getter, indexed_handler.setter, indexed_handler.query, indexed_handler.descriptor, indexed_handler.deleter, indexed_handler.enumerator, indexed_handler.definer, indexed_handler.data, indexed_handler.flags); info->set_indexed_interceptor(*indexed_interceptor); if (data.IsEmpty()) { - data = v8::Undefined(reinterpret_cast(isolate)); + data = v8::Undefined(reinterpret_cast(i_isolate)); } info->set_data(*Utils::OpenHandle(*data)); - i::FunctionTemplateInfo::SetAccessCheckInfo(isolate, cons, info); + i::FunctionTemplateInfo::SetAccessCheckInfo(i_isolate, cons, info); cons->set_needs_access_check(true); } void ObjectTemplate::SetHandler( const IndexedPropertyHandlerConfiguration& config) { - i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScope scope(isolate); - auto cons = EnsureConstructor(isolate, this); + i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::HandleScope scope(i_isolate); + auto cons = EnsureConstructor(i_isolate, this); EnsureNotPublished(cons, "v8::ObjectTemplate::SetHandler"); auto obj = CreateIndexedInterceptorInfo( - isolate, config.getter, config.setter, config.query, config.descriptor, + i_isolate, config.getter, config.setter, config.query, config.descriptor, config.deleter, config.enumerator, config.definer, config.data, config.flags); - i::FunctionTemplateInfo::SetIndexedPropertyHandler(isolate, cons, obj); + i::FunctionTemplateInfo::SetIndexedPropertyHandler(i_isolate, cons, obj); } void ObjectTemplate::SetCallAsFunctionHandler(FunctionCallback callback, Local data) { - i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - i::HandleScope scope(isolate); - auto cons = EnsureConstructor(isolate, this); + i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); + i::HandleScope scope(i_isolate); + auto cons = EnsureConstructor(i_isolate, this); EnsureNotPublished(cons, "v8::ObjectTemplate::SetCallAsFunctionHandler"); - i::Handle obj = isolate->factory()->NewCallHandlerInfo(); - SET_FIELD_WRAPPED(isolate, obj, set_callback, callback); - SET_FIELD_WRAPPED(isolate, obj, set_js_callback, obj->redirected_callback()); + i::Handle obj = + i_isolate->factory()->NewCallHandlerInfo(); + SET_FIELD_WRAPPED(i_isolate, obj, set_callback, callback); + SET_FIELD_WRAPPED(i_isolate, obj, set_js_callback, + obj->redirected_callback()); if (data.IsEmpty()) { - data = v8::Undefined(reinterpret_cast(isolate)); + data = v8::Undefined(reinterpret_cast(i_isolate)); } obj->set_data(*Utils::OpenHandle(*data)); - i::FunctionTemplateInfo::SetInstanceCallHandler(isolate, cons, obj); + i::FunctionTemplateInfo::SetInstanceCallHandler(i_isolate, cons, obj); } int ObjectTemplate::InternalFieldCount() const { @@ -1951,18 +1973,18 @@ int ObjectTemplate::InternalFieldCount() const { } void ObjectTemplate::SetInternalFieldCount(int value) { - i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); + i::Isolate* i_isolate = Utils::OpenHandle(this)->GetIsolate(); if (!Utils::ApiCheck(i::Smi::IsValid(value), "v8::ObjectTemplate::SetInternalFieldCount()", "Invalid embedder field count")) { return; } - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); if (value > 0) { // The embedder field count is set by the constructor function's // construct code, so we ensure that there is a constructor // function to do the setting. - EnsureConstructor(isolate, this); + EnsureConstructor(i_isolate, this); } Utils::OpenHandle(this)->set_embedder_field_count(value); } @@ -1973,8 +1995,8 @@ bool ObjectTemplate::IsImmutableProto() const { void ObjectTemplate::SetImmutableProto() { auto self = Utils::OpenHandle(this); - i::Isolate* isolate = self->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + i::Isolate* i_isolate = self->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); self->set_immutable_proto(true); } @@ -1984,8 +2006,8 @@ bool ObjectTemplate::IsCodeLike() const { void ObjectTemplate::SetCodeLike() { auto self = Utils::OpenHandle(this); - i::Isolate* isolate = self->GetIsolate(); - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); + i::Isolate* i_isolate = self->GetIsolate(); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); self->set_code_like(true); } @@ -2016,11 +2038,11 @@ ScriptCompiler::StreamedSource::~StreamedSource() = default; Local