From 43b2c1c64c7cbab8205242e1ebfe87a242c4c37f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 13 Jul 2020 10:39:42 +0200 Subject: [PATCH 01/19] deps: update V8 to 8.4.371.19 --- deps/v8/.gitignore | 2 + deps/v8/AUTHORS | 3 + deps/v8/BUILD.gn | 309 ++- deps/v8/COMMON_OWNERS | 2 + deps/v8/DEPS | 44 +- deps/v8/INTL_OWNERS | 1 + deps/v8/WATCHLISTS | 7 - deps/v8/build_overrides/build.gni | 8 + deps/v8/gni/v8.gni | 9 +- deps/v8/include/DEPS | 1 + deps/v8/include/cppgc/DEPS | 7 + deps/v8/include/cppgc/allocation.h | 106 +- deps/v8/include/cppgc/common.h | 26 + deps/v8/include/cppgc/custom-space.h | 62 + deps/v8/include/cppgc/garbage-collected.h | 177 +- deps/v8/include/cppgc/heap.h | 36 +- deps/v8/include/cppgc/internal/accessors.h | 26 + .../{internals.h => internal/api-constants.h} | 27 +- .../cppgc/internal/compiler-specific.h | 26 + .../cppgc/{ => internal}/finalizer-trait.h | 8 +- .../v8/include/cppgc/{ => internal}/gc-info.h | 10 +- deps/v8/include/cppgc/internal/logging.h | 50 + .../include/cppgc/internal/persistent-node.h | 109 + .../include/cppgc/internal/pointer-policies.h | 133 + .../cppgc/internal/prefinalizer-handler.h | 31 + deps/v8/include/cppgc/liveness-broker.h | 50 + deps/v8/include/cppgc/macros.h | 26 + deps/v8/include/cppgc/member.h | 206 ++ deps/v8/include/cppgc/persistent.h | 304 +++ deps/v8/include/cppgc/platform.h | 4 +- deps/v8/include/cppgc/prefinalizer.h | 54 + deps/v8/include/cppgc/source-location.h | 59 + deps/v8/include/cppgc/trace-trait.h | 67 + deps/v8/include/cppgc/type-traits.h | 109 + deps/v8/include/cppgc/visitor.h | 138 + deps/v8/include/js_protocol.pdl | 30 + deps/v8/include/libplatform/libplatform.h | 4 +- deps/v8/include/libplatform/v8-tracing.h | 56 +- deps/v8/include/v8-fast-api-calls.h | 2 +- deps/v8/include/v8-inspector-protocol.h | 8 +- deps/v8/include/v8-inspector.h | 2 +- deps/v8/include/v8-internal.h | 71 +- deps/v8/include/v8-platform.h | 163 +- deps/v8/include/v8-profiler.h | 2 +- deps/v8/include/v8-util.h | 2 +- deps/v8/include/v8-version-string.h | 2 +- deps/v8/include/v8-version.h | 6 +- deps/v8/include/v8-wasm-trap-handler-posix.h | 2 +- deps/v8/include/v8-wasm-trap-handler-win.h | 2 +- deps/v8/include/v8.h | 194 +- deps/v8/include/v8config.h | 9 + deps/v8/infra/mb/mb_config.pyl | 26 +- deps/v8/infra/testing/builders.pyl | 45 +- deps/v8/src/DEPS | 10 + deps/v8/src/api/api-arguments.h | 8 +- deps/v8/src/api/api-inl.h | 1 - deps/v8/src/api/api.cc | 395 ++- deps/v8/src/api/api.h | 15 +- deps/v8/src/asmjs/asm-js.cc | 12 +- deps/v8/src/asmjs/asm-scanner.cc | 2 +- deps/v8/src/ast/ast-value-factory.cc | 14 +- deps/v8/src/ast/ast-value-factory.h | 12 +- deps/v8/src/ast/ast.h | 20 +- deps/v8/src/ast/scopes.cc | 18 +- deps/v8/src/ast/scopes.h | 3 +- deps/v8/src/ast/source-range-ast-visitor.cc | 14 +- deps/v8/src/ast/variables.h | 5 +- deps/v8/src/base/address-region.h | 8 + deps/v8/src/base/cpu.cc | 6 +- deps/v8/src/base/platform/mutex.h | 3 +- deps/v8/src/base/platform/platform-aix.cc | 29 + deps/v8/src/base/platform/platform-posix.cc | 4 +- deps/v8/src/base/platform/platform-solaris.cc | 18 - deps/v8/src/base/platform/time.cc | 17 +- deps/v8/src/builtins/arm/builtins-arm.cc | 471 +++- deps/v8/src/builtins/arm64/builtins-arm64.cc | 445 ++- deps/v8/src/builtins/array-copywithin.tq | 141 +- deps/v8/src/builtins/array-every.tq | 239 +- deps/v8/src/builtins/array-filter.tq | 343 ++- deps/v8/src/builtins/array-find.tq | 263 +- deps/v8/src/builtins/array-findindex.tq | 265 +- deps/v8/src/builtins/array-foreach.tq | 217 +- deps/v8/src/builtins/array-from.tq | 323 ++- deps/v8/src/builtins/array-isarray.tq | 32 +- deps/v8/src/builtins/array-join.tq | 1100 ++++---- deps/v8/src/builtins/array-lastindexof.tq | 243 +- deps/v8/src/builtins/array-map.tq | 458 ++-- deps/v8/src/builtins/array-of.tq | 84 +- deps/v8/src/builtins/array-reduce-right.tq | 323 ++- deps/v8/src/builtins/array-reduce.tq | 323 ++- deps/v8/src/builtins/array-reverse.tq | 301 +-- deps/v8/src/builtins/array-shift.tq | 175 +- deps/v8/src/builtins/array-slice.tq | 379 ++- deps/v8/src/builtins/array-some.tq | 239 +- deps/v8/src/builtins/array-splice.tq | 708 ++--- deps/v8/src/builtins/array-unshift.tq | 146 +- deps/v8/src/builtins/array.tq | 129 +- deps/v8/src/builtins/base.tq | 85 +- deps/v8/src/builtins/bigint.tq | 427 ++- deps/v8/src/builtins/boolean.tq | 66 +- deps/v8/src/builtins/builtins-array.cc | 10 + .../builtins/builtins-async-function-gen.cc | 10 +- deps/v8/src/builtins/builtins-async-gen.cc | 39 +- deps/v8/src/builtins/builtins-async-gen.h | 39 +- .../builtins/builtins-async-generator-gen.cc | 34 +- deps/v8/src/builtins/builtins-call-gen.cc | 18 +- deps/v8/src/builtins/builtins-callsite.cc | 6 +- .../src/builtins/builtins-collections-gen.cc | 5 +- deps/v8/src/builtins/builtins-dataview.cc | 1 + deps/v8/src/builtins/builtins-date-gen.cc | 3 + deps/v8/src/builtins/builtins-definitions.h | 45 +- deps/v8/src/builtins/builtins-error.cc | 67 +- deps/v8/src/builtins/builtins-handler-gen.cc | 35 +- deps/v8/src/builtins/builtins-internal-gen.cc | 3 +- deps/v8/src/builtins/builtins-intl.cc | 82 +- deps/v8/src/builtins/builtins-iterator-gen.cc | 109 +- deps/v8/src/builtins/builtins-iterator-gen.h | 20 +- .../builtins/builtins-microtask-queue-gen.cc | 11 +- deps/v8/src/builtins/builtins-object-gen.cc | 66 +- deps/v8/src/builtins/builtins-promise.cc | 24 - deps/v8/src/builtins/builtins-promise.h | 12 + deps/v8/src/builtins/builtins-proxy-gen.cc | 3 +- deps/v8/src/builtins/builtins-regexp-gen.cc | 14 +- .../builtins-sharedarraybuffer-gen.cc | 2 +- deps/v8/src/builtins/builtins-string-gen.cc | 22 +- deps/v8/src/builtins/builtins-string-gen.h | 2 +- deps/v8/src/builtins/builtins-string.tq | 385 ++- deps/v8/src/builtins/builtins-trace.cc | 91 +- .../src/builtins/builtins-typed-array-gen.cc | 14 +- deps/v8/src/builtins/builtins-wasm-gen.cc | 191 +- deps/v8/src/builtins/builtins-wasm-gen.h | 35 + deps/v8/src/builtins/builtins-weak-refs.cc | 57 +- deps/v8/src/builtins/cast.tq | 81 +- deps/v8/src/builtins/collections.tq | 87 +- deps/v8/src/builtins/console.tq | 20 +- deps/v8/src/builtins/convert.tq | 7 + deps/v8/src/builtins/data-view.tq | 1489 +++++------ deps/v8/src/builtins/finalization-registry.tq | 105 + .../src/builtins/growable-fixed-array-gen.cc | 4 + .../src/builtins/growable-fixed-array-gen.h | 1 + deps/v8/src/builtins/growable-fixed-array.tq | 76 +- deps/v8/src/builtins/ia32/builtins-ia32.cc | 434 ++- deps/v8/src/builtins/ic-callable.tq | 183 ++ deps/v8/src/builtins/ic.tq | 59 + deps/v8/src/builtins/internal-coverage.tq | 57 +- deps/v8/src/builtins/iterator.tq | 177 +- deps/v8/src/builtins/math.tq | 764 +++--- deps/v8/src/builtins/mips/builtins-mips.cc | 34 +- .../v8/src/builtins/mips64/builtins-mips64.cc | 35 +- deps/v8/src/builtins/number.tq | 108 +- deps/v8/src/builtins/object-fromentries.tq | 102 +- deps/v8/src/builtins/object.tq | 336 +-- deps/v8/src/builtins/ppc/builtins-ppc.cc | 492 ++-- .../builtins/promise-abstract-operations.tq | 928 ++++--- .../builtins/promise-all-element-closure.tq | 326 ++- deps/v8/src/builtins/promise-all.tq | 659 +++-- deps/v8/src/builtins/promise-any.tq | 372 +++ deps/v8/src/builtins/promise-constructor.tq | 162 +- deps/v8/src/builtins/promise-finally.tq | 348 +-- deps/v8/src/builtins/promise-jobs.tq | 120 +- deps/v8/src/builtins/promise-misc.tq | 431 +-- deps/v8/src/builtins/promise-race.tq | 212 +- deps/v8/src/builtins/promise-reaction-job.tq | 180 +- deps/v8/src/builtins/promise-resolve.tq | 316 ++- deps/v8/src/builtins/promise-then.tq | 117 +- deps/v8/src/builtins/proxy-constructor.tq | 81 +- deps/v8/src/builtins/proxy-delete-property.tq | 104 +- deps/v8/src/builtins/proxy-get-property.tq | 97 +- .../v8/src/builtins/proxy-get-prototype-of.tq | 101 +- deps/v8/src/builtins/proxy-has-property.tq | 90 +- deps/v8/src/builtins/proxy-is-extensible.tq | 90 +- .../src/builtins/proxy-prevent-extensions.tq | 92 +- deps/v8/src/builtins/proxy-revocable.tq | 73 +- deps/v8/src/builtins/proxy-revoke.tq | 44 +- deps/v8/src/builtins/proxy-set-property.tq | 136 +- .../v8/src/builtins/proxy-set-prototype-of.tq | 112 +- deps/v8/src/builtins/proxy.tq | 32 +- deps/v8/src/builtins/reflect.tq | 154 +- deps/v8/src/builtins/regexp-exec.tq | 71 +- deps/v8/src/builtins/regexp-match-all.tq | 410 ++- deps/v8/src/builtins/regexp-match.tq | 267 +- deps/v8/src/builtins/regexp-replace.tq | 459 ++-- deps/v8/src/builtins/regexp-search.tq | 168 +- deps/v8/src/builtins/regexp-source.tq | 30 +- deps/v8/src/builtins/regexp-split.tq | 102 +- deps/v8/src/builtins/regexp-test.tq | 45 +- deps/v8/src/builtins/regexp.tq | 716 +++-- deps/v8/src/builtins/string-endswith.tq | 119 +- deps/v8/src/builtins/string-html.tq | 215 +- deps/v8/src/builtins/string-iterator.tq | 72 +- deps/v8/src/builtins/string-pad.tq | 172 +- deps/v8/src/builtins/string-repeat.tq | 106 +- deps/v8/src/builtins/string-replaceall.tq | 374 ++- deps/v8/src/builtins/string-slice.tq | 47 +- deps/v8/src/builtins/string-startswith.tq | 103 +- deps/v8/src/builtins/string-substr.tq | 61 +- deps/v8/src/builtins/string-substring.tq | 40 +- deps/v8/src/builtins/symbol.tq | 74 +- deps/v8/src/builtins/torque-internal.tq | 309 +-- .../builtins/typed-array-createtypedarray.tq | 767 +++--- deps/v8/src/builtins/typed-array-every.tq | 81 +- deps/v8/src/builtins/typed-array-filter.tq | 130 +- deps/v8/src/builtins/typed-array-find.tq | 81 +- deps/v8/src/builtins/typed-array-findindex.tq | 86 +- deps/v8/src/builtins/typed-array-foreach.tq | 79 +- deps/v8/src/builtins/typed-array-from.tq | 329 ++- deps/v8/src/builtins/typed-array-of.tq | 90 +- deps/v8/src/builtins/typed-array-reduce.tq | 98 +- .../src/builtins/typed-array-reduceright.tq | 104 +- deps/v8/src/builtins/typed-array-set.tq | 573 ++-- deps/v8/src/builtins/typed-array-slice.tq | 177 +- deps/v8/src/builtins/typed-array-some.tq | 81 +- deps/v8/src/builtins/typed-array-sort.tq | 227 +- deps/v8/src/builtins/typed-array-subarray.tq | 112 +- deps/v8/src/builtins/typed-array.tq | 464 ++-- deps/v8/src/builtins/wasm.tq | 273 ++ deps/v8/src/builtins/x64/builtins-x64.cc | 53 +- deps/v8/src/codegen/arm/constants-arm.h | 17 - deps/v8/src/codegen/arm/cpu-arm.cc | 13 - .../codegen/arm/interface-descriptors-arm.cc | 24 + .../v8/src/codegen/arm/macro-assembler-arm.cc | 33 +- deps/v8/src/codegen/arm/macro-assembler-arm.h | 18 + deps/v8/src/codegen/arm/register-arm.h | 2 + .../src/codegen/arm64/assembler-arm64-inl.h | 1 + deps/v8/src/codegen/arm64/assembler-arm64.cc | 4 +- .../src/codegen/arm64/instructions-arm64.cc | 13 +- .../v8/src/codegen/arm64/instructions-arm64.h | 5 +- .../arm64/interface-descriptors-arm64.cc | 24 + .../codegen/arm64/macro-assembler-arm64-inl.h | 2 +- .../codegen/arm64/macro-assembler-arm64.cc | 66 +- .../src/codegen/arm64/macro-assembler-arm64.h | 13 +- deps/v8/src/codegen/arm64/register-arm64.h | 9 +- deps/v8/src/codegen/assembler.cc | 1 - deps/v8/src/codegen/code-stub-assembler.cc | 409 +-- deps/v8/src/codegen/code-stub-assembler.h | 225 +- deps/v8/src/codegen/compiler.cc | 1142 ++++---- deps/v8/src/codegen/compiler.h | 116 +- .../external-reference-encoder.cc} | 81 +- .../src/codegen/external-reference-encoder.h | 60 + deps/v8/src/codegen/external-reference.cc | 4 + deps/v8/src/codegen/external-reference.h | 2 + deps/v8/src/codegen/ia32/assembler-ia32.cc | 43 + deps/v8/src/codegen/ia32/assembler-ia32.h | 11 + .../ia32/interface-descriptors-ia32.cc | 40 + .../src/codegen/ia32/macro-assembler-ia32.cc | 27 +- .../src/codegen/ia32/macro-assembler-ia32.h | 15 + deps/v8/src/codegen/ia32/register-ia32.h | 2 + deps/v8/src/codegen/interface-descriptors.cc | 28 +- deps/v8/src/codegen/interface-descriptors.h | 122 +- .../mips/interface-descriptors-mips.cc | 24 + .../src/codegen/mips/macro-assembler-mips.cc | 2 +- deps/v8/src/codegen/mips/register-mips.h | 2 + .../v8/src/codegen/mips64/assembler-mips64.cc | 76 +- .../mips64/interface-descriptors-mips64.cc | 24 + .../codegen/mips64/macro-assembler-mips64.cc | 6 +- deps/v8/src/codegen/mips64/register-mips64.h | 32 +- .../src/codegen/optimized-compilation-info.cc | 4 +- .../src/codegen/optimized-compilation-info.h | 7 + deps/v8/src/codegen/ppc/assembler-ppc-inl.h | 83 +- deps/v8/src/codegen/ppc/assembler-ppc.cc | 28 +- deps/v8/src/codegen/ppc/assembler-ppc.h | 43 +- deps/v8/src/codegen/ppc/constants-ppc.h | 33 +- .../codegen/ppc/interface-descriptors-ppc.cc | 24 + .../v8/src/codegen/ppc/macro-assembler-ppc.cc | 275 +- deps/v8/src/codegen/ppc/macro-assembler-ppc.h | 129 +- deps/v8/src/codegen/ppc/register-ppc.h | 2 + deps/v8/src/codegen/reloc-info.cc | 3 +- .../s390/interface-descriptors-s390.cc | 24 + .../src/codegen/s390/macro-assembler-s390.cc | 2 +- deps/v8/src/codegen/s390/register-s390.h | 2 + deps/v8/src/codegen/tnode.h | 6 + deps/v8/src/codegen/turbo-assembler.cc | 2 +- .../codegen/unoptimized-compilation-info.cc | 11 +- .../codegen/unoptimized-compilation-info.h | 37 +- deps/v8/src/codegen/x64/assembler-x64.cc | 18 + deps/v8/src/codegen/x64/assembler-x64.h | 3 + .../codegen/x64/interface-descriptors-x64.cc | 35 + .../v8/src/codegen/x64/macro-assembler-x64.cc | 11 +- deps/v8/src/codegen/x64/macro-assembler-x64.h | 10 +- deps/v8/src/codegen/x64/register-x64.h | 2 + deps/v8/src/common/external-pointer-inl.h | 32 + deps/v8/src/common/external-pointer.h | 33 + deps/v8/src/common/globals.h | 24 +- deps/v8/src/common/message-template.h | 12 +- deps/v8/src/common/ptr-compr-inl.h | 10 + .../compiler-dispatcher.cc | 3 +- .../compiler-dispatcher/compiler-dispatcher.h | 1 - deps/v8/src/compiler/OWNERS | 3 +- deps/v8/src/compiler/access-builder.cc | 16 +- deps/v8/src/compiler/access-info.cc | 10 +- .../backend/arm/code-generator-arm.cc | 29 +- .../backend/arm/instruction-selector-arm.cc | 31 +- .../backend/arm64/code-generator-arm64.cc | 58 +- .../backend/arm64/instruction-codes-arm64.h | 6 + .../arm64/instruction-scheduler-arm64.cc | 6 + .../arm64/instruction-selector-arm64.cc | 56 +- .../v8/src/compiler/backend/code-generator.cc | 8 +- deps/v8/src/compiler/backend/code-generator.h | 17 +- .../backend/ia32/code-generator-ia32.cc | 106 +- .../backend/ia32/instruction-codes-ia32.h | 8 + .../ia32/instruction-scheduler-ia32.cc | 8 + .../backend/ia32/instruction-selector-ia32.cc | 47 +- .../compiler/backend/instruction-selector.cc | 36 +- .../backend/mips/code-generator-mips.cc | 4 +- .../backend/mips/instruction-selector-mips.cc | 2 + .../backend/mips64/code-generator-mips64.cc | 292 +- .../backend/mips64/instruction-codes-mips64.h | 3 + .../mips64/instruction-scheduler-mips64.cc | 3 + .../mips64/instruction-selector-mips64.cc | 27 +- .../backend/ppc/code-generator-ppc.cc | 206 +- .../backend/ppc/instruction-codes-ppc.h | 22 +- .../backend/ppc/instruction-scheduler-ppc.cc | 20 + .../backend/ppc/instruction-selector-ppc.cc | 98 +- .../compiler/backend/register-allocator.cc | 65 +- .../src/compiler/backend/register-allocator.h | 21 +- .../backend/s390/code-generator-s390.cc | 7 +- .../backend/s390/instruction-selector-s390.cc | 4 + .../backend/x64/code-generator-x64.cc | 292 +- .../backend/x64/instruction-codes-x64.h | 9 + .../backend/x64/instruction-scheduler-x64.cc | 9 + .../backend/x64/instruction-selector-x64.cc | 58 +- deps/v8/src/compiler/code-assembler.cc | 18 + deps/v8/src/compiler/code-assembler.h | 11 +- .../src/compiler/common-operator-reducer.cc | 3 +- .../src/compiler/compilation-dependencies.cc | 9 +- .../src/compiler/effect-control-linearizer.cc | 74 +- deps/v8/src/compiler/graph-assembler.cc | 96 +- deps/v8/src/compiler/graph-assembler.h | 14 +- deps/v8/src/compiler/graph-reducer.cc | 11 +- deps/v8/src/compiler/graph-reducer.h | 4 + deps/v8/src/compiler/heap-refs.h | 86 +- deps/v8/src/compiler/int64-lowering.cc | 67 +- deps/v8/src/compiler/js-call-reducer.cc | 244 +- deps/v8/src/compiler/js-call-reducer.h | 9 +- deps/v8/src/compiler/js-generic-lowering.cc | 2 +- deps/v8/src/compiler/js-heap-broker.cc | 77 +- deps/v8/src/compiler/js-inlining-heuristic.cc | 22 +- deps/v8/src/compiler/js-inlining-heuristic.h | 4 + .../js-native-context-specialization.cc | 81 +- deps/v8/src/compiler/js-type-hint-lowering.cc | 7 + deps/v8/src/compiler/js-typed-lowering.cc | 72 +- deps/v8/src/compiler/linkage.cc | 35 +- .../src/compiler/machine-operator-reducer.cc | 350 ++- .../src/compiler/machine-operator-reducer.h | 17 + deps/v8/src/compiler/machine-operator.cc | 1053 ++++---- deps/v8/src/compiler/machine-operator.h | 54 +- deps/v8/src/compiler/memory-lowering.cc | 39 +- deps/v8/src/compiler/memory-lowering.h | 7 +- deps/v8/src/compiler/memory-optimizer.cc | 18 +- deps/v8/src/compiler/node-matchers.h | 3 +- deps/v8/src/compiler/node-properties.cc | 15 + deps/v8/src/compiler/node-properties.h | 5 + deps/v8/src/compiler/node.cc | 32 +- deps/v8/src/compiler/node.h | 5 +- deps/v8/src/compiler/opcodes.h | 6 + deps/v8/src/compiler/operation-typer.cc | 39 +- deps/v8/src/compiler/operator-properties.cc | 2 +- deps/v8/src/compiler/operator.h | 2 - deps/v8/src/compiler/pipeline-statistics.cc | 2 +- deps/v8/src/compiler/pipeline.cc | 17 +- deps/v8/src/compiler/raw-machine-assembler.h | 6 + .../v8/src/compiler/redundancy-elimination.cc | 12 +- deps/v8/src/compiler/representation-change.cc | 16 +- deps/v8/src/compiler/schedule.cc | 24 +- .../serializer-for-background-compilation.cc | 20 + deps/v8/src/compiler/simd-scalar-lowering.cc | 44 +- deps/v8/src/compiler/simplified-lowering.cc | 1946 +++++++------- deps/v8/src/compiler/simplified-operator.cc | 94 +- deps/v8/src/compiler/simplified-operator.h | 27 +- deps/v8/src/compiler/typed-optimization.cc | 48 +- deps/v8/src/compiler/typed-optimization.h | 2 + deps/v8/src/compiler/types.cc | 9 +- deps/v8/src/compiler/types.h | 8 +- deps/v8/src/compiler/verifier.cc | 2 + deps/v8/src/compiler/wasm-compiler.cc | 991 ++++--- deps/v8/src/compiler/wasm-compiler.h | 46 +- deps/v8/src/d8/d8-platforms.cc | 14 +- deps/v8/src/d8/d8-platforms.h | 8 + deps/v8/src/d8/d8.cc | 141 +- deps/v8/src/d8/d8.h | 4 +- deps/v8/src/debug/debug-evaluate.cc | 8 +- deps/v8/src/debug/debug-frames.cc | 9 - deps/v8/src/debug/debug-frames.h | 3 +- deps/v8/src/debug/debug-interface.h | 32 +- deps/v8/src/debug/debug-scope-iterator.cc | 41 +- deps/v8/src/debug/debug-scope-iterator.h | 6 +- deps/v8/src/debug/debug-scopes.cc | 104 +- deps/v8/src/debug/debug-scopes.h | 7 +- .../src/debug/debug-stack-trace-iterator.cc | 33 +- .../v8/src/debug/debug-stack-trace-iterator.h | 2 + deps/v8/src/debug/debug.cc | 68 +- deps/v8/src/debug/debug.h | 5 + deps/v8/src/debug/liveedit.cc | 17 +- deps/v8/src/debug/ppc/debug-ppc.cc | 3 +- deps/v8/src/debug/wasm/gdb-server/OWNERS | 3 + .../debug/wasm/gdb-server/gdb-remote-util.cc | 104 + .../debug/wasm/gdb-server/gdb-remote-util.h | 72 + .../wasm/gdb-server/gdb-server-thread.cc | 2 +- .../debug/wasm/gdb-server/gdb-server-thread.h | 4 +- .../src/debug/wasm/gdb-server/gdb-server.cc | 400 ++- .../v8/src/debug/wasm/gdb-server/gdb-server.h | 166 +- deps/v8/src/debug/wasm/gdb-server/packet.cc | 364 +++ deps/v8/src/debug/wasm/gdb-server/packet.h | 105 + deps/v8/src/debug/wasm/gdb-server/session.cc | 108 +- deps/v8/src/debug/wasm/gdb-server/session.h | 32 +- deps/v8/src/debug/wasm/gdb-server/target.cc | 636 ++++- deps/v8/src/debug/wasm/gdb-server/target.h | 87 +- .../v8/src/debug/wasm/gdb-server/transport.cc | 101 +- deps/v8/src/debug/wasm/gdb-server/transport.h | 102 +- deps/v8/src/debug/wasm/gdb-server/util.h | 27 - .../wasm/gdb-server/wasm-module-debug.cc | 388 +++ .../debug/wasm/gdb-server/wasm-module-debug.h | 105 + deps/v8/src/deoptimizer/deoptimizer.cc | 303 ++- deps/v8/src/deoptimizer/deoptimizer.h | 32 +- .../v8/src/deoptimizer/ppc/deoptimizer-ppc.cc | 23 +- deps/v8/src/diagnostics/arm64/disasm-arm64.cc | 21 +- deps/v8/src/diagnostics/disassembler.cc | 14 +- deps/v8/src/diagnostics/ia32/disasm-ia32.cc | 17 + deps/v8/src/diagnostics/objects-debug.cc | 53 +- deps/v8/src/diagnostics/objects-printer.cc | 169 +- deps/v8/src/diagnostics/ppc/disasm-ppc.cc | 43 + .../src/diagnostics/unwinding-info-win64.cc | 31 - deps/v8/src/diagnostics/x64/disasm-x64.cc | 9 +- deps/v8/src/execution/arm/simulator-arm.cc | 4 +- deps/v8/src/execution/frame-constants.h | 4 +- deps/v8/src/execution/frames-inl.h | 8 +- deps/v8/src/execution/frames.cc | 237 +- deps/v8/src/execution/frames.h | 127 +- deps/v8/src/execution/futex-emulation.cc | 14 +- deps/v8/src/execution/isolate.cc | 128 +- deps/v8/src/execution/isolate.h | 33 +- deps/v8/src/execution/messages.cc | 95 +- deps/v8/src/execution/messages.h | 12 +- .../v8/src/execution/off-thread-isolate-inl.h | 22 + deps/v8/src/execution/off-thread-isolate.cc | 129 +- deps/v8/src/execution/off-thread-isolate.h | 95 +- .../src/execution/ppc/frame-constants-ppc.h | 4 +- deps/v8/src/execution/ppc/simulator-ppc.cc | 4 +- deps/v8/src/execution/ppc/simulator-ppc.h | 2 +- deps/v8/src/execution/protectors-inl.h | 9 +- deps/v8/src/execution/protectors.cc | 33 +- deps/v8/src/execution/protectors.h | 15 +- deps/v8/src/extensions/gc-extension.cc | 13 +- deps/v8/src/flags/flag-definitions.h | 112 +- deps/v8/src/handles/global-handles.cc | 3 +- deps/v8/src/handles/handles.h | 2 +- deps/v8/src/handles/persistent-handles.cc | 122 + deps/v8/src/handles/persistent-handles.h | 88 + deps/v8/src/heap/OWNERS | 1 + deps/v8/src/heap/array-buffer-tracker.cc | 1 + deps/v8/src/heap/code-stats.cc | 1 + deps/v8/src/heap/concurrent-allocator-inl.h | 86 + deps/v8/src/heap/concurrent-allocator.cc | 43 + deps/v8/src/heap/concurrent-allocator.h | 57 + deps/v8/src/heap/concurrent-marking.cc | 1 + deps/v8/src/heap/concurrent-marking.h | 1 + deps/v8/src/heap/cppgc/allocation.cc | 11 + .../heap/cppgc/asm/arm/push_registers_asm.cc | 39 + .../cppgc/asm/arm64/push_registers_asm.cc | 52 + .../cppgc/asm/arm64/push_registers_masm.S | 32 + .../heap/cppgc/asm/ia32/push_registers_asm.cc | 53 + .../heap/cppgc/asm/ia32/push_registers_masm.S | 48 + .../heap/cppgc/asm/mips/push_registers_asm.cc | 48 + .../cppgc/asm/mips64/push_registers_asm.cc | 48 + .../heap/cppgc/asm/ppc/push_registers_asm.cc | 94 + .../heap/cppgc/asm/s390/push_registers_asm.cc | 35 + .../src/heap/cppgc/asm/x64/push_registers.S | 52 - .../heap/cppgc/asm/x64/push_registers_asm.cc | 94 + ..._registers_win.S => push_registers_masm.S} | 0 deps/v8/src/heap/cppgc/free-list.cc | 190 ++ deps/v8/src/heap/cppgc/free-list.h | 62 + deps/v8/src/heap/cppgc/gc-info-table.cc | 2 +- deps/v8/src/heap/cppgc/gc-info-table.h | 2 +- deps/v8/src/heap/cppgc/gc-info.cc | 2 +- deps/v8/src/heap/cppgc/globals.h | 9 + deps/v8/src/heap/cppgc/heap-inl.h | 35 +- .../src/heap/cppgc/heap-object-header-inl.h | 15 +- deps/v8/src/heap/cppgc/heap-object-header.cc | 4 +- deps/v8/src/heap/cppgc/heap-object-header.h | 14 +- deps/v8/src/heap/cppgc/heap-page.cc | 201 ++ deps/v8/src/heap/cppgc/heap-page.h | 181 ++ deps/v8/src/heap/cppgc/heap-space.cc | 58 + deps/v8/src/heap/cppgc/heap-space.h | 127 + deps/v8/src/heap/cppgc/heap-visitor.h | 88 + deps/v8/src/heap/cppgc/heap.cc | 122 +- deps/v8/src/heap/cppgc/heap.h | 123 +- deps/v8/src/heap/cppgc/liveness-broker.cc | 15 + deps/v8/src/heap/cppgc/logging.cc | 29 + deps/v8/src/heap/cppgc/marker.cc | 152 ++ deps/v8/src/heap/cppgc/marker.h | 121 + deps/v8/src/heap/cppgc/marking-visitor.cc | 143 + deps/v8/src/heap/cppgc/marking-visitor.h | 70 + deps/v8/src/heap/cppgc/object-allocator-inl.h | 74 + deps/v8/src/heap/cppgc/object-allocator.cc | 87 + deps/v8/src/heap/cppgc/object-allocator.h | 40 + .../src/heap/cppgc/object-start-bitmap-inl.h | 95 + deps/v8/src/heap/cppgc/object-start-bitmap.h | 80 + deps/v8/src/heap/cppgc/page-memory-inl.h | 57 + deps/v8/src/heap/cppgc/page-memory.cc | 211 ++ deps/v8/src/heap/cppgc/page-memory.h | 237 ++ deps/v8/src/heap/cppgc/persistent-node.cc | 60 + deps/v8/src/heap/cppgc/pointer-policies.cc | 35 + .../v8/src/heap/cppgc/prefinalizer-handler.cc | 66 + deps/v8/src/heap/cppgc/prefinalizer-handler.h | 44 + deps/v8/src/heap/cppgc/raw-heap.cc | 32 + deps/v8/src/heap/cppgc/raw-heap.h | 106 + deps/v8/src/heap/cppgc/sanitizers.h | 39 + deps/v8/src/heap/cppgc/source-location.cc | 16 + deps/v8/src/heap/cppgc/stack.cc | 49 +- deps/v8/src/heap/cppgc/stack.h | 12 +- deps/v8/src/heap/cppgc/sweeper.cc | 213 ++ deps/v8/src/heap/cppgc/sweeper.h | 38 + deps/v8/src/heap/cppgc/visitor.h | 23 + deps/v8/src/heap/cppgc/worklist.h | 473 ++++ deps/v8/src/heap/embedder-tracing.cc | 12 +- deps/v8/src/heap/embedder-tracing.h | 5 +- deps/v8/src/heap/factory-base.cc | 5 +- deps/v8/src/heap/factory.cc | 129 +- deps/v8/src/heap/factory.h | 45 +- .../finalization-registry-cleanup-task.cc | 14 +- deps/v8/src/heap/gc-tracer.cc | 28 +- deps/v8/src/heap/gc-tracer.h | 11 +- deps/v8/src/heap/heap-inl.h | 4 +- deps/v8/src/heap/heap.cc | 896 ++++--- deps/v8/src/heap/heap.h | 117 +- deps/v8/src/heap/incremental-marking-job.cc | 17 +- deps/v8/src/heap/incremental-marking-job.h | 9 +- deps/v8/src/heap/incremental-marking.cc | 136 +- deps/v8/src/heap/incremental-marking.h | 9 +- deps/v8/src/heap/invalidated-slots.cc | 2 + deps/v8/src/heap/large-spaces.cc | 547 ++++ deps/v8/src/heap/large-spaces.h | 232 ++ deps/v8/src/{base => heap}/list.h | 24 +- deps/v8/src/heap/local-allocator-inl.h | 42 +- deps/v8/src/heap/local-allocator.h | 15 +- deps/v8/src/heap/local-heap.cc | 46 +- deps/v8/src/heap/local-heap.h | 28 +- deps/v8/src/heap/mark-compact-inl.h | 5 +- deps/v8/src/heap/mark-compact.cc | 68 +- deps/v8/src/heap/mark-compact.h | 1 + deps/v8/src/heap/marking-visitor-inl.h | 37 +- deps/v8/src/heap/marking-visitor.h | 1 + deps/v8/src/heap/marking.cc | 16 +- deps/v8/src/heap/marking.h | 16 +- deps/v8/src/heap/memory-chunk-inl.h | 50 + deps/v8/src/heap/memory-chunk.cc | 157 ++ deps/v8/src/heap/memory-chunk.h | 471 ++++ deps/v8/src/heap/object-stats.cc | 5 +- deps/v8/src/heap/objects-visiting-inl.h | 16 - deps/v8/src/heap/objects-visiting.h | 12 +- deps/v8/src/heap/off-thread-factory.cc | 192 +- deps/v8/src/heap/off-thread-factory.h | 17 - deps/v8/src/heap/off-thread-heap.cc | 241 ++ deps/v8/src/heap/off-thread-heap.h | 52 + deps/v8/src/heap/read-only-heap.cc | 138 +- deps/v8/src/heap/read-only-heap.h | 42 +- deps/v8/src/heap/read-only-spaces.cc | 172 ++ deps/v8/src/heap/read-only-spaces.h | 125 + ...{remembered-set.h => remembered-set-inl.h} | 56 +- deps/v8/src/heap/safepoint.cc | 41 +- deps/v8/src/heap/safepoint.h | 26 +- deps/v8/src/heap/scavenge-job.cc | 5 +- deps/v8/src/heap/scavenger-inl.h | 4 +- deps/v8/src/heap/scavenger.cc | 55 +- deps/v8/src/heap/scavenger.h | 7 +- deps/v8/src/heap/setup-heap-internal.cc | 172 +- deps/v8/src/heap/slot-set.h | 32 +- deps/v8/src/heap/spaces-inl.h | 55 +- deps/v8/src/heap/spaces.cc | 948 +------ deps/v8/src/heap/spaces.h | 784 +----- deps/v8/src/heap/sweeper.cc | 221 +- deps/v8/src/heap/sweeper.h | 35 +- deps/v8/src/heap/third-party/heap-api-stub.cc | 53 + deps/v8/src/ic/accessor-assembler.cc | 7 +- deps/v8/src/ic/ic.cc | 46 +- deps/v8/src/ic/keyed-store-generic.cc | 30 +- deps/v8/src/init/bootstrapper.cc | 547 ++-- deps/v8/src/init/bootstrapper.h | 14 + deps/v8/src/init/heap-symbols.h | 4 + deps/v8/src/init/v8.cc | 3 + deps/v8/src/inspector/BUILD.gn | 29 +- deps/v8/src/inspector/search-util.cc | 4 +- deps/v8/src/inspector/string-16.h | 2 +- deps/v8/src/inspector/string-util.cc | 86 + deps/v8/src/inspector/string-util.h | 11 +- deps/v8/src/inspector/v8-console.cc | 36 +- deps/v8/src/inspector/v8-console.h | 2 +- .../src/inspector/v8-debugger-agent-impl.cc | 94 +- .../v8/src/inspector/v8-debugger-agent-impl.h | 5 + deps/v8/src/inspector/v8-debugger-script.cc | 15 + deps/v8/src/inspector/v8-debugger-script.h | 3 + deps/v8/src/inspector/value-mirror.cc | 4 + deps/v8/src/interpreter/bytecode-generator.cc | 85 +- deps/v8/src/interpreter/bytecode-generator.h | 2 +- .../src/interpreter/interpreter-assembler.cc | 168 +- .../src/interpreter/interpreter-generator.cc | 14 +- deps/v8/src/interpreter/interpreter.cc | 17 +- deps/v8/src/libplatform/default-job.cc | 150 ++ deps/v8/src/libplatform/default-job.h | 126 + deps/v8/src/libplatform/default-platform.cc | 59 +- deps/v8/src/libplatform/default-platform.h | 14 +- .../tracing/json-trace-event-listener.cc | 168 -- .../tracing/json-trace-event-listener.h | 46 - .../libplatform/tracing/tracing-controller.cc | 201 +- deps/v8/src/logging/counters-definitions.h | 8 +- deps/v8/src/logging/counters.h | 4 +- deps/v8/src/logging/log.cc | 9 +- deps/v8/src/logging/log.h | 2 +- deps/v8/src/objects/allocation-site-inl.h | 3 +- deps/v8/src/objects/allocation-site.h | 12 +- deps/v8/src/objects/allocation-site.tq | 2 + deps/v8/src/objects/api-callbacks-inl.h | 23 +- deps/v8/src/objects/api-callbacks.h | 35 +- deps/v8/src/objects/api-callbacks.tq | 18 +- deps/v8/src/objects/arguments.h | 3 - deps/v8/src/objects/arguments.tq | 293 +- deps/v8/src/objects/backing-store.cc | 56 +- deps/v8/src/objects/backing-store.h | 12 +- deps/v8/src/objects/cell.h | 3 - deps/v8/src/objects/cell.tq | 1 + .../objects/class-definitions-tq-deps-inl.h | 44 + deps/v8/src/objects/code-inl.h | 29 + deps/v8/src/objects/code.cc | 8 +- deps/v8/src/objects/code.h | 42 +- deps/v8/src/objects/contexts-inl.h | 14 +- deps/v8/src/objects/contexts.h | 54 +- deps/v8/src/objects/contexts.tq | 19 +- deps/v8/src/objects/debug-objects-inl.h | 3 + deps/v8/src/objects/debug-objects.h | 11 +- deps/v8/src/objects/debug-objects.tq | 13 + deps/v8/src/objects/descriptor-array-inl.h | 5 +- deps/v8/src/objects/descriptor-array.h | 11 +- deps/v8/src/objects/descriptor-array.tq | 1 + deps/v8/src/objects/elements-kind.h | 8 + deps/v8/src/objects/embedder-data-slot-inl.h | 22 +- deps/v8/src/objects/embedder-data-slot.h | 12 +- deps/v8/src/objects/feedback-vector.cc | 20 +- deps/v8/src/objects/feedback-vector.h | 2 +- deps/v8/src/objects/feedback-vector.tq | 4 +- deps/v8/src/objects/field-type.cc | 9 + deps/v8/src/objects/field-type.h | 1 + deps/v8/src/objects/fixed-array-inl.h | 93 +- deps/v8/src/objects/fixed-array.h | 121 +- deps/v8/src/objects/fixed-array.tq | 36 +- deps/v8/src/objects/foreign-inl.h | 18 +- deps/v8/src/objects/foreign.h | 20 +- deps/v8/src/objects/foreign.tq | 3 +- deps/v8/src/objects/frame-array-inl.h | 14 +- deps/v8/src/objects/frame-array.h | 17 +- deps/v8/src/objects/free-space-inl.h | 3 +- deps/v8/src/objects/free-space.h | 13 +- deps/v8/src/objects/free-space.tq | 1 + deps/v8/src/objects/function-kind.h | 4 + deps/v8/src/objects/heap-number-inl.h | 10 +- deps/v8/src/objects/heap-number.h | 13 +- deps/v8/src/objects/heap-number.tq | 5 +- deps/v8/src/objects/heap-object.h | 2 +- deps/v8/src/objects/intl-objects.cc | 17 +- deps/v8/src/objects/intl-objects.h | 33 +- deps/v8/src/objects/intl-objects.tq | 11 + deps/v8/src/objects/js-aggregate-error-inl.h | 25 + deps/v8/src/objects/js-aggregate-error.h | 27 + deps/v8/src/objects/js-aggregate-error.tq | 81 + deps/v8/src/objects/js-array-buffer-inl.h | 104 +- deps/v8/src/objects/js-array-buffer.cc | 13 +- deps/v8/src/objects/js-array-buffer.h | 119 +- deps/v8/src/objects/js-array-buffer.tq | 16 +- deps/v8/src/objects/js-array.tq | 3 +- deps/v8/src/objects/js-break-iterator-inl.h | 10 +- deps/v8/src/objects/js-break-iterator.cc | 4 +- deps/v8/src/objects/js-break-iterator.h | 20 +- deps/v8/src/objects/js-collator-inl.h | 5 +- deps/v8/src/objects/js-collator.cc | 25 +- deps/v8/src/objects/js-collator.h | 11 +- deps/v8/src/objects/js-collection.h | 2 - deps/v8/src/objects/js-date-time-format-inl.h | 7 +- deps/v8/src/objects/js-date-time-format.cc | 214 +- deps/v8/src/objects/js-date-time-format.h | 14 +- deps/v8/src/objects/js-display-names-inl.h | 7 +- deps/v8/src/objects/js-display-names.cc | 29 +- deps/v8/src/objects/js-display-names.h | 15 +- deps/v8/src/objects/js-list-format-inl.h | 6 +- deps/v8/src/objects/js-list-format.cc | 3 +- deps/v8/src/objects/js-list-format.h | 16 +- deps/v8/src/objects/js-locale-inl.h | 4 +- deps/v8/src/objects/js-locale.cc | 61 +- deps/v8/src/objects/js-locale.h | 18 +- deps/v8/src/objects/js-number-format-inl.h | 6 +- deps/v8/src/objects/js-number-format.cc | 45 +- deps/v8/src/objects/js-number-format.h | 14 +- deps/v8/src/objects/js-objects-inl.h | 6 +- deps/v8/src/objects/js-objects.cc | 57 +- deps/v8/src/objects/js-objects.h | 14 +- deps/v8/src/objects/js-objects.tq | 3 +- deps/v8/src/objects/js-plural-rules-inl.h | 6 +- deps/v8/src/objects/js-plural-rules.cc | 1 - deps/v8/src/objects/js-plural-rules.h | 13 +- deps/v8/src/objects/js-promise-inl.h | 4 +- deps/v8/src/objects/js-promise.h | 12 +- deps/v8/src/objects/js-promise.tq | 26 +- deps/v8/src/objects/js-regexp-inl.h | 7 +- .../objects/js-regexp-string-iterator-inl.h | 6 +- .../src/objects/js-regexp-string-iterator.h | 5 +- .../src/objects/js-regexp-string-iterator.tq | 8 +- deps/v8/src/objects/js-regexp.h | 11 +- .../src/objects/js-relative-time-format-inl.h | 7 +- deps/v8/src/objects/js-relative-time-format.h | 20 +- deps/v8/src/objects/js-segment-iterator-inl.h | 6 +- deps/v8/src/objects/js-segment-iterator.h | 15 +- deps/v8/src/objects/js-segmenter-inl.h | 6 +- deps/v8/src/objects/js-segmenter.cc | 4 +- deps/v8/src/objects/js-segmenter.h | 17 +- deps/v8/src/objects/js-weak-refs-inl.h | 72 +- deps/v8/src/objects/js-weak-refs.h | 40 +- deps/v8/src/objects/js-weak-refs.tq | 17 +- deps/v8/src/objects/layout-descriptor-inl.h | 1 + deps/v8/src/objects/lookup.cc | 52 +- deps/v8/src/objects/managed.h | 5 +- deps/v8/src/objects/map-inl.h | 3 + deps/v8/src/objects/map.cc | 69 +- deps/v8/src/objects/map.h | 38 +- deps/v8/src/objects/maybe-object-inl.h | 31 +- deps/v8/src/objects/maybe-object.h | 5 +- deps/v8/src/objects/object-list-macros.h | 8 +- .../objects/objects-body-descriptors-inl.h | 99 +- .../v8/src/objects/objects-body-descriptors.h | 89 +- deps/v8/src/objects/objects-definitions.h | 12 +- deps/v8/src/objects/objects.cc | 212 +- deps/v8/src/objects/objects.h | 1 + deps/v8/src/objects/ordered-hash-table.cc | 21 - deps/v8/src/objects/ordered-hash-table.h | 7 - deps/v8/src/objects/promise.tq | 2 +- deps/v8/src/objects/script.h | 6 +- .../v8/src/objects/shared-function-info-inl.h | 2 + deps/v8/src/objects/source-text-module.cc | 10 + deps/v8/src/objects/source-text-module.h | 5 + deps/v8/src/objects/string-inl.h | 105 +- deps/v8/src/objects/string-table.h | 2 +- deps/v8/src/objects/string.cc | 12 +- deps/v8/src/objects/string.h | 46 +- deps/v8/src/objects/string.tq | 11 +- deps/v8/src/objects/visitors.h | 46 +- deps/v8/src/parsing/expression-scope.h | 37 +- deps/v8/src/parsing/parse-info.cc | 360 +-- deps/v8/src/parsing/parse-info.h | 434 ++- deps/v8/src/parsing/parser-base.h | 127 +- deps/v8/src/parsing/parser.cc | 192 +- deps/v8/src/parsing/parser.h | 35 +- deps/v8/src/parsing/parsing.cc | 72 +- .../pending-compilation-error-handler.cc | 111 +- .../pending-compilation-error-handler.h | 54 +- deps/v8/src/parsing/preparse-data-impl.h | 9 +- deps/v8/src/parsing/preparse-data.cc | 14 +- deps/v8/src/parsing/preparse-data.h | 7 +- deps/v8/src/parsing/preparser.cc | 9 +- deps/v8/src/parsing/preparser.h | 11 +- deps/v8/src/parsing/rewriter.cc | 19 +- deps/v8/src/parsing/scanner-inl.h | 16 +- deps/v8/src/parsing/scanner.cc | 15 +- deps/v8/src/parsing/scanner.h | 23 +- deps/v8/src/parsing/token.h | 10 +- deps/v8/src/profiler/cpu-profiler.cc | 13 +- deps/v8/src/profiler/cpu-profiler.h | 43 +- deps/v8/src/profiler/heap-profiler.cc | 19 +- .../src/profiler/heap-snapshot-generator.cc | 6 +- deps/v8/src/profiler/profile-generator.cc | 1 + deps/v8/src/profiler/profile-generator.h | 1 - .../v8/src/profiler/sampling-heap-profiler.cc | 8 +- deps/v8/src/profiler/tracing-cpu-profiler.cc | 1 + .../regexp/arm/regexp-macro-assembler-arm.cc | 19 - .../regexp/arm/regexp-macro-assembler-arm.h | 9 +- .../arm64/regexp-macro-assembler-arm64.cc | 22 - .../arm64/regexp-macro-assembler-arm64.h | 9 +- .../ia32/regexp-macro-assembler-ia32.cc | 19 - .../regexp/ia32/regexp-macro-assembler-ia32.h | 9 +- .../mips/regexp-macro-assembler-mips.cc | 19 - .../regexp/mips/regexp-macro-assembler-mips.h | 9 +- .../mips64/regexp-macro-assembler-mips64.cc | 19 - .../mips64/regexp-macro-assembler-mips64.h | 9 +- .../regexp/ppc/regexp-macro-assembler-ppc.cc | 56 +- .../regexp/ppc/regexp-macro-assembler-ppc.h | 36 +- .../v8/src/regexp/regexp-bytecode-generator.h | 105 +- deps/v8/src/regexp/regexp-compiler-tonode.cc | 2 + deps/v8/src/regexp/regexp-compiler.cc | 68 +- deps/v8/src/regexp/regexp-compiler.h | 18 +- deps/v8/src/regexp/regexp-interpreter.cc | 134 +- deps/v8/src/regexp/regexp-interpreter.h | 26 +- deps/v8/src/regexp/regexp-macro-assembler.cc | 18 + deps/v8/src/regexp/regexp-macro-assembler.h | 20 +- deps/v8/src/regexp/regexp-nodes.h | 9 + deps/v8/src/regexp/regexp-utils.cc | 5 +- deps/v8/src/regexp/regexp.cc | 160 +- deps/v8/src/regexp/regexp.h | 2 +- .../s390/regexp-macro-assembler-s390.cc | 20 - .../regexp/s390/regexp-macro-assembler-s390.h | 8 +- .../regexp/x64/regexp-macro-assembler-x64.cc | 19 - .../regexp/x64/regexp-macro-assembler-x64.h | 9 +- deps/v8/src/roots/roots-inl.h | 32 +- deps/v8/src/roots/roots.cc | 21 +- deps/v8/src/roots/roots.h | 85 +- deps/v8/src/runtime/runtime-compiler.cc | 25 +- deps/v8/src/runtime/runtime-debug.cc | 1 + deps/v8/src/runtime/runtime-internal.cc | 34 +- deps/v8/src/runtime/runtime-module.cc | 2 +- deps/v8/src/runtime/runtime-numbers.cc | 4 +- deps/v8/src/runtime/runtime-object.cc | 13 +- deps/v8/src/runtime/runtime-promise.cc | 57 + deps/v8/src/runtime/runtime-regexp.cc | 18 +- deps/v8/src/runtime/runtime-scopes.cc | 35 +- deps/v8/src/runtime/runtime-test.cc | 266 +- deps/v8/src/runtime/runtime-wasm.cc | 238 +- deps/v8/src/runtime/runtime-weak-refs.cc | 30 + deps/v8/src/runtime/runtime.cc | 1 + deps/v8/src/runtime/runtime.h | 66 +- deps/v8/src/snapshot/DEPS | 2 +- deps/v8/src/snapshot/code-serializer.cc | 13 +- deps/v8/src/snapshot/code-serializer.h | 6 +- ...eserializer.cc => context-deserializer.cc} | 25 +- ...-deserializer.h => context-deserializer.h} | 12 +- ...al-serializer.cc => context-serializer.cc} | 134 +- ...tial-serializer.h => context-serializer.h} | 22 +- .../v8/src/snapshot/deserializer-allocator.cc | 4 +- deps/v8/src/snapshot/deserializer-allocator.h | 3 +- deps/v8/src/snapshot/deserializer.cc | 112 +- deps/v8/src/snapshot/deserializer.h | 10 +- .../v8/src/snapshot/embedded/embedded-data.cc | 6 +- .../platform-embedded-file-writer-aix.cc | 10 - .../platform-embedded-file-writer-aix.h | 3 - .../platform-embedded-file-writer-base.cc | 43 +- .../platform-embedded-file-writer-base.h | 2 +- .../platform-embedded-file-writer-generic.cc | 16 +- .../platform-embedded-file-writer-generic.h | 4 +- .../platform-embedded-file-writer-mac.cc | 4 - .../platform-embedded-file-writer-mac.h | 2 - deps/v8/src/snapshot/mksnapshot.cc | 2 +- deps/v8/src/snapshot/object-deserializer.cc | 8 +- .../v8/src/snapshot/read-only-deserializer.cc | 4 +- deps/v8/src/snapshot/read-only-serializer.cc | 8 +- deps/v8/src/snapshot/read-only-serializer.h | 2 +- deps/v8/src/snapshot/roots-serializer.cc | 5 +- deps/v8/src/snapshot/roots-serializer.h | 3 +- deps/v8/src/snapshot/serializer-allocator.h | 3 +- .../src/snapshot/serializer-deserializer.cc | 61 + ...zer-common.h => serializer-deserializer.h} | 206 +- deps/v8/src/snapshot/serializer.cc | 174 +- deps/v8/src/snapshot/serializer.h | 33 +- deps/v8/src/snapshot/snapshot-compression.cc | 2 + deps/v8/src/snapshot/snapshot-compression.h | 4 +- deps/v8/src/snapshot/snapshot-data.cc | 80 + deps/v8/src/snapshot/snapshot-data.h | 129 + deps/v8/src/snapshot/snapshot-source-sink.h | 20 +- deps/v8/src/snapshot/snapshot-utils.cc | 25 + deps/v8/src/snapshot/snapshot-utils.h | 18 + .../{snapshot-common.cc => snapshot.cc} | 401 ++- deps/v8/src/snapshot/snapshot.h | 197 +- deps/v8/src/snapshot/startup-deserializer.cc | 16 +- deps/v8/src/snapshot/startup-serializer.cc | 94 +- deps/v8/src/snapshot/startup-serializer.h | 14 +- deps/v8/src/strings/uri.cc | 2 +- deps/v8/src/torque/ast.h | 26 +- .../torque/class-debug-reader-generator.cc | 2 +- deps/v8/src/torque/constants.h | 3 +- deps/v8/src/torque/csa-generator.cc | 159 +- deps/v8/src/torque/declaration-visitor.cc | 11 +- deps/v8/src/torque/earley-parser.h | 5 +- deps/v8/src/torque/global-context.cc | 7 +- deps/v8/src/torque/global-context.h | 13 + deps/v8/src/torque/implementation-visitor.cc | 707 +++-- deps/v8/src/torque/implementation-visitor.h | 30 +- deps/v8/src/torque/instance-type-generator.cc | 75 +- deps/v8/src/torque/instructions.h | 16 +- deps/v8/src/torque/torque-compiler.cc | 2 +- deps/v8/src/torque/torque-parser.cc | 100 +- deps/v8/src/torque/type-oracle.h | 8 + deps/v8/src/torque/type-visitor.cc | 15 +- deps/v8/src/torque/type-visitor.h | 4 +- deps/v8/src/torque/types.cc | 188 +- deps/v8/src/torque/types.h | 70 +- deps/v8/src/torque/utils.h | 2 +- deps/v8/src/tracing/DEPS | 4 + deps/v8/src/tracing/trace-categories.cc | 9 + deps/v8/src/tracing/trace-categories.h | 58 + deps/v8/src/tracing/trace-event.cc | 2 + deps/v8/src/tracing/trace-event.h | 47 +- deps/v8/src/tracing/traced-value.cc | 15 + deps/v8/src/tracing/traced-value.h | 13 +- deps/v8/src/utils/ostreams.h | 4 +- deps/v8/src/utils/pointer-with-payload.h | 2 +- deps/v8/src/utils/vector.h | 39 +- .../wasm/baseline/arm/liftoff-assembler-arm.h | 1559 +++++++++-- .../baseline/arm64/liftoff-assembler-arm64.h | 637 ++++- .../baseline/ia32/liftoff-assembler-ia32.h | 1403 ++++++++-- .../v8/src/wasm/baseline/liftoff-assembler.cc | 213 +- deps/v8/src/wasm/baseline/liftoff-assembler.h | 426 ++- deps/v8/src/wasm/baseline/liftoff-compiler.cc | 1268 +++++---- deps/v8/src/wasm/baseline/liftoff-compiler.h | 5 +- deps/v8/src/wasm/baseline/liftoff-register.h | 20 + .../baseline/mips/liftoff-assembler-mips.h | 869 ++++-- .../mips64/liftoff-assembler-mips64.h | 1077 ++++++-- .../wasm/baseline/ppc/liftoff-assembler-ppc.h | 554 +++- .../baseline/s390/liftoff-assembler-s390.h | 554 +++- .../wasm/baseline/x64/liftoff-assembler-x64.h | 1495 +++++++++-- deps/v8/src/wasm/c-api.cc | 4 +- deps/v8/src/wasm/compilation-environment.h | 13 +- deps/v8/src/wasm/decoder.h | 35 + deps/v8/src/wasm/function-body-decoder-impl.h | 750 ++++-- deps/v8/src/wasm/function-body-decoder.cc | 3 +- deps/v8/src/wasm/function-body-decoder.h | 4 +- deps/v8/src/wasm/function-compiler.cc | 35 +- deps/v8/src/wasm/function-compiler.h | 7 +- deps/v8/src/wasm/graph-builder-interface.cc | 84 +- deps/v8/src/wasm/local-decl-encoder.cc | 13 +- deps/v8/src/wasm/module-compiler.cc | 321 +-- deps/v8/src/wasm/module-compiler.h | 9 +- deps/v8/src/wasm/module-decoder.cc | 204 +- deps/v8/src/wasm/module-decoder.h | 8 +- deps/v8/src/wasm/module-instantiate.cc | 66 +- deps/v8/src/wasm/struct-types.h | 116 + deps/v8/src/wasm/value-type.h | 133 +- deps/v8/src/wasm/wasm-code-manager.cc | 346 +-- deps/v8/src/wasm/wasm-code-manager.h | 170 +- deps/v8/src/wasm/wasm-constants.h | 16 +- deps/v8/src/wasm/wasm-debug-evaluate.cc | 190 +- deps/v8/src/wasm/wasm-debug-evaluate.h | 2 +- deps/v8/src/wasm/wasm-debug.cc | 935 ++----- deps/v8/src/wasm/wasm-debug.h | 19 +- deps/v8/src/wasm/wasm-engine.cc | 258 +- deps/v8/src/wasm/wasm-engine.h | 21 +- deps/v8/src/wasm/wasm-feature-flags.h | 8 +- deps/v8/src/wasm/wasm-features.cc | 3 + deps/v8/src/wasm/wasm-interpreter.cc | 263 +- deps/v8/src/wasm/wasm-js.cc | 31 +- deps/v8/src/wasm/wasm-module-builder.cc | 121 +- deps/v8/src/wasm/wasm-module-builder.h | 41 +- deps/v8/src/wasm/wasm-module.cc | 37 +- deps/v8/src/wasm/wasm-module.h | 103 +- deps/v8/src/wasm/wasm-objects-inl.h | 51 + deps/v8/src/wasm/wasm-objects.cc | 129 +- deps/v8/src/wasm/wasm-objects.h | 119 +- deps/v8/src/wasm/wasm-objects.tq | 12 + deps/v8/src/wasm/wasm-opcodes.cc | 45 +- deps/v8/src/wasm/wasm-opcodes.h | 464 ++-- deps/v8/src/wasm/wasm-serialization.cc | 12 +- deps/v8/src/wasm/wasm-tier.h | 6 + deps/v8/test/benchmarks/benchmarks.status | 5 + deps/v8/test/cctest/BUILD.gn | 25 +- deps/v8/test/cctest/cctest.cc | 2 +- deps/v8/test/cctest/cctest.h | 6 + deps/v8/test/cctest/cctest.status | 32 +- .../test-js-context-specialization.cc | 6 + deps/v8/test/cctest/compiler/test-linkage.cc | 28 + deps/v8/test/cctest/compiler/value-helper.h | 24 +- deps/v8/test/cctest/heap/heap-utils.cc | 1 + deps/v8/test/cctest/heap/test-compaction.cc | 3 +- .../cctest/heap/test-concurrent-allocation.cc | 100 + .../test/cctest/heap/test-embedder-tracing.cc | 3 +- deps/v8/test/cctest/heap/test-heap.cc | 81 +- .../cctest/heap/test-invalidated-slots.cc | 4 +- deps/v8/test/cctest/heap/test-spaces.cc | 2 + .../AsyncGenerators.golden | 42 +- .../DestructuringAssignment.golden | 87 +- .../bytecode_expectations/ForAwaitOf.golden | 136 +- .../bytecode_expectations/ForOf.golden | 120 +- .../bytecode_expectations/ForOfLoop.golden | 240 +- .../bytecode_expectations/Generators.golden | 31 +- .../PrivateAccessorAccess.golden | 30 +- .../PrivateClassFieldAccess.golden | 84 + .../PrivateMethodAccess.golden | 20 +- .../StaticPrivateMethodAccess.golden | 28 +- .../interpreter/test-bytecode-generator.cc | 36 + .../cctest/interpreter/test-interpreter.cc | 33 +- .../test/cctest/libplatform/test-tracing.cc | 451 ++-- deps/v8/test/cctest/parsing/test-preparser.cc | 23 +- deps/v8/test/cctest/parsing/test-scanner.cc | 6 +- deps/v8/test/cctest/test-api-icu.cc | 57 + deps/v8/test/cctest/test-api-wasm.cc | 34 + deps/v8/test/cctest/test-api.cc | 150 +- .../test/cctest/test-code-stub-assembler.cc | 299 ++- deps/v8/test/cctest/test-constantpool.cc | 25 +- deps/v8/test/cctest/test-cpu-profiler.cc | 49 +- deps/v8/test/cctest/test-debug-helper.cc | 1 + deps/v8/test/cctest/test-debug.cc | 22 +- deps/v8/test/cctest/test-disasm-ia32.cc | 7 + deps/v8/test/cctest/test-disasm-x64.cc | 21 + .../test/cctest/test-field-type-tracking.cc | 149 +- deps/v8/test/cctest/test-flags.cc | 1 - deps/v8/test/cctest/test-inspector.cc | 109 +- deps/v8/test/cctest/test-js-weak-refs.cc | 139 +- deps/v8/test/cctest/test-log.cc | 6 +- deps/v8/test/cctest/test-parsing.cc | 269 +- .../v8/test/cctest/test-persistent-handles.cc | 114 + deps/v8/test/cctest/test-regexp.cc | 49 +- deps/v8/test/cctest/test-roots.cc | 2 +- deps/v8/test/cctest/test-serialize.cc | 219 +- deps/v8/test/cctest/torque/test-torque.cc | 44 +- deps/v8/test/cctest/wasm/test-gc.cc | 311 +++ .../cctest/wasm/test-liftoff-inspection.cc | 37 +- .../cctest/wasm/test-run-wasm-atomics64.cc | 31 +- .../cctest/wasm/test-run-wasm-bulk-memory.cc | 58 +- .../cctest/wasm/test-run-wasm-exceptions.cc | 18 +- deps/v8/test/cctest/wasm/test-run-wasm-js.cc | 84 +- .../cctest/wasm/test-run-wasm-simd-liftoff.cc | 35 + .../test-run-wasm-simd-scalar-lowering.cc | 47 + .../v8/test/cctest/wasm/test-run-wasm-simd.cc | 219 +- deps/v8/test/cctest/wasm/test-run-wasm.cc | 6 +- .../test/cctest/wasm/test-wasm-breakpoints.cc | 46 +- .../cctest/wasm/test-wasm-debug-evaluate.cc | 111 +- .../wasm/test-wasm-interpreter-entry.cc | 260 -- .../cctest/wasm/test-wasm-serialization.cc | 18 +- .../cctest/wasm/test-wasm-shared-engine.cc | 3 +- deps/v8/test/cctest/wasm/test-wasm-stack.cc | 6 +- .../cctest/wasm/test-wasm-trap-position.cc | 4 +- deps/v8/test/cctest/wasm/wasm-run-utils.cc | 65 +- deps/v8/test/cctest/wasm/wasm-run-utils.h | 55 +- deps/v8/test/common/wasm/wasm-macro-gen.h | 148 +- .../v8/test/common/wasm/wasm-module-runner.cc | 3 + .../debug-liveedit-patch-positions-replace.js | 2 +- .../es6/debug-promises/promise-any-caught.js | 39 + .../debug-promises/promise-any-uncaught.js | 67 + .../debugger/debug/regress/regress-10319.js | 46 + ...bled-tier-down-wasm-unsupported-liftoff.js | 5 +- .../wasm/debug-enabled-tier-down-wasm.js | 13 +- .../debug/wasm/debug-step-into-wasm.js | 8 +- deps/v8/test/debugger/debugger.status | 29 +- deps/v8/test/debugging/debugging.status | 9 +- deps/v8/test/debugging/testcfg.py | 3 +- deps/v8/test/debugging/wasm/gdb-server/OWNERS | 3 + .../debugging/wasm/gdb-server/breakpoints.py | 58 + .../test/debugging/wasm/gdb-server/connect.py | 34 +- .../test/debugging/wasm/gdb-server/float.py | 71 + .../test/debugging/wasm/gdb-server/gdb_rsp.py | 137 +- .../test/debugging/wasm/gdb-server/memory.py | 96 + .../test/debugging/wasm/gdb-server/status.py | 109 + .../debugging/wasm/gdb-server/stepping.py | 56 + .../wasm/gdb-server/test_files/__init__.py | 0 .../wasm/gdb-server/test_files/test.js | 33 - .../wasm/gdb-server/test_files/test_basic.js | 31 + .../wasm/gdb-server/test_files/test_basic.py | 23 + .../wasm/gdb-server/test_files/test_float.js | 31 + .../wasm/gdb-server/test_files/test_float.py | 21 + .../wasm/gdb-server/test_files/test_memory.js | 48 + .../wasm/gdb-server/test_files/test_memory.py | 43 + .../wasm/gdb-server/test_files/test_trap.js | 31 + .../wasm/gdb-server/test_files/test_trap.py | 28 + .../v8/test/debugging/wasm/gdb-server/trap.py | 37 + deps/v8/test/fuzzer/fuzzer.status | 5 + deps/v8/test/fuzzer/parser.cc | 6 +- deps/v8/test/fuzzer/wasm-compile.cc | 143 +- deps/v8/test/fuzzer/wasm-fuzzer-common.cc | 11 +- ...asm-js-breakpoint-before-exec-expected.txt | 20 +- .../debugger/asm-js-breakpoint-before-exec.js | 9 +- ...asm-js-breakpoint-during-exec-expected.txt | 14 +- .../debugger/asm-js-breakpoint-during-exec.js | 2 - ...t-preview-internal-properties-expected.txt | 4 +- .../inspector/debugger/wasm-anyref-global.js | 11 +- ...int-reset-on-debugger-restart-expected.txt | 11 + ...sm-breakpoint-reset-on-debugger-restart.js | 63 + .../debugger/wasm-debug-evaluate-expected.txt | 5 + .../inspector/debugger/wasm-debug-evaluate.js | 155 ++ .../inspector/debugger/wasm-global-names.js | 12 +- .../wasm-inspect-many-registers-expected.txt | 160 +- .../debugger/wasm-inspect-many-registers.js | 20 +- .../debugger/wasm-memory-names-expected.txt | 19 + .../inspector/debugger/wasm-memory-names.js | 117 + .../debugger/wasm-scope-info-expected.txt | 105 +- .../wasm-scope-info-liftoff-expected.txt | 66 +- .../debugger/wasm-scope-info-liftoff.js | 2 - .../inspector/debugger/wasm-scope-info.js | 2 - .../debugger/wasm-scripts-expected.txt | 80 +- .../test/inspector/debugger/wasm-scripts.js | 101 +- .../wasm-set-breakpoint-liftoff-expected.txt | 111 +- .../debugger/wasm-set-breakpoint-liftoff.js | 2 - .../wasm-step-after-trap-expected.txt | 56 + .../debugger/wasm-step-after-trap.js | 102 + .../wasm-stepping-byte-offsets-expected.txt | 84 +- .../debugger/wasm-stepping-byte-offsets.js | 6 +- .../debugger/wasm-stepping-liftoff.js | 2 - ...wasm-stepping-with-source-map-expected.txt | 87 +- .../debugger/wasm-stepping-with-source-map.js | 3 +- deps/v8/test/inspector/inspector-test.cc | 1 - deps/v8/test/inspector/inspector.status | 22 +- .../runtime/internal-properties-expected.txt | 2 +- .../runtime/query-objects-expected.txt | 3 + .../test/inspector/runtime/query-objects.js | 28 + .../runtime/regress-1075763-expected.txt | 26 + .../test/inspector/runtime/regress-1075763.js | 14 + .../runtime/regress-1078205-expected.txt | 157 ++ .../test/inspector/runtime/regress-1078205.js | 34 + .../runtime/regress-986051-expected.txt | 76 + .../test/inspector/runtime/regress-986051.js | 25 + .../runtime/remote-object-expected.txt | 2 +- .../test/intl/date-format/check-calendar.js | 2 - .../date-format/check-numbering-system.js | 2 - ...nstructor-calendar-numberingSytem-order.js | 1 - .../intl/date-format/property-override.js | 1 + deps/v8/test/intl/date-format/related-year.js | 1 - .../intl/displaynames/constructor-order.js | 2 - deps/v8/test/intl/displaynames/constructor.js | 1 - .../intl/displaynames/resolved-options.js | 2 - .../intl/displaynames/supported-locale.js | 2 - deps/v8/test/intl/intl.status | 13 +- .../v8/test/intl/locale/locale-constructor.js | 5 +- .../number-format/check-numbering-system.js | 2 - .../constructor-numberingSytem-order.js | 2 - .../number-format/unified/sign-display.js | 2 +- deps/v8/test/intl/regress-10437.js | 18 + deps/v8/test/intl/regress-10438.js | 51 + deps/v8/test/intl/regress-1074578.js | 45 + deps/v8/test/intl/regress-364374.js | 60 + deps/v8/test/intl/regress-966285.js | 2 - deps/v8/test/intl/regress-9786.js | 2 - deps/v8/test/intl/regress-9787.js | 2 - deps/v8/test/intl/regress-9788.js | 2 - deps/v8/test/intl/regress-9887.js | 2 - .../resolved-options-nu-extended.js | 38 +- deps/v8/test/js-perf-test/JSTests1.json | 16 + .../Operators/abstract-equality.js | 79 + deps/v8/test/js-perf-test/Operators/run.js | 28 + deps/v8/test/message/fail/spread-call-4.js | 5 + deps/v8/test/message/fail/spread-call-4.out | 5 + deps/v8/test/message/message.status | 9 +- .../message/wasm-trace-memory-interpreted.js | 8 - .../message/wasm-trace-memory-interpreted.out | 14 - .../weakref-finalizationregistry-error.js | 3 +- .../weakref-finalizationregistry-error.out | 2 + deps/v8/test/mjsunit/asm/load-elimination.js | 2 - .../v8/test/mjsunit/call-intrinsic-fuzzing.js | 6 +- .../test/mjsunit/code-coverage-block-async.js | 62 - .../mjsunit/compiler/abstract-equal-symbol.js | 4 +- .../compiler/abstract-equal-undetectable.js | 31 +- .../compiler/bigint-add-no-deopt-loop.js | 4 +- .../monomorphic-named-load-with-no-map.js | 53 + deps/v8/test/mjsunit/compiler/osr-infinite.js | 1 - .../compiler/redundancy-elimination.js | 12 +- .../test/mjsunit/compiler/regress-1065737.js | 17 + .../test/mjsunit/compiler/regress-1067544.js | 16 + .../test/mjsunit/compiler/regress-1068494.js | 14 + .../test/mjsunit/compiler/regress-1070892.js | 17 + .../test/mjsunit/compiler/regress-1071743.js | 32 + .../test/mjsunit/compiler/regress-1074736.js | 17 + .../test/mjsunit/compiler/regress-1082704.js | 16 + .../test/mjsunit/compiler/regress-1084820.js | 27 + .../test/mjsunit/compiler/regress-1092650.js | 23 + .../test/mjsunit/compiler/regress-1094132.js | 78 + .../v8/test/mjsunit/const-field-tracking-2.js | 225 ++ deps/v8/test/mjsunit/es6/array-copywithin.js | 2 +- .../es6/promise-all-resolve-not-callable.js | 30 + ...promise-allsettled-resolve-not-callable.js | 30 + .../es6/promise-race-resolve-not-callable.js | 30 + .../test/mjsunit/es6/proxies-constructor.js | 16 - deps/v8/test/mjsunit/es6/proxies-revocable.js | 6 - deps/v8/test/mjsunit/es6/reflect-construct.js | 3 +- .../mjsunit/es6/regress/regress-411237.js | 17 - .../es6/typedarray-from-optional-arguments.js | 32 + .../test/mjsunit/harmony/aggregate-error.js | 213 ++ .../mjsunit/harmony/logical-assignment.js | 42 + .../test/mjsunit/harmony/optional-chaining.js | 1 - .../mjsunit/harmony/promise-any-overflow-1.js | 21 + .../mjsunit/harmony/promise-any-overflow-2.js | 18 + .../promise-any-resolve-not-callable.js | 30 + deps/v8/test/mjsunit/harmony/promise-any.js | 94 + .../test/mjsunit/harmony/string-matchAll.js | 2 +- .../harmony/weakrefs/basics-cleanupsome.js | 25 + .../test/mjsunit/harmony/weakrefs/basics.js | 20 - .../cleanup-doesnt-iterate-all-holdings.js | 93 - .../weakrefs/cleanup-is-not-a-microtask.js | 3 +- .../{iterating-in-cleanup.js => cleanup.js} | 33 +- .../mjsunit/harmony/weakrefs/cleanupsome-2.js | 8 +- .../weakrefs/cleanupsome-after-unregister.js | 8 +- .../harmony/weakrefs/cleanupsome-optional.js | 13 + .../mjsunit/harmony/weakrefs/cleanupsome.js | 10 +- .../weakrefs/clearkeptobjects-on-quit.js | 13 + .../weakrefs/finalizationregistry-and-weakref | 6 +- ...nalizationregistry-independent-lifetime.js | 3 +- ...nalizationregistry-keeps-holdings-alive.js | 12 +- ...ry-scheduled-for-cleanup-multiple-times.js | 19 +- .../multiple-dirty-finalization-groups.js | 8 +- .../weakrefs/reentrant-gc-from-cleanup.js | 4 +- ...ress-finalizationregistry-dirty-enqueue.js | 36 + .../harmony/weakrefs/undefined-holdings.js | 10 +- .../weakrefs/unregister-after-cleanup.js | 12 +- .../weakrefs/unregister-before-cleanup.js | 2 +- .../weakrefs/unregister-called-twice.js | 2 +- ...eanup5.js => unregister-inside-cleanup.js} | 22 +- .../weakrefs/unregister-inside-cleanup1.js | 42 - .../weakrefs/unregister-inside-cleanup2.js | 36 +- .../weakrefs/unregister-inside-cleanup3.js | 26 +- .../weakrefs/unregister-inside-cleanup4.js | 50 - .../harmony/weakrefs/unregister-many.js | 8 +- ...register-when-cleanup-already-scheduled.js | 2 +- .../harmony/weakrefs/weak-cell-basics.js | 8 +- .../harmony/weakrefs/weak-unregistertoken.js | 8 +- deps/v8/test/mjsunit/mjsunit.js | 2 +- deps/v8/test/mjsunit/mjsunit.status | 113 +- deps/v8/test/mjsunit/never-optimize.js | 29 +- ...uiltins.js => object-tostring-builtins.js} | 4 +- deps/v8/test/mjsunit/regress-crbug-1078825.js | 20 + deps/v8/test/mjsunit/regress/regress-10508.js | 15 + .../test/mjsunit/regress/regress-1069964.js | 8 + .../test/mjsunit/regress/regress-1071190.js | 23 + .../test/mjsunit/regress/regress-1076569.js | 16 + .../test/mjsunit/regress/regress-1077804.js | 21 + .../test/mjsunit/regress/regress-1078913.js | 29 + deps/v8/test/mjsunit/regress/regress-1365.js | 1 - .../v8/test/mjsunit/regress/regress-447756.js | 9 +- .../v8/test/mjsunit/regress/regress-491481.js | 15 - .../regress/regress-crbug-1053939-1.js | 16 + .../regress/regress-crbug-1055138-1.js | 64 + .../regress/regress-crbug-1055138-2.js | 34 + .../regress/regress-crbug-1055138-3.js | 40 + .../mjsunit/regress/regress-crbug-1060023.js | 10 + ...ess-347542.js => regress-crbug-1063796.js} | 13 +- .../mjsunit/regress/regress-crbug-1065741.js | 19 + .../mjsunit/regress/regress-crbug-1067757.js | 30 + .../mjsunit/regress/regress-crbug-1070560.js | 16 + .../mjsunit/regress/regress-crbug-1074737.js | 40 + .../mjsunit/regress/regress-crbug-1077508.js | 14 + .../mjsunit/regress/regress-crbug-754177.js | 7 +- .../mjsunit/regress/regress-v8-10484-1.js | 18 + .../mjsunit/regress/regress-v8-10484-2.js | 24 + .../test/mjsunit/regress/regress-v8-10513.js | 25 + .../mjsunit/regress/wasm/regress-10309.js | 2 +- .../mjsunit/regress/wasm/regress-1054466.js | 6 +- .../mjsunit/regress/wasm/regress-1055692.js | 35 - .../mjsunit/regress/wasm/regress-1065599.js | 27 + .../mjsunit/regress/wasm/regress-1065635.js | 13 + .../mjsunit/regress/wasm/regress-1065852.js | 14 + .../mjsunit/regress/wasm/regress-1067621.js | 82 + .../mjsunit/regress/wasm/regress-1070078.js | 39 + .../mjsunit/regress/wasm/regress-1073553.js | 14 + .../mjsunit/regress/wasm/regress-1074586-b.js | 23 + .../mjsunit/regress/wasm/regress-1074586.js | 94 + .../mjsunit/regress/wasm/regress-1075953.js | 38 + .../mjsunit/regress/wasm/regress-1079449.js | 37 + .../mjsunit/regress/wasm/regress-1081030.js | 25 + .../test/mjsunit/regress/wasm/regress-7049.js | 53 - .../mjsunit/regress/wasm/regress-715216a.js | 12 - .../mjsunit/regress/wasm/regress-715216b.js | 12 - .../mjsunit/regress/wasm/regress-719175.js | 16 - .../mjsunit/regress/wasm/regress-766003.js | 16 - .../mjsunit/regress/wasm/regress-771243.js | 38 - .../mjsunit/regress/wasm/regress-772332.js | 32 - .../mjsunit/regress/wasm/regress-778917.js | 19 - .../mjsunit/regress/wasm/regress-831463.js | 21 - .../mjsunit/regress/wasm/regress-834624.js | 29 - .../regress/wasm/regress-crbug-1007608.js | 26 - .../test/mjsunit/serialize-deserialize-now.js | 17 + deps/v8/test/mjsunit/tools/foozzie.js | 18 +- .../test/mjsunit/wasm/anyfunc-interpreter.js | 12 - .../wasm/anyref-globals-interpreter.js | 12 - .../test/mjsunit/wasm/anyref-interpreter.js | 12 - deps/v8/test/mjsunit/wasm/asm-wasm.js | 24 + .../compilation-hints-async-compilation.js | 2 +- .../mjsunit/wasm/compilation-hints-decoder.js | 6 +- .../mjsunit/wasm/compilation-hints-ignored.js | 4 +- .../wasm/compilation-hints-interpreter.js | 113 - ...compilation-hints-streaming-compilation.js | 2 +- .../compilation-hints-sync-compilation.js | 2 +- .../wasm/compiled-module-management.js | 1 + .../wasm/exceptions-anyref-interpreter.js | 12 - .../wasm/exceptions-global-interpreter.js | 12 - .../mjsunit/wasm/exceptions-interpreter.js | 12 - .../wasm/exceptions-rethrow-interpreter.js | 12 - .../wasm/exceptions-simd-interpreter.js | 12 - deps/v8/test/mjsunit/wasm/exceptions-simd.js | 2 +- deps/v8/test/mjsunit/wasm/exceptions.js | 51 +- .../v8/test/mjsunit/wasm/futex-interpreter.js | 12 - ...ndirect-call-non-zero-table-interpreter.js | 12 - .../v8/test/mjsunit/wasm/interpreter-mixed.js | 222 -- deps/v8/test/mjsunit/wasm/interpreter.js | 569 ---- .../mjsunit/wasm/multi-value-interpreter.js | 7 - .../test/mjsunit/wasm/nullref-interpreter.js | 12 - .../mjsunit/wasm/streaming-error-position.js | 2 +- .../mjsunit/wasm/table-access-interpreter.js | 12 - .../mjsunit/wasm/table-fill-interpreter.js | 12 - .../wasm/table-grow-from-wasm-interpreter.js | 12 - .../test/mjsunit/wasm/wasm-module-builder.js | 29 +- .../test/mjsunit/wasm/worker-interpreter.js | 68 - deps/v8/test/mozilla/mozilla.status | 5 + deps/v8/test/test262/BUILD.gn | 1 + deps/v8/test/test262/harness-ishtmldda.js | 5 + deps/v8/test/test262/test262.status | 159 +- deps/v8/test/test262/testcfg.py | 13 +- deps/v8/test/torque/test-torque.tq | 2063 +++++++------- deps/v8/test/unittests/BUILD.gn | 36 +- .../unittests/api/remote-object-unittest.cc | 17 - .../compiler-dispatcher-unittest.cc | 8 +- .../instruction-selector-arm64-unittest.cc | 95 +- .../effect-control-linearizer-unittest.cc | 235 ++ .../compiler/int64-lowering-unittest.cc | 6 +- .../machine-operator-reducer-unittest.cc | 251 +- .../unittests/compiler/node-test-utils.cc | 14 + .../test/unittests/compiler/node-test-utils.h | 7 + .../redundancy-elimination-unittest.cc | 28 +- .../test/unittests/compiler/typer-unittest.cc | 40 +- .../execution/microtask-queue-unittest.cc | 12 +- .../v8/test/unittests/heap/bitmap-unittest.cc | 2 +- .../heap/cppgc/allocation_unittest.cc | 42 - .../heap/cppgc/custom-spaces-unittest.cc | 130 + ...nittest.cc => finalizer-trait-unittest.cc} | 4 +- .../heap/cppgc/free-list-unittest.cc | 187 ++ .../heap/cppgc/garbage-collected-unittest.cc | 143 + .../heap/cppgc/garbage-collected_unittest.cc | 26 - ...c-info_unittest.cc => gc-info-unittest.cc} | 2 +- ...test.cc => heap-object-header-unittest.cc} | 0 .../heap/cppgc/heap-page-unittest.cc | 274 ++ .../unittests/heap/cppgc/heap-unittest.cc | 115 + .../unittests/heap/cppgc/logging-unittest.cc | 79 + .../unittests/heap/cppgc/marker-unittest.cc | 188 ++ .../heap/cppgc/marking-visitor-unittest.cc | 285 ++ .../unittests/heap/cppgc/member-unittest.cc | 304 +++ .../cppgc/object-start-bitmap-unittest.cc | 189 ++ .../heap/cppgc/page-memory-unittest.cc | 308 +++ .../heap/cppgc/persistent-unittest.cc | 658 +++++ .../heap/cppgc/prefinalizer-unittest.cc | 199 ++ .../heap/cppgc/source-location-unittest.cc | 61 + .../unittests/heap/cppgc/stack-unittest.cc | 357 +++ .../unittests/heap/cppgc/stack_unittest.cc | 256 -- .../unittests/heap/cppgc/sweeper-unittest.cc | 230 ++ deps/v8/test/unittests/heap/cppgc/tests.cc | 17 +- deps/v8/test/unittests/heap/cppgc/tests.h | 25 +- .../unittests/heap/cppgc/visitor-unittest.cc | 232 ++ .../unittests/heap/cppgc/worklist-unittest.cc | 346 +++ .../heap/embedder-tracing-unittest.cc | 48 +- deps/v8/test/unittests/heap/heap-unittest.cc | 4 +- .../unittests/{base => heap}/list-unittest.cc | 12 +- .../heap/off-thread-factory-unittest.cc | 140 +- .../test/unittests/heap/safepoint-unittest.cc | 3 + .../test/unittests/heap/slot-set-unittest.cc | 36 +- .../v8/test/unittests/heap/spaces-unittest.cc | 27 +- .../libplatform/default-job-unittest.cc | 233 ++ .../libplatform/default-platform-unittest.cc | 10 +- .../objects/backing-store-unittest.cc | 22 +- .../tasks/background-compile-task-unittest.cc | 5 +- deps/v8/test/unittests/test-helpers.cc | 10 +- deps/v8/test/unittests/test-helpers.h | 3 +- deps/v8/test/unittests/test-utils.cc | 65 +- deps/v8/test/unittests/test-utils.h | 216 +- .../test/unittests/torque/torque-unittest.cc | 46 + deps/v8/test/unittests/unittests.status | 5 + .../test/unittests/utils/vector-unittest.cc | 54 +- .../wasm/function-body-decoder-unittest.cc | 40 +- .../unittests/wasm/module-decoder-unittest.cc | 65 +- .../wasm/wasm-code-manager-unittest.cc | 16 +- .../unittests/wasm/wasm-gdbserver-unittest.cc | 275 ++ .../unittests/wasm/wasm-opcodes-unittest.cc | 35 - deps/v8/test/wasm-api-tests/callbacks.cc | 4 +- .../test/wasm-api-tests/wasm-api-tests.status | 6 + deps/v8/test/wasm-js/testcfg.py | 4 - deps/v8/test/wasm-js/tests.tar.gz.sha1 | 2 +- deps/v8/test/wasm-js/wasm-js.status | 9 +- deps/v8/test/wasm-spec-tests/testcfg.py | 8 +- .../v8/test/wasm-spec-tests/tests.tar.gz.sha1 | 2 +- .../wasm-spec-tests/wasm-spec-tests.status | 19 +- deps/v8/test/webkit/webkit.status | 6 +- deps/v8/testing/gmock/BUILD.gn | 9 +- .../gmock/gmock-generated-function-mockers.h | 10 - deps/v8/third_party/googletest/BUILD.gn | 22 +- deps/v8/third_party/jinja2/README.chromium | 1 + deps/v8/third_party/jsoncpp/BUILD.gn | 50 + deps/v8/third_party/jsoncpp/LICENSE | 55 + deps/v8/third_party/jsoncpp/README.chromium | 16 + .../third_party/jsoncpp/generated/version.h | 22 + deps/v8/third_party/v8/builtins/array-sort.tq | 2374 ++++++++--------- deps/v8/third_party/zlib/BUILD.gn | 81 +- deps/v8/third_party/zlib/DEPS | 3 + deps/v8/third_party/zlib/README.chromium | 1 + deps/v8/third_party/zlib/chromeconf.h | 4 + .../contrib/optimizations/insert_string.h | 59 +- deps/v8/third_party/zlib/cpu_features.c | 7 +- deps/v8/third_party/zlib/cpu_features.h | 1 + deps/v8/third_party/zlib/crc32.c | 6 +- deps/v8/third_party/zlib/crc_folding.c | 6 +- deps/v8/third_party/zlib/deflate.c | 4 +- deps/v8/third_party/zlib/fill_window_sse.c | 7 +- deps/v8/third_party/zlib/google/OWNERS | 1 + .../zlib/google/compression_utils_portable.cc | 2 +- .../third_party/zlib/google/zip_internal.cc | 1 + .../zlib/patches/0005-infcover-gtest.patch | 405 +++ deps/v8/tools/callstats.html | 148 +- .../clusterfuzz/testdata/failure_output.txt | 4 +- .../testdata/sanity_check_output.txt | 4 +- deps/v8/tools/clusterfuzz/v8_commands.py | 1 + deps/v8/tools/clusterfuzz/v8_mock.js | 30 +- deps/v8/tools/clusterfuzz/v8_sanity_checks.js | 13 + deps/v8/tools/csvparser.js | 8 +- deps/v8/tools/debug_helper/BUILD.gn | 5 + .../debug_helper/get-object-properties.cc | 14 +- deps/v8/tools/gen-postmortem-metadata.py | 1 - deps/v8/tools/logreader.js | 3 +- deps/v8/tools/map-processor.html | 126 +- deps/v8/tools/map-processor.js | 139 +- deps/v8/tools/testrunner/base_runner.py | 6 - .../v8/tools/testrunner/local/junit_output.py | 49 - deps/v8/tools/testrunner/local/variants.py | 3 + deps/v8/tools/testrunner/standard_runner.py | 2 + deps/v8/tools/testrunner/testproc/progress.py | 113 +- deps/v8/tools/testrunner/testproc/util.py | 39 + .../testrunner/testproc/util_unittest.py | 61 + deps/v8/tools/torque/format-torque.py | 10 + deps/v8/tools/unittests/run_tests_test.py | 6 +- .../testdata/expected_test_results1.json | 229 +- .../testdata/expected_test_results2.json | 144 +- deps/v8/tools/v8heapconst.py | 423 +-- deps/v8/tools/wasm/update-wasm-spec-tests.sh | 2 +- deps/v8/tools/whitespace.txt | 6 +- 1406 files changed, 73228 insertions(+), 39860 deletions(-) create mode 100644 deps/v8/include/cppgc/DEPS create mode 100644 deps/v8/include/cppgc/common.h create mode 100644 deps/v8/include/cppgc/custom-space.h create mode 100644 deps/v8/include/cppgc/internal/accessors.h rename deps/v8/include/cppgc/{internals.h => internal/api-constants.h} (57%) create mode 100644 deps/v8/include/cppgc/internal/compiler-specific.h rename deps/v8/include/cppgc/{ => internal}/finalizer-trait.h (92%) rename deps/v8/include/cppgc/{ => internal}/gc-info.h (81%) create mode 100644 deps/v8/include/cppgc/internal/logging.h create mode 100644 deps/v8/include/cppgc/internal/persistent-node.h create mode 100644 deps/v8/include/cppgc/internal/pointer-policies.h create mode 100644 deps/v8/include/cppgc/internal/prefinalizer-handler.h create mode 100644 deps/v8/include/cppgc/liveness-broker.h create mode 100644 deps/v8/include/cppgc/macros.h create mode 100644 deps/v8/include/cppgc/member.h create mode 100644 deps/v8/include/cppgc/persistent.h create mode 100644 deps/v8/include/cppgc/prefinalizer.h create mode 100644 deps/v8/include/cppgc/source-location.h create mode 100644 deps/v8/include/cppgc/trace-trait.h create mode 100644 deps/v8/include/cppgc/type-traits.h create mode 100644 deps/v8/include/cppgc/visitor.h delete mode 100644 deps/v8/src/builtins/builtins-promise.cc create mode 100644 deps/v8/src/builtins/builtins-wasm-gen.h create mode 100644 deps/v8/src/builtins/finalization-registry.tq create mode 100644 deps/v8/src/builtins/ic-callable.tq create mode 100644 deps/v8/src/builtins/ic.tq create mode 100644 deps/v8/src/builtins/promise-any.tq create mode 100644 deps/v8/src/builtins/wasm.tq rename deps/v8/src/{snapshot/serializer-common.cc => codegen/external-reference-encoder.cc} (53%) create mode 100644 deps/v8/src/codegen/external-reference-encoder.h create mode 100644 deps/v8/src/common/external-pointer-inl.h create mode 100644 deps/v8/src/common/external-pointer.h create mode 100644 deps/v8/src/debug/wasm/gdb-server/OWNERS create mode 100644 deps/v8/src/debug/wasm/gdb-server/gdb-remote-util.cc create mode 100644 deps/v8/src/debug/wasm/gdb-server/gdb-remote-util.h create mode 100644 deps/v8/src/debug/wasm/gdb-server/packet.cc create mode 100644 deps/v8/src/debug/wasm/gdb-server/packet.h delete mode 100644 deps/v8/src/debug/wasm/gdb-server/util.h create mode 100644 deps/v8/src/debug/wasm/gdb-server/wasm-module-debug.cc create mode 100644 deps/v8/src/debug/wasm/gdb-server/wasm-module-debug.h create mode 100644 deps/v8/src/execution/off-thread-isolate-inl.h create mode 100644 deps/v8/src/handles/persistent-handles.cc create mode 100644 deps/v8/src/handles/persistent-handles.h create mode 100644 deps/v8/src/heap/concurrent-allocator-inl.h create mode 100644 deps/v8/src/heap/concurrent-allocator.cc create mode 100644 deps/v8/src/heap/concurrent-allocator.h create mode 100644 deps/v8/src/heap/cppgc/asm/arm/push_registers_asm.cc create mode 100644 deps/v8/src/heap/cppgc/asm/arm64/push_registers_asm.cc create mode 100644 deps/v8/src/heap/cppgc/asm/arm64/push_registers_masm.S create mode 100644 deps/v8/src/heap/cppgc/asm/ia32/push_registers_asm.cc create mode 100644 deps/v8/src/heap/cppgc/asm/ia32/push_registers_masm.S create mode 100644 deps/v8/src/heap/cppgc/asm/mips/push_registers_asm.cc create mode 100644 deps/v8/src/heap/cppgc/asm/mips64/push_registers_asm.cc create mode 100644 deps/v8/src/heap/cppgc/asm/ppc/push_registers_asm.cc create mode 100644 deps/v8/src/heap/cppgc/asm/s390/push_registers_asm.cc delete mode 100644 deps/v8/src/heap/cppgc/asm/x64/push_registers.S create mode 100644 deps/v8/src/heap/cppgc/asm/x64/push_registers_asm.cc rename deps/v8/src/heap/cppgc/asm/x64/{push_registers_win.S => push_registers_masm.S} (100%) create mode 100644 deps/v8/src/heap/cppgc/free-list.cc create mode 100644 deps/v8/src/heap/cppgc/free-list.h create mode 100644 deps/v8/src/heap/cppgc/heap-page.cc create mode 100644 deps/v8/src/heap/cppgc/heap-page.h create mode 100644 deps/v8/src/heap/cppgc/heap-space.cc create mode 100644 deps/v8/src/heap/cppgc/heap-space.h create mode 100644 deps/v8/src/heap/cppgc/heap-visitor.h create mode 100644 deps/v8/src/heap/cppgc/liveness-broker.cc create mode 100644 deps/v8/src/heap/cppgc/logging.cc create mode 100644 deps/v8/src/heap/cppgc/marker.cc create mode 100644 deps/v8/src/heap/cppgc/marker.h create mode 100644 deps/v8/src/heap/cppgc/marking-visitor.cc create mode 100644 deps/v8/src/heap/cppgc/marking-visitor.h create mode 100644 deps/v8/src/heap/cppgc/object-allocator-inl.h create mode 100644 deps/v8/src/heap/cppgc/object-allocator.cc create mode 100644 deps/v8/src/heap/cppgc/object-allocator.h create mode 100644 deps/v8/src/heap/cppgc/object-start-bitmap-inl.h create mode 100644 deps/v8/src/heap/cppgc/object-start-bitmap.h create mode 100644 deps/v8/src/heap/cppgc/page-memory-inl.h create mode 100644 deps/v8/src/heap/cppgc/page-memory.cc create mode 100644 deps/v8/src/heap/cppgc/page-memory.h create mode 100644 deps/v8/src/heap/cppgc/persistent-node.cc create mode 100644 deps/v8/src/heap/cppgc/pointer-policies.cc create mode 100644 deps/v8/src/heap/cppgc/prefinalizer-handler.cc create mode 100644 deps/v8/src/heap/cppgc/prefinalizer-handler.h create mode 100644 deps/v8/src/heap/cppgc/raw-heap.cc create mode 100644 deps/v8/src/heap/cppgc/raw-heap.h create mode 100644 deps/v8/src/heap/cppgc/source-location.cc create mode 100644 deps/v8/src/heap/cppgc/sweeper.cc create mode 100644 deps/v8/src/heap/cppgc/sweeper.h create mode 100644 deps/v8/src/heap/cppgc/visitor.h create mode 100644 deps/v8/src/heap/cppgc/worklist.h create mode 100644 deps/v8/src/heap/large-spaces.cc create mode 100644 deps/v8/src/heap/large-spaces.h rename deps/v8/src/{base => heap}/list.h (83%) create mode 100644 deps/v8/src/heap/memory-chunk-inl.h create mode 100644 deps/v8/src/heap/memory-chunk.cc create mode 100644 deps/v8/src/heap/memory-chunk.h create mode 100644 deps/v8/src/heap/off-thread-heap.cc create mode 100644 deps/v8/src/heap/off-thread-heap.h create mode 100644 deps/v8/src/heap/read-only-spaces.cc create mode 100644 deps/v8/src/heap/read-only-spaces.h rename deps/v8/src/heap/{remembered-set.h => remembered-set-inl.h} (87%) create mode 100644 deps/v8/src/heap/third-party/heap-api-stub.cc create mode 100644 deps/v8/src/libplatform/default-job.cc create mode 100644 deps/v8/src/libplatform/default-job.h delete mode 100644 deps/v8/src/libplatform/tracing/json-trace-event-listener.cc delete mode 100644 deps/v8/src/libplatform/tracing/json-trace-event-listener.h create mode 100644 deps/v8/src/objects/class-definitions-tq-deps-inl.h create mode 100644 deps/v8/src/objects/js-aggregate-error-inl.h create mode 100644 deps/v8/src/objects/js-aggregate-error.h create mode 100644 deps/v8/src/objects/js-aggregate-error.tq create mode 100644 deps/v8/src/runtime/runtime-weak-refs.cc rename deps/v8/src/snapshot/{partial-deserializer.cc => context-deserializer.cc} (81%) rename deps/v8/src/snapshot/{partial-deserializer.h => context-deserializer.h} (77%) rename deps/v8/src/snapshot/{partial-serializer.cc => context-serializer.cc} (63%) rename deps/v8/src/snapshot/{partial-serializer.h => context-serializer.h} (68%) create mode 100644 deps/v8/src/snapshot/serializer-deserializer.cc rename deps/v8/src/snapshot/{serializer-common.h => serializer-deserializer.h} (61%) create mode 100644 deps/v8/src/snapshot/snapshot-data.cc create mode 100644 deps/v8/src/snapshot/snapshot-data.h create mode 100644 deps/v8/src/snapshot/snapshot-utils.cc create mode 100644 deps/v8/src/snapshot/snapshot-utils.h rename deps/v8/src/snapshot/{snapshot-common.cc => snapshot.cc} (52%) create mode 100644 deps/v8/src/tracing/DEPS create mode 100644 deps/v8/src/tracing/trace-categories.cc create mode 100644 deps/v8/src/tracing/trace-categories.h create mode 100644 deps/v8/src/wasm/struct-types.h create mode 100644 deps/v8/test/cctest/heap/test-concurrent-allocation.cc create mode 100644 deps/v8/test/cctest/interpreter/bytecode_expectations/PrivateClassFieldAccess.golden create mode 100644 deps/v8/test/cctest/test-api-icu.cc create mode 100644 deps/v8/test/cctest/test-persistent-handles.cc create mode 100644 deps/v8/test/cctest/wasm/test-gc.cc create mode 100644 deps/v8/test/cctest/wasm/test-run-wasm-simd-scalar-lowering.cc delete mode 100644 deps/v8/test/cctest/wasm/test-wasm-interpreter-entry.cc create mode 100644 deps/v8/test/debugger/debug/es6/debug-promises/promise-any-caught.js create mode 100644 deps/v8/test/debugger/debug/es6/debug-promises/promise-any-uncaught.js create mode 100644 deps/v8/test/debugger/debug/regress/regress-10319.js create mode 100644 deps/v8/test/debugging/wasm/gdb-server/OWNERS create mode 100644 deps/v8/test/debugging/wasm/gdb-server/breakpoints.py create mode 100644 deps/v8/test/debugging/wasm/gdb-server/float.py create mode 100644 deps/v8/test/debugging/wasm/gdb-server/memory.py create mode 100644 deps/v8/test/debugging/wasm/gdb-server/status.py create mode 100644 deps/v8/test/debugging/wasm/gdb-server/stepping.py create mode 100644 deps/v8/test/debugging/wasm/gdb-server/test_files/__init__.py delete mode 100644 deps/v8/test/debugging/wasm/gdb-server/test_files/test.js create mode 100644 deps/v8/test/debugging/wasm/gdb-server/test_files/test_basic.js create mode 100644 deps/v8/test/debugging/wasm/gdb-server/test_files/test_basic.py create mode 100644 deps/v8/test/debugging/wasm/gdb-server/test_files/test_float.js create mode 100644 deps/v8/test/debugging/wasm/gdb-server/test_files/test_float.py create mode 100644 deps/v8/test/debugging/wasm/gdb-server/test_files/test_memory.js create mode 100644 deps/v8/test/debugging/wasm/gdb-server/test_files/test_memory.py create mode 100644 deps/v8/test/debugging/wasm/gdb-server/test_files/test_trap.js create mode 100644 deps/v8/test/debugging/wasm/gdb-server/test_files/test_trap.py create mode 100644 deps/v8/test/debugging/wasm/gdb-server/trap.py create mode 100644 deps/v8/test/inspector/debugger/wasm-breakpoint-reset-on-debugger-restart-expected.txt create mode 100644 deps/v8/test/inspector/debugger/wasm-breakpoint-reset-on-debugger-restart.js create mode 100644 deps/v8/test/inspector/debugger/wasm-debug-evaluate-expected.txt create mode 100644 deps/v8/test/inspector/debugger/wasm-debug-evaluate.js create mode 100644 deps/v8/test/inspector/debugger/wasm-memory-names-expected.txt create mode 100644 deps/v8/test/inspector/debugger/wasm-memory-names.js create mode 100644 deps/v8/test/inspector/debugger/wasm-step-after-trap-expected.txt create mode 100644 deps/v8/test/inspector/debugger/wasm-step-after-trap.js create mode 100644 deps/v8/test/inspector/runtime/regress-1075763-expected.txt create mode 100644 deps/v8/test/inspector/runtime/regress-1075763.js create mode 100644 deps/v8/test/inspector/runtime/regress-1078205-expected.txt create mode 100644 deps/v8/test/inspector/runtime/regress-1078205.js create mode 100644 deps/v8/test/inspector/runtime/regress-986051-expected.txt create mode 100644 deps/v8/test/inspector/runtime/regress-986051.js create mode 100644 deps/v8/test/intl/regress-10437.js create mode 100644 deps/v8/test/intl/regress-10438.js create mode 100644 deps/v8/test/intl/regress-1074578.js create mode 100644 deps/v8/test/intl/regress-364374.js create mode 100644 deps/v8/test/js-perf-test/Operators/abstract-equality.js create mode 100644 deps/v8/test/js-perf-test/Operators/run.js create mode 100644 deps/v8/test/message/fail/spread-call-4.js create mode 100644 deps/v8/test/message/fail/spread-call-4.out delete mode 100644 deps/v8/test/message/wasm-trace-memory-interpreted.js delete mode 100644 deps/v8/test/message/wasm-trace-memory-interpreted.out create mode 100644 deps/v8/test/mjsunit/compiler/monomorphic-named-load-with-no-map.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-1065737.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-1067544.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-1068494.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-1070892.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-1071743.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-1074736.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-1082704.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-1084820.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-1092650.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-1094132.js create mode 100644 deps/v8/test/mjsunit/const-field-tracking-2.js create mode 100644 deps/v8/test/mjsunit/es6/promise-all-resolve-not-callable.js create mode 100644 deps/v8/test/mjsunit/es6/promise-allsettled-resolve-not-callable.js create mode 100644 deps/v8/test/mjsunit/es6/promise-race-resolve-not-callable.js delete mode 100644 deps/v8/test/mjsunit/es6/regress/regress-411237.js create mode 100644 deps/v8/test/mjsunit/es6/typedarray-from-optional-arguments.js create mode 100644 deps/v8/test/mjsunit/harmony/aggregate-error.js create mode 100644 deps/v8/test/mjsunit/harmony/logical-assignment.js create mode 100644 deps/v8/test/mjsunit/harmony/promise-any-overflow-1.js create mode 100644 deps/v8/test/mjsunit/harmony/promise-any-overflow-2.js create mode 100644 deps/v8/test/mjsunit/harmony/promise-any-resolve-not-callable.js create mode 100644 deps/v8/test/mjsunit/harmony/promise-any.js create mode 100644 deps/v8/test/mjsunit/harmony/weakrefs/basics-cleanupsome.js delete mode 100644 deps/v8/test/mjsunit/harmony/weakrefs/cleanup-doesnt-iterate-all-holdings.js rename deps/v8/test/mjsunit/harmony/weakrefs/{iterating-in-cleanup.js => cleanup.js} (78%) create mode 100644 deps/v8/test/mjsunit/harmony/weakrefs/cleanupsome-optional.js create mode 100644 deps/v8/test/mjsunit/harmony/weakrefs/clearkeptobjects-on-quit.js create mode 100644 deps/v8/test/mjsunit/harmony/weakrefs/stress-finalizationregistry-dirty-enqueue.js rename deps/v8/test/mjsunit/harmony/weakrefs/{unregister-inside-cleanup5.js => unregister-inside-cleanup.js} (65%) delete mode 100644 deps/v8/test/mjsunit/harmony/weakrefs/unregister-inside-cleanup1.js delete mode 100644 deps/v8/test/mjsunit/harmony/weakrefs/unregister-inside-cleanup4.js rename deps/v8/test/mjsunit/{class-of-builtins.js => object-tostring-builtins.js} (95%) create mode 100644 deps/v8/test/mjsunit/regress-crbug-1078825.js create mode 100644 deps/v8/test/mjsunit/regress/regress-10508.js create mode 100644 deps/v8/test/mjsunit/regress/regress-1069964.js create mode 100644 deps/v8/test/mjsunit/regress/regress-1071190.js create mode 100644 deps/v8/test/mjsunit/regress/regress-1076569.js create mode 100644 deps/v8/test/mjsunit/regress/regress-1077804.js create mode 100644 deps/v8/test/mjsunit/regress/regress-1078913.js delete mode 100644 deps/v8/test/mjsunit/regress/regress-491481.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1053939-1.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1055138-1.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1055138-2.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1055138-3.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1060023.js rename deps/v8/test/mjsunit/regress/{regress-347542.js => regress-crbug-1063796.js} (51%) create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1065741.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1067757.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1070560.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1074737.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-1077508.js create mode 100644 deps/v8/test/mjsunit/regress/regress-v8-10484-1.js create mode 100644 deps/v8/test/mjsunit/regress/regress-v8-10484-2.js create mode 100644 deps/v8/test/mjsunit/regress/regress-v8-10513.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1055692.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1065599.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1065635.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1065852.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1067621.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1070078.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1073553.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1074586-b.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1074586.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1075953.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1079449.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-1081030.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-7049.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-715216a.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-715216b.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-719175.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-766003.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-771243.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-772332.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-778917.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-831463.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-834624.js delete mode 100644 deps/v8/test/mjsunit/regress/wasm/regress-crbug-1007608.js create mode 100644 deps/v8/test/mjsunit/serialize-deserialize-now.js delete mode 100644 deps/v8/test/mjsunit/wasm/anyfunc-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/anyref-globals-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/anyref-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/compilation-hints-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/exceptions-anyref-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/exceptions-global-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/exceptions-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/exceptions-rethrow-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/exceptions-simd-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/futex-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/indirect-call-non-zero-table-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/interpreter-mixed.js delete mode 100644 deps/v8/test/mjsunit/wasm/interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/multi-value-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/nullref-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/table-access-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/table-fill-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/table-grow-from-wasm-interpreter.js delete mode 100644 deps/v8/test/mjsunit/wasm/worker-interpreter.js create mode 100644 deps/v8/test/test262/harness-ishtmldda.js delete mode 100644 deps/v8/test/unittests/heap/cppgc/allocation_unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/custom-spaces-unittest.cc rename deps/v8/test/unittests/heap/cppgc/{finalizer-trait_unittest.cc => finalizer-trait-unittest.cc} (98%) create mode 100644 deps/v8/test/unittests/heap/cppgc/free-list-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/garbage-collected-unittest.cc delete mode 100644 deps/v8/test/unittests/heap/cppgc/garbage-collected_unittest.cc rename deps/v8/test/unittests/heap/cppgc/{gc-info_unittest.cc => gc-info-unittest.cc} (99%) rename deps/v8/test/unittests/heap/cppgc/{heap-object-header_unittest.cc => heap-object-header-unittest.cc} (100%) create mode 100644 deps/v8/test/unittests/heap/cppgc/heap-page-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/heap-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/logging-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/marker-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/marking-visitor-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/member-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/object-start-bitmap-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/page-memory-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/persistent-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/prefinalizer-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/source-location-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/stack-unittest.cc delete mode 100644 deps/v8/test/unittests/heap/cppgc/stack_unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/sweeper-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/visitor-unittest.cc create mode 100644 deps/v8/test/unittests/heap/cppgc/worklist-unittest.cc rename deps/v8/test/unittests/{base => heap}/list-unittest.cc (90%) create mode 100644 deps/v8/test/unittests/libplatform/default-job-unittest.cc create mode 100644 deps/v8/test/unittests/wasm/wasm-gdbserver-unittest.cc delete mode 100644 deps/v8/test/unittests/wasm/wasm-opcodes-unittest.cc delete mode 100644 deps/v8/testing/gmock/include/gmock/gmock-generated-function-mockers.h create mode 100644 deps/v8/third_party/jsoncpp/BUILD.gn create mode 100644 deps/v8/third_party/jsoncpp/LICENSE create mode 100644 deps/v8/third_party/jsoncpp/README.chromium create mode 100644 deps/v8/third_party/jsoncpp/generated/version.h create mode 100644 deps/v8/third_party/zlib/DEPS create mode 100644 deps/v8/third_party/zlib/patches/0005-infcover-gtest.patch delete mode 100644 deps/v8/tools/testrunner/local/junit_output.py create mode 100644 deps/v8/tools/testrunner/testproc/util.py create mode 100644 deps/v8/tools/testrunner/testproc/util_unittest.py diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index 1afbd765d3e6c2..6d2cf1077a522a 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -61,6 +61,8 @@ !/third_party/antlr4 !/third_party/binutils !/third_party/inspector_protocol +!/third_party/jsoncpp +/third_party/jsoncpp/source !/third_party/colorama /third_party/colorama/src !/third_party/googletest diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 7036ecd42bc461..47a83c5ff1c905 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -43,6 +43,7 @@ Julia Computing, Inc. <*@juliacomputing.com> Aaron Bieber Abdulla Kamar +Adam Kallai Akinori MUSHA Alessandro Pignotti Alex Kodat @@ -112,6 +113,7 @@ James Pike James M Snell Jianghua Yang Jiawen Geng +Jiaxun Yang Joel Stanley Johan Bergström Jonathan Liu @@ -211,3 +213,4 @@ Zhao Jiazhong Zhongping Wang 柳荣一 Yanbo Li +Gilang Mentari Hamidy \ No newline at end of file diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index b2dde3f9d70312..167e63503c5535 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -218,6 +218,17 @@ declare_args() { # Enable control-flow integrity features, such as pointer authentication for # ARM64. v8_control_flow_integrity = false + + # Enable object names in cppgc for debug purposes. + cppgc_enable_object_names = false + + # Enable V8 heap sandbox experimental feature. + # Sets -DV8_HEAP_SANDBOX. + v8_enable_heap_sandbox = "" + + # Experimental support for native context independent code. + # https://crbug.com/v8/8888 + v8_enable_nci_code = false } # Derived defaults. @@ -254,7 +265,9 @@ if (v8_enable_pointer_compression == "") { if (v8_enable_fast_torque == "") { v8_enable_fast_torque = v8_enable_fast_mksnapshot } - +if (v8_enable_heap_sandbox == "") { + v8_enable_heap_sandbox = false +} if (v8_enable_single_generation == "") { v8_enable_single_generation = v8_disable_write_barriers } @@ -284,6 +297,9 @@ assert( !v8_enable_pointer_compression || !v8_enable_shared_ro_heap, "Pointer compression is not supported with shared read-only heap enabled") +assert(!v8_enable_heap_sandbox || v8_enable_pointer_compression, + "V8 Heap Sandbox requires pointer compression") + v8_random_seed = "314159265" v8_toolset_for_shell = "host" @@ -294,8 +310,11 @@ v8_toolset_for_shell = "host" config("internal_config_base") { visibility = [ ":*" ] # Only targets in this file can depend on this. + configs = [ ":v8_tracing_config" ] + include_dirs = [ ".", + "include", "$target_gen_dir", ] } @@ -308,7 +327,6 @@ config("internal_config") { "//build/config/compiler:wexit_time_destructors", ":internal_config_base", ":v8_header_features", - ":v8_tracing_config", ] if (is_component_build) { @@ -346,6 +364,14 @@ config("libbase_config") { } } +# This config should be applied to code using the cppgc_base. +config("cppgc_base_config") { + defines = [] + if (cppgc_enable_object_names) { + defines += [ "CPPGC_SUPPORTS_OBJECT_NAMES" ] + } +} + # This config should be applied to code using the libsampler. config("libsampler_config") { include_dirs = [ "include" ] @@ -389,6 +415,9 @@ config("v8_header_features") { if (v8_enable_pointer_compression || v8_enable_31bit_smis_on_64bit_arch) { defines += [ "V8_31BIT_SMIS_ON_64BIT_ARCH" ] } + if (v8_enable_heap_sandbox) { + defines += [ "V8_HEAP_SANDBOX" ] + } if (v8_deprecation_warnings) { defines += [ "V8_DEPRECATION_WARNINGS" ] } @@ -428,10 +457,6 @@ config("features") { } if (v8_enable_lite_mode) { defines += [ "V8_LITE_MODE" ] - - # TODO(v8:7777): Remove the define once the --jitless runtime flag does - # everything we need. - defines += [ "V8_JITLESS_MODE" ] } if (v8_enable_gdbjit) { defines += [ "ENABLE_GDB_JIT_INTERFACE" ] @@ -501,10 +526,6 @@ config("features") { if (v8_check_microtasks_scopes_consistency) { defines += [ "V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY" ] } - - # TODO(v8:8519): Remove the define once all use-sites in - # the code are removed/fixed - defines += [ "V8_EMBEDDED_BUILTINS" ] if (v8_use_multi_snapshots) { defines += [ "V8_MULTI_SNAPSHOTS" ] } @@ -532,6 +553,9 @@ config("features") { if (v8_enable_wasm_gdb_remote_debugging) { defines += [ "V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING" ] } + if (v8_enable_nci_code) { + defines += [ "V8_ENABLE_NCI_CODE" ] + } } config("toolchain") { @@ -630,7 +654,9 @@ config("toolchain") { if (v8_can_use_fpu_instructions) { defines += [ "CAN_USE_FPU_INSTRUCTIONS" ] } - + if (mips_use_msa) { + defines += [ "_MIPS_MSA" ] + } if (host_byteorder == "little") { defines += [ "V8_TARGET_ARCH_MIPS64_LE" ] } else if (host_byteorder == "big") { @@ -646,9 +672,6 @@ config("toolchain") { } if (mips_arch_variant == "r6") { defines += [ "_MIPS_ARCH_MIPS64R6" ] - if (mips_use_msa) { - defines += [ "_MIPS_MSA" ] - } } else if (mips_arch_variant == "r2") { defines += [ "_MIPS_ARCH_MIPS64R2" ] } @@ -1012,9 +1035,12 @@ torque_files = [ "src/builtins/convert.tq", "src/builtins/console.tq", "src/builtins/data-view.tq", + "src/builtins/finalization-registry.tq", "src/builtins/frames.tq", "src/builtins/frame-arguments.tq", "src/builtins/growable-fixed-array.tq", + "src/builtins/ic-callable.tq", + "src/builtins/ic.tq", "src/builtins/internal-coverage.tq", "src/builtins/iterator.tq", "src/builtins/math.tq", @@ -1024,6 +1050,7 @@ torque_files = [ "src/builtins/promise-abstract-operations.tq", "src/builtins/promise-all.tq", "src/builtins/promise-all-element-closure.tq", + "src/builtins/promise-any.tq", "src/builtins/promise-constructor.tq", "src/builtins/promise-finally.tq", "src/builtins/promise-misc.tq", @@ -1082,6 +1109,7 @@ torque_files = [ "src/builtins/typed-array-sort.tq", "src/builtins/typed-array-subarray.tq", "src/builtins/typed-array.tq", + "src/builtins/wasm.tq", "src/ic/handler-configuration.tq", "src/objects/allocation-site.tq", "src/objects/api-callbacks.tq", @@ -1101,6 +1129,7 @@ torque_files = [ "src/objects/heap-number.tq", "src/objects/heap-object.tq", "src/objects/intl-objects.tq", + "src/objects/js-aggregate-error.tq", "src/objects/js-array-buffer.tq", "src/objects/js-array.tq", "src/objects/js-collection-iterator.tq", @@ -1184,7 +1213,7 @@ template("run_torque") { "class-verifiers-tq.h", "enum-verifiers-tq.cc", "objects-printer-tq.cc", - "objects-body-descriptors-tq-inl.h", + "objects-body-descriptors-tq-inl.inc", "class-definitions-tq.cc", "class-definitions-tq-inl.h", "class-definitions-tq.h", @@ -1196,6 +1225,8 @@ template("run_torque") { "instance-types-tq.h", "internal-class-definitions-tq.h", "internal-class-definitions-tq-inl.h", + "exported-class-definitions-tq.h", + "exported-class-definitions-tq-inl.h", ] outputs = [] @@ -1270,6 +1301,7 @@ v8_source_set("torque_generated_initializers") { deps = [ ":generate_bytecode_builtins_list", ":run_torque", + ":v8_tracing", ] public_deps = [ ":v8_maybe_icu" ] @@ -1298,6 +1330,7 @@ v8_source_set("torque_generated_definitions") { deps = [ ":generate_bytecode_builtins_list", ":run_torque", + ":v8_tracing", ] public_deps = [ ":v8_maybe_icu" ] @@ -1573,7 +1606,10 @@ v8_source_set("v8_initializers") { "test/cctest:*", ] - deps = [ ":torque_generated_initializers" ] + deps = [ + ":torque_generated_initializers", + ":v8_tracing", + ] sources = [ ### gcmole(all) ### @@ -1624,6 +1660,7 @@ v8_source_set("v8_initializers") { "src/builtins/builtins-typed-array-gen.h", "src/builtins/builtins-utils-gen.h", "src/builtins/builtins-wasm-gen.cc", + "src/builtins/builtins-wasm-gen.h", "src/builtins/growable-fixed-array-gen.cc", "src/builtins/growable-fixed-array-gen.h", "src/builtins/setup-builtins-internal.cc", @@ -1701,7 +1738,10 @@ v8_source_set("v8_initializers") { v8_source_set("v8_init") { visibility = [ ":*" ] # Only targets in this file can depend on this. - deps = [ ":v8_initializers" ] + deps = [ + ":v8_initializers", + ":v8_tracing", + ] sources = [ ### gcmole(all) ### @@ -2005,6 +2045,7 @@ v8_source_set("v8_compiler_opt") { ":generate_bytecode_builtins_list", ":run_torque", ":v8_maybe_icu", + ":v8_tracing", ] if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) { @@ -2029,6 +2070,7 @@ v8_source_set("v8_compiler") { ":generate_bytecode_builtins_list", ":run_torque", ":v8_maybe_icu", + ":v8_tracing", ] configs = [ ":internal_config" ] @@ -2042,6 +2084,18 @@ group("v8_compiler_for_mksnapshot") { } } +# Any target using trace events must directly or indirectly depend on +# v8_tracing. +group("v8_tracing") { + if (v8_use_perfetto) { + if (build_with_chromium) { + public_deps = [ "//third_party/perfetto:libperfetto" ] + } else { + public_deps = [ ":v8_libperfetto" ] + } + } +} + v8_source_set("v8_base_without_compiler") { visibility = [ ":*" ] # Only targets in this file can depend on this. @@ -2053,6 +2107,7 @@ v8_source_set("v8_base_without_compiler") { ### gcmole(all) ### "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h", + "include/cppgc/common.h", "include/v8-fast-api-calls.h", "include/v8-inspector-protocol.h", "include/v8-inspector.h", @@ -2121,7 +2176,6 @@ v8_source_set("v8_base_without_compiler") { "src/builtins/builtins-json.cc", "src/builtins/builtins-number.cc", "src/builtins/builtins-object.cc", - "src/builtins/builtins-promise.cc", "src/builtins/builtins-promise.h", "src/builtins/builtins-reflect.cc", "src/builtins/builtins-regexp.cc", @@ -2160,6 +2214,8 @@ v8_source_set("v8_base_without_compiler") { "src/codegen/constant-pool.h", "src/codegen/constants-arch.h", "src/codegen/cpu-features.h", + "src/codegen/external-reference-encoder.cc", + "src/codegen/external-reference-encoder.h", "src/codegen/external-reference-table.cc", "src/codegen/external-reference-table.h", "src/codegen/external-reference.cc", @@ -2207,6 +2263,8 @@ v8_source_set("v8_base_without_compiler") { "src/common/assert-scope.cc", "src/common/assert-scope.h", "src/common/checks.h", + "src/common/external-pointer-inl.h", + "src/common/external-pointer.h", "src/common/message-template.h", "src/common/ptr-compr-inl.h", "src/common/ptr-compr.h", @@ -2284,6 +2342,7 @@ v8_source_set("v8_base_without_compiler") { "src/execution/messages.h", "src/execution/microtask-queue.cc", "src/execution/microtask-queue.h", + "src/execution/off-thread-isolate-inl.h", "src/execution/off-thread-isolate.cc", "src/execution/off-thread-isolate.h", "src/execution/pointer-authentication.h", @@ -2330,6 +2389,8 @@ v8_source_set("v8_base_without_compiler") { "src/handles/local-handles.h", "src/handles/maybe-handles-inl.h", "src/handles/maybe-handles.h", + "src/handles/persistent-handles.cc", + "src/handles/persistent-handles.h", "src/heap/array-buffer-collector.cc", "src/heap/array-buffer-collector.h", "src/heap/array-buffer-sweeper.cc", @@ -2344,6 +2405,9 @@ v8_source_set("v8_base_without_compiler") { "src/heap/code-stats.h", "src/heap/combined-heap.cc", "src/heap/combined-heap.h", + "src/heap/concurrent-allocator-inl.h", + "src/heap/concurrent-allocator.cc", + "src/heap/concurrent-allocator.h", "src/heap/concurrent-marking.cc", "src/heap/concurrent-marking.h", "src/heap/embedder-tracing.cc", @@ -2376,6 +2440,9 @@ v8_source_set("v8_base_without_compiler") { "src/heap/invalidated-slots.h", "src/heap/item-parallel-job.cc", "src/heap/item-parallel-job.h", + "src/heap/large-spaces.cc", + "src/heap/large-spaces.h", + "src/heap/list.h", "src/heap/local-allocator-inl.h", "src/heap/local-allocator.h", "src/heap/local-heap.cc", @@ -2389,6 +2456,9 @@ v8_source_set("v8_base_without_compiler") { "src/heap/marking-worklist.h", "src/heap/marking.cc", "src/heap/marking.h", + "src/heap/memory-chunk-inl.h", + "src/heap/memory-chunk.cc", + "src/heap/memory-chunk.h", "src/heap/memory-measurement-inl.h", "src/heap/memory-measurement.cc", "src/heap/memory-measurement.h", @@ -2401,9 +2471,13 @@ v8_source_set("v8_base_without_compiler") { "src/heap/objects-visiting.h", "src/heap/off-thread-factory.cc", "src/heap/off-thread-factory.h", + "src/heap/off-thread-heap.cc", + "src/heap/off-thread-heap.h", "src/heap/read-only-heap-inl.h", "src/heap/read-only-heap.cc", "src/heap/read-only-heap.h", + "src/heap/read-only-spaces.cc", + "src/heap/read-only-spaces.h", "src/heap/remembered-set.h", "src/heap/safepoint.cc", "src/heap/safepoint.h", @@ -2598,6 +2672,8 @@ v8_source_set("v8_base_without_compiler") { "src/objects/internal-index.h", "src/objects/intl-objects.cc", "src/objects/intl-objects.h", + "src/objects/js-aggregate-error-inl.h", + "src/objects/js-aggregate-error.h", "src/objects/js-array-buffer-inl.h", "src/objects/js-array-buffer.cc", "src/objects/js-array-buffer.h", @@ -2888,6 +2964,7 @@ v8_source_set("v8_base_without_compiler") { "src/runtime/runtime-typedarray.cc", "src/runtime/runtime-utils.h", "src/runtime/runtime-wasm.cc", + "src/runtime/runtime-weak-refs.cc", "src/runtime/runtime.cc", "src/runtime/runtime.h", "src/sanitizer/asan.h", @@ -2897,6 +2974,10 @@ v8_source_set("v8_base_without_compiler") { "src/sanitizer/tsan.h", "src/snapshot/code-serializer.cc", "src/snapshot/code-serializer.h", + "src/snapshot/context-deserializer.cc", + "src/snapshot/context-deserializer.h", + "src/snapshot/context-serializer.cc", + "src/snapshot/context-serializer.h", "src/snapshot/deserializer-allocator.cc", "src/snapshot/deserializer-allocator.h", "src/snapshot/deserializer.cc", @@ -2905,10 +2986,6 @@ v8_source_set("v8_base_without_compiler") { "src/snapshot/embedded/embedded-data.h", "src/snapshot/object-deserializer.cc", "src/snapshot/object-deserializer.h", - "src/snapshot/partial-deserializer.cc", - "src/snapshot/partial-deserializer.h", - "src/snapshot/partial-serializer.cc", - "src/snapshot/partial-serializer.h", "src/snapshot/read-only-deserializer.cc", "src/snapshot/read-only-deserializer.h", "src/snapshot/read-only-serializer.cc", @@ -2918,15 +2995,19 @@ v8_source_set("v8_base_without_compiler") { "src/snapshot/roots-serializer.h", "src/snapshot/serializer-allocator.cc", "src/snapshot/serializer-allocator.h", - "src/snapshot/serializer-common.cc", - "src/snapshot/serializer-common.h", + "src/snapshot/serializer-deserializer.cc", + "src/snapshot/serializer-deserializer.h", "src/snapshot/serializer.cc", "src/snapshot/serializer.h", - "src/snapshot/snapshot-common.cc", "src/snapshot/snapshot-compression.cc", "src/snapshot/snapshot-compression.h", + "src/snapshot/snapshot-data.cc", + "src/snapshot/snapshot-data.h", "src/snapshot/snapshot-source-sink.cc", "src/snapshot/snapshot-source-sink.h", + "src/snapshot/snapshot-utils.cc", + "src/snapshot/snapshot-utils.h", + "src/snapshot/snapshot.cc", "src/snapshot/snapshot.h", "src/snapshot/startup-deserializer.cc", "src/snapshot/startup-deserializer.h", @@ -3026,6 +3107,7 @@ v8_source_set("v8_base_without_compiler") { "src/wasm/signature-map.h", "src/wasm/streaming-decoder.cc", "src/wasm/streaming-decoder.h", + "src/wasm/struct-types.h", "src/wasm/value-type.h", "src/wasm/wasm-arguments.h", "src/wasm/wasm-code-manager.cc", @@ -3085,21 +3167,28 @@ v8_source_set("v8_base_without_compiler") { if (v8_enable_third_party_heap) { sources += v8_third_party_heap_files + } else { + sources += [ "src/heap/third-party/heap-api-stub.cc" ] } if (v8_enable_wasm_gdb_remote_debugging) { sources += [ + "src/debug/wasm/gdb-server/gdb-remote-util.cc", + "src/debug/wasm/gdb-server/gdb-remote-util.h", "src/debug/wasm/gdb-server/gdb-server-thread.cc", "src/debug/wasm/gdb-server/gdb-server-thread.h", "src/debug/wasm/gdb-server/gdb-server.cc", "src/debug/wasm/gdb-server/gdb-server.h", + "src/debug/wasm/gdb-server/packet.cc", + "src/debug/wasm/gdb-server/packet.h", "src/debug/wasm/gdb-server/session.cc", "src/debug/wasm/gdb-server/session.h", "src/debug/wasm/gdb-server/target.cc", "src/debug/wasm/gdb-server/target.h", "src/debug/wasm/gdb-server/transport.cc", "src/debug/wasm/gdb-server/transport.h", - "src/debug/wasm/gdb-server/util.h", + "src/debug/wasm/gdb-server/wasm-module-debug.cc", + "src/debug/wasm/gdb-server/wasm-module-debug.h", ] } @@ -3420,6 +3509,7 @@ v8_source_set("v8_base_without_compiler") { ":v8_libbase", ":v8_libsampler", ":v8_shared_internal_headers", + ":v8_tracing", ":v8_version", "src/inspector:inspector", ] @@ -3511,6 +3601,14 @@ v8_source_set("v8_base_without_compiler") { ] deps += [ "src/third_party/vtune:v8_vtune_trace_mark" ] } + + if (v8_use_perfetto) { + sources -= [ "//base/trace_event/common/trace_event_common.h" ] + sources += [ + "src/tracing/trace-categories.cc", + "src/tracing/trace-categories.h", + ] + } } group("v8_base") { @@ -3672,7 +3770,6 @@ v8_component("v8_libbase") { "src/base/ieee754.h", "src/base/iterator.h", "src/base/lazy-instance.h", - "src/base/list.h", "src/base/logging.cc", "src/base/logging.h", "src/base/lsan.h", @@ -3843,6 +3940,8 @@ v8_component("v8_libplatform") { "include/libplatform/v8-tracing.h", "src/libplatform/default-foreground-task-runner.cc", "src/libplatform/default-foreground-task-runner.h", + "src/libplatform/default-job.cc", + "src/libplatform/default-job.h", "src/libplatform/default-platform.cc", "src/libplatform/default-platform.h", "src/libplatform/default-worker-threads-task-runner.cc", @@ -3873,20 +3972,25 @@ v8_component("v8_libplatform") { deps = [ ":v8_headers", ":v8_libbase", + ":v8_tracing", ] + if (v8_use_perfetto) { + sources -= [ + "//base/trace_event/common/trace_event_common.h", + "src/libplatform/tracing/trace-buffer.cc", + "src/libplatform/tracing/trace-buffer.h", + "src/libplatform/tracing/trace-object.cc", + "src/libplatform/tracing/trace-writer.cc", + "src/libplatform/tracing/trace-writer.h", + ] sources += [ - "src/libplatform/tracing/json-trace-event-listener.cc", - "src/libplatform/tracing/json-trace-event-listener.h", "src/libplatform/tracing/trace-event-listener.cc", "src/libplatform/tracing/trace-event-listener.h", ] deps += [ + # TODO(skyostil): Switch TraceEventListener to protozero. "//third_party/perfetto/protos/perfetto/trace:lite", - "//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite", - "//third_party/perfetto/protos/perfetto/trace/chrome:zero", - "//third_party/perfetto/src/tracing:client_api", - "//third_party/perfetto/src/tracing:platform_posix", ] } } @@ -3914,9 +4018,8 @@ v8_source_set("fuzzer_support") { configs = [ ":internal_config_base" ] - deps = [ ":v8" ] - public_deps = [ + ":v8", ":v8_libbase", ":v8_libplatform", ":v8_maybe_icu", @@ -3928,14 +4031,33 @@ v8_source_set("cppgc_base") { sources = [ "include/cppgc/allocation.h", - "include/cppgc/api-constants.h", - "include/cppgc/finalizer-trait.h", + "include/cppgc/common.h", + "include/cppgc/custom-space.h", "include/cppgc/garbage-collected.h", - "include/cppgc/gc-info.h", "include/cppgc/heap.h", + "include/cppgc/internal/accessors.h", + "include/cppgc/internal/api-contants.h", + "include/cppgc/internal/compiler-specific.h", + "include/cppgc/internal/finalizer-traits.h", + "include/cppgc/internal/gc-info.h", + "include/cppgc/internal/persistent-node.h", + "include/cppgc/internal/pointer-policies.h", + "include/cppgc/internal/prefinalizer-handler.h", + "include/cppgc/liveness-broker.h", + "include/cppgc/liveness-broker.h", + "include/cppgc/macros.h", + "include/cppgc/member.h", + "include/cppgc/persistent.h", "include/cppgc/platform.h", + "include/cppgc/prefinalizer.h", + "include/cppgc/source-location.h", + "include/cppgc/trace-trait.h", + "include/cppgc/type-traits.h", + "include/cppgc/visitor.h", "include/v8config.h", "src/heap/cppgc/allocation.cc", + "src/heap/cppgc/free-list.cc", + "src/heap/cppgc/free-list.h", "src/heap/cppgc/gc-info-table.cc", "src/heap/cppgc/gc-info-table.h", "src/heap/cppgc/gc-info.cc", @@ -3943,23 +4065,75 @@ v8_source_set("cppgc_base") { "src/heap/cppgc/heap-object-header-inl.h", "src/heap/cppgc/heap-object-header.cc", "src/heap/cppgc/heap-object-header.h", + "src/heap/cppgc/heap-page.cc", + "src/heap/cppgc/heap-page.h", + "src/heap/cppgc/heap-space.cc", + "src/heap/cppgc/heap-space.h", + "src/heap/cppgc/heap-visitor.h", "src/heap/cppgc/heap.cc", "src/heap/cppgc/heap.h", + "src/heap/cppgc/liveness-broker.cc", + "src/heap/cppgc/logging.cc", + "src/heap/cppgc/marker.cc", + "src/heap/cppgc/marker.h", + "src/heap/cppgc/marking-visitor.cc", + "src/heap/cppgc/marking-visitor.h", + "src/heap/cppgc/object-allocator-inl.h", + "src/heap/cppgc/object-allocator.cc", + "src/heap/cppgc/object-allocator.h", + "src/heap/cppgc/object-start-bitmap-inl.h", + "src/heap/cppgc/object-start-bitmap.h", + "src/heap/cppgc/page-memory-inl.h", + "src/heap/cppgc/page-memory.cc", + "src/heap/cppgc/page-memory.h", + "src/heap/cppgc/persistent-node.cc", "src/heap/cppgc/platform.cc", + "src/heap/cppgc/pointer-policies.cc", + "src/heap/cppgc/prefinalizer-handler.cc", + "src/heap/cppgc/prefinalizer-handler.h", + "src/heap/cppgc/raw-heap.cc", + "src/heap/cppgc/raw-heap.h", "src/heap/cppgc/sanitizers.h", + "src/heap/cppgc/source-location.cc", "src/heap/cppgc/stack.cc", "src/heap/cppgc/stack.h", + "src/heap/cppgc/sweeper.cc", + "src/heap/cppgc/sweeper.h", + "src/heap/cppgc/worklist.h", ] - if (target_cpu == "x64") { - if (is_win) { - sources += [ "src/heap/cppgc/asm/x64/push_registers_win.S" ] - } else { - sources += [ "src/heap/cppgc/asm/x64/push_registers.S" ] + if (is_clang || !is_win) { + if (target_cpu == "x64") { + sources += [ "src/heap/cppgc/asm/x64/push_registers_asm.cc" ] + } else if (target_cpu == "x86") { + sources += [ "src/heap/cppgc/asm/ia32/push_registers_asm.cc" ] + } else if (target_cpu == "arm") { + sources += [ "src/heap/cppgc/asm/arm/push_registers_asm.cc" ] + } else if (target_cpu == "arm64") { + sources += [ "src/heap/cppgc/asm/arm64/push_registers_asm.cc" ] + } else if (target_cpu == "ppc64") { + sources += [ "src/heap/cppgc/asm/ppc/push_registers_asm.cc" ] + } else if (target_cpu == "s390x") { + sources += [ "src/heap/cppgc/asm/s390/push_registers_asm.cc" ] + } else if (target_cpu == "mipsel") { + sources += [ "src/heap/cppgc/asm/mips/push_registers_asm.cc" ] + } else if (target_cpu == "mips64el") { + sources += [ "src/heap/cppgc/asm/mips64/push_registers_asm.cc" ] + } + } else if (is_win) { + if (target_cpu == "x64") { + sources += [ "src/heap/cppgc/asm/x64/push_registers_masm.S" ] + } else if (target_cpu == "x86") { + sources += [ "src/heap/cppgc/asm/ia32/push_registers_masm.S" ] + } else if (target_cpu == "arm64") { + sources += [ "src/heap/cppgc/asm/arm64/push_registers_masm.S" ] } } - configs = [ ":internal_config" ] + configs = [ + ":internal_config", + ":cppgc_base_config", + ] public_deps = [ ":v8_libbase" ] } @@ -4010,12 +4184,6 @@ v8_static_library("wee8") { ] } -v8_static_library("cppgc") { - deps = [ ":cppgc_base" ] - - configs = [ ":internal_config" ] -} - ############################################################################### # Executables # @@ -4074,6 +4242,7 @@ if (current_toolchain == v8_snapshot_toolchain) { ":v8_libbase", ":v8_libplatform", ":v8_maybe_icu", + ":v8_tracing", "//build/win:default_exe_manifest", ] } @@ -4308,6 +4477,14 @@ if (is_component_build) { public_configs = [ ":external_config" ] } + v8_component("cppgc") { + public_deps = [ ":cppgc_base" ] + + configs = [ ":internal_config" ] + + public_configs = [ ":external_config" ] + } + v8_component("cppgc_for_testing") { testonly = true @@ -4340,6 +4517,12 @@ if (is_component_build) { public_configs = [ ":external_config" ] } + group("cppgc") { + public_deps = [ ":cppgc_base" ] + + public_configs = [ ":external_config" ] + } + group("cppgc_for_testing") { testonly = true @@ -4374,6 +4557,7 @@ v8_executable("d8") { ":v8", ":v8_libbase", ":v8_libplatform", + ":v8_tracing", "//build/win:default_exe_manifest", ] @@ -4392,10 +4576,6 @@ v8_executable("d8") { if (v8_enable_vtunejit) { deps += [ "src/third_party/vtune:v8_vtune" ] } - - if (v8_use_perfetto) { - deps += [ "//third_party/perfetto/src/tracing:in_process_backend" ] - } } v8_executable("v8_hello_world") { @@ -4551,6 +4731,7 @@ v8_source_set("wasm_module_runner") { deps = [ ":generate_bytecode_builtins_list", ":run_torque", + ":v8_tracing", ] public_deps = [ ":v8_maybe_icu" ] @@ -4627,6 +4808,7 @@ v8_source_set("lib_wasm_fuzzer_common") { deps = [ ":generate_bytecode_builtins_list", ":run_torque", + ":v8_tracing", ] public_deps = [ ":v8_maybe_icu" ] @@ -4709,7 +4891,7 @@ if (!build_with_chromium && v8_use_perfetto) { "-Wno-tautological-constant-compare", ] } - if (is_win) { + if (is_win && is_clang) { cflags += [ "-Wno-microsoft-unqualified-friend" ] } } @@ -4868,4 +5050,21 @@ if (!build_with_chromium && v8_use_perfetto) { configs += [ "//build/config/compiler:no_chromium_code" ] } } # host_toolchain + + v8_component("v8_libperfetto") { + configs = [ ":v8_tracing_config" ] + public_configs = [ "//third_party/perfetto/gn:public_config" ] + deps = [ + "//third_party/perfetto/src/trace_processor:export_json", + "//third_party/perfetto/src/trace_processor:storage_minimal", + "//third_party/perfetto/src/tracing:client_api", + "//third_party/perfetto/src/tracing/core", + + # TODO(skyostil): Support non-POSIX platforms. + "//third_party/perfetto/protos/perfetto/config:cpp", + "//third_party/perfetto/protos/perfetto/trace/track_event:zero", + "//third_party/perfetto/src/tracing:in_process_backend", + "//third_party/perfetto/src/tracing:platform_posix", + ] + } } # if (!build_with_chromium && v8_use_perfetto) diff --git a/deps/v8/COMMON_OWNERS b/deps/v8/COMMON_OWNERS index 1eee48173a1576..1319a579173c3c 100644 --- a/deps/v8/COMMON_OWNERS +++ b/deps/v8/COMMON_OWNERS @@ -2,6 +2,7 @@ adamk@chromium.org ahaas@chromium.org bbudge@chromium.org binji@chromium.org +bikineev@chromium.org bmeurer@chromium.org cbruni@chromium.org clemensb@chromium.org @@ -25,6 +26,7 @@ mslekova@chromium.org mvstanton@chromium.org mythria@chromium.org neis@chromium.org +omerkatz@chromium.org petermarshall@chromium.org rmcilroy@chromium.org sigurds@chromium.org diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 1bc687beaf6ead..7b38c3dcd07b17 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -34,7 +34,7 @@ vars = { 'gn_version': 'git_revision:5ed3c9cc67b090d5e311e4bd2aba072173e82db9', # luci-go CIPD package version. - 'luci_go': 'git_revision:de73cf6c4bde86f0a9c8d54151b69b0154a398f1', + 'luci_go': 'git_revision:56ae79476e3caf14da59d75118408aa778637936', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_build-tools_version @@ -55,7 +55,7 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_platform-tools_version # and whatever else without interference from each other. - 'android_sdk_platform-tools_version': 'Jxtur3_L9RzY4q79K-AwIahwFW4oi5uYVD5URx9h62wC', + 'android_sdk_platform-tools_version': 'zMVtBEihXp2Z0NYFNjLLmNrwy6252b_YWG6sh2l0QAcC', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_platforms_version # and whatever else without interference from each other. @@ -67,20 +67,20 @@ vars = { # Three lines of non-changing comments so that # the commit queue can handle CLs rolling android_sdk_tools-lint_version # and whatever else without interference from each other. - 'android_sdk_tools-lint_version': '89hXqZYzCum3delB5RV7J_QyWkaRodqdtQS0s3LMh3wC', + 'android_sdk_cmdline-tools_version': 'CR25ixsRhwuRnhdgDpGFyl9S0C_0HO9SUgFrwX46zq8C', } deps = { 'v8/build': - Var('chromium_url') + '/chromium/src/build.git' + '@' + '26e9d485d01d6e0eb9dadd21df767a63494c8fea', + Var('chromium_url') + '/chromium/src/build.git' + '@' + '1b904cc30093c25d5fd48389bd58e3f7409bcf80', 'v8/third_party/depot_tools': - Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '2b2aec6506a810f8d7bd018609de2c2450b3c121', + Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '454f4ba4b3a69feb03c73f93d789062033433b4c', 'v8/third_party/icu': - Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'd7aff76cf6bb0fbef3afa6c07718f78a80a70f8f', + Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'f2223961702f00a8833874b0560d615a2cc42738', 'v8/third_party/instrumented_libraries': Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + 'bb3f1802c237dd19105dd0f7919f99e536a39d10', 'v8/buildtools': - Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '7977eb176752aeec29d888cfe8e677ac12ed1c41', + Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '204a35a2a64f7179f8b76d7a0385653690839e21', 'v8/buildtools/clang_format/script': Var('chromium_url') + '/chromium/llvm-project/cfe/tools/clang-format.git' + '@' + '96636aa0e9f047f17447f2d45a094d0b59ed7917', 'v8/buildtools/linux64': { @@ -108,7 +108,7 @@ deps = { 'v8/buildtools/third_party/libc++abi/trunk': Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '196ba1aaa8ac285d94f4ea8d9836390a45360533', 'v8/buildtools/third_party/libunwind/trunk': - Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '43bb9f872232f531bac80093ceb4de61c64b9ab7', + Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'd999d54f4bca789543a2eb6c995af2d9b5a1f3ed', 'v8/buildtools/win': { 'packages': [ { @@ -126,7 +126,7 @@ deps = { 'condition': 'checkout_android', }, 'v8/third_party/android_platform': { - 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '2244b5ea295f8fda3179bef160c84ef8fa0ec9fc', + 'url': Var('chromium_url') + '/chromium/src/third_party/android_platform.git' + '@' + '716366f5685ad8aaf1208c64941e440e8e117441', 'condition': 'checkout_android', }, 'v8/third_party/android_sdk/public': { @@ -160,15 +160,15 @@ deps = { 'version': Var('android_sdk_sources_version'), }, { - 'package': 'chromium/third_party/android_sdk/public/tools-lint', - 'version': Var('android_sdk_tools-lint_version'), + 'package': 'chromium/third_party/android_sdk/public/cmdline-tools', + 'version': Var('android_sdk_cmdline-tools_version'), }, ], 'condition': 'checkout_android', 'dep_type': 'cipd', }, 'v8/third_party/catapult': { - 'url': Var('chromium_url') + '/catapult.git' + '@' + '032c78376792ef343ea361bca2181ba6dec6b95f', + 'url': Var('chromium_url') + '/catapult.git' + '@' + 'e9a8d378c950ee44beec5dd5207e151f48e5b5be', 'condition': 'checkout_android', }, 'v8/third_party/colorama/src': { @@ -176,23 +176,23 @@ deps = { 'condition': 'checkout_android', }, 'v8/third_party/fuchsia-sdk': { - 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + '2457e41d8dc379f74662d3157e76339ba92cee06', + 'url': Var('chromium_url') + '/chromium/src/third_party/fuchsia-sdk.git' + '@' + '277fe9120cce5f7a42d43554646fa447f88a1598', 'condition': 'checkout_fuchsia', }, 'v8/third_party/googletest/src': - Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + '10b1902d893ea8cc43c69541d70868f91af3646b', + Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'a09ea700d32bab83325aff9ff34d0582e50e3997', 'v8/third_party/jinja2': - Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + 'b41863e42637544c2941b574c7877d3e1f663e25', + Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + '3f90fa05c85718505e28c9c3426c1ba52843b9b7', 'v8/third_party/markupsafe': Var('chromium_url') + '/chromium/src/third_party/markupsafe.git' + '@' + '8f45f5cfa0009d2a70589bcda0349b8cb2b72783', 'v8/tools/swarming_client': - Var('chromium_url') + '/infra/luci/client-py.git' + '@' + 'cc958279ffd6853e0a1b227a7e957ca334fe56af', + Var('chromium_url') + '/infra/luci/client-py.git' + '@' + '160b445a44e0daacf6f3f8570ca2707ec451f374', 'v8/test/benchmarks/data': Var('chromium_url') + '/v8/deps/third_party/benchmarks.git' + '@' + '05d7188267b4560491ff9155c5ee13e207ecd65f', 'v8/test/mozilla/data': Var('chromium_url') + '/v8/deps/third_party/mozilla-tests.git' + '@' + 'f6c578a10ea707b1a8ab0b88943fe5115ce2b9be', 'v8/test/test262/data': - Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'f6b2ccdd091ff82da54150796297c3a96d7edb41', + Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'd2f7d4285c4a5267f5be37a9c823a397daadad1b', 'v8/test/test262/harness': Var('chromium_url') + '/external/github.com/test262-utils/test262-harness-py.git' + '@' + '4555345a943d0c99a9461182705543fb171dda4b', 'v8/third_party/qemu-linux-x64': { @@ -219,7 +219,7 @@ deps = { 'packages': [ { 'package': 'fuchsia/third_party/aemu/linux-amd64', - 'version': '7YlCgase5GlIanqHn-nZClSlZ5kQETJyVUYRF7Jjy6UC' + 'version': '5LzaFiFYMxwWXcgus5JjF74yr90M5oz9IMo29pTdoLgC' }, ], 'condition': 'host_os == "linux" and checkout_fuchsia', @@ -236,7 +236,7 @@ deps = { 'dep_type': 'cipd', }, 'v8/tools/clang': - Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '105a8460911176861a422738eee4daad8dfe88a2', + Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'de3e20662b84f0ee361a5ae11c99a9513df7c8e8', 'v8/tools/luci-go': { 'packages': [ { @@ -266,11 +266,13 @@ deps = { 'dep_type': 'cipd', }, 'v8/third_party/perfetto': - Var('android_url') + '/platform/external/perfetto.git' + '@' + 'b9b24d1b0b80aafec393af085067e9eae829412f', + Var('android_url') + '/platform/external/perfetto.git' + '@' + 'ff70e0d273ed10995866c803f23e11250eb3dc52', 'v8/third_party/protobuf': Var('chromium_url') + '/external/github.com/google/protobuf'+ '@' + 'b68a347f56137b4b1a746e8c7438495a6ac1bd91', 'v8/third_party/zlib': - Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '156be8c52f80cde343088b4a69a80579101b6e67', + Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '90fc47e6eed7bd1a59ad1603761303ef24705593', + 'v8/third_party/jsoncpp/source': + Var('chromium_url') + '/external/github.com/open-source-parsers/jsoncpp.git'+ '@' + '645250b6690785be60ab6780ce4b58698d884d11', 'v8/third_party/ittapi': { # Force checkout ittapi libraries to pass v8 header includes check on # bots that has check_v8_header_includes enabled. diff --git a/deps/v8/INTL_OWNERS b/deps/v8/INTL_OWNERS index dbe6f3b7b54292..6e9f2cedb98c4d 100644 --- a/deps/v8/INTL_OWNERS +++ b/deps/v8/INTL_OWNERS @@ -1,3 +1,4 @@ cira@chromium.org mnita@google.com jshin@chromium.org +ftang@chromium.org diff --git a/deps/v8/WATCHLISTS b/deps/v8/WATCHLISTS index 47470f49e42308..54d6bbec1c51ff 100644 --- a/deps/v8/WATCHLISTS +++ b/deps/v8/WATCHLISTS @@ -33,10 +33,6 @@ { 'WATCHLIST_DEFINITIONS': { - 'api': { - 'filepath': 'include/' \ - '|src/api\.(cc|h)$', - }, 'snapshot': { 'filepath': 'src/snapshot/', }, @@ -94,9 +90,6 @@ }, 'WATCHLISTS': { - 'api': [ - 'yangguo+watch@chromium.org', - ], 'csa': [ 'jgruber+watch@chromium.org', ], diff --git a/deps/v8/build_overrides/build.gni b/deps/v8/build_overrides/build.gni index 5b99eb94022596..dde92c46eaa78d 100644 --- a/deps/v8/build_overrides/build.gni +++ b/deps/v8/build_overrides/build.gni @@ -16,6 +16,14 @@ perfetto_build_with_embedder = true perfetto_protobuf_target_prefix = "//" perfetto_protobuf_gni = "//gni/proto_library.gni" +# We use Perfetto's Trace Processor to convert traces to the legacy JSON +# format. +enable_perfetto_trace_processor = true + +# When building with chromium, determines whether we want to also use the +# perfetto library from chromium instead declaring our own. +use_perfetto_client_library = false + # Uncomment these to specify a different NDK location and version in # non-Chromium builds. # default_android_ndk_root = "//third_party/android_ndk" diff --git a/deps/v8/gni/v8.gni b/deps/v8/gni/v8.gni index 0b2806ca949b77..9d286ebbfc0226 100644 --- a/deps/v8/gni/v8.gni +++ b/deps/v8/gni/v8.gni @@ -54,8 +54,7 @@ declare_args() { # Expose symbols for dynamic linking. v8_expose_symbols = false - # Use Perfetto (https://perfetto.dev) as the default TracingController. Not - # currently implemented. + # Implement tracing using Perfetto (https://perfetto.dev). v8_use_perfetto = false # Override global symbol level setting for v8 @@ -82,6 +81,12 @@ if (v8_enable_backtrace == "") { v8_enable_backtrace = is_debug && !v8_optimized_debug } +# If chromium is configured to use the perfetto client library, v8 should also +# use perfetto for tracing. +if (build_with_chromium && use_perfetto_client_library) { + v8_use_perfetto = true +} + # Points to // in v8 stand-alone or to //v8/ in chromium. We need absolute # paths for all configs in templates as they are shared in different # subdirectories. diff --git a/deps/v8/include/DEPS b/deps/v8/include/DEPS index ca60f841f530ab..7305ff51125503 100644 --- a/deps/v8/include/DEPS +++ b/deps/v8/include/DEPS @@ -1,4 +1,5 @@ include_rules = [ # v8-inspector-protocol.h depends on generated files under include/inspector. "+inspector", + "+cppgc/common.h", ] diff --git a/deps/v8/include/cppgc/DEPS b/deps/v8/include/cppgc/DEPS new file mode 100644 index 00000000000000..04c343de27c329 --- /dev/null +++ b/deps/v8/include/cppgc/DEPS @@ -0,0 +1,7 @@ +include_rules = [ + "-include", + "+v8config.h", + "+v8-platform.h", + "+cppgc", + "-src", +] diff --git a/deps/v8/include/cppgc/allocation.h b/deps/v8/include/cppgc/allocation.h index 3e717ad7d428f8..49ad49c34d6bc9 100644 --- a/deps/v8/include/cppgc/allocation.h +++ b/deps/v8/include/cppgc/allocation.h @@ -6,12 +6,14 @@ #define INCLUDE_CPPGC_ALLOCATION_H_ #include + #include -#include "include/cppgc/garbage-collected.h" -#include "include/cppgc/gc-info.h" -#include "include/cppgc/heap.h" -#include "include/cppgc/internals.h" +#include "cppgc/custom-space.h" +#include "cppgc/garbage-collected.h" +#include "cppgc/heap.h" +#include "cppgc/internal/api-constants.h" +#include "cppgc/internal/gc-info.h" namespace cppgc { @@ -35,36 +37,80 @@ class V8_EXPORT MakeGarbageCollectedTraitInternal { } static void* Allocate(cppgc::Heap* heap, size_t size, GCInfoIndex index); + static void* Allocate(cppgc::Heap* heapx, size_t size, GCInfoIndex index, + CustomSpaceIndex space_inde); friend class HeapObjectHeader; }; } // namespace internal -// Users with custom allocation needs (e.g. overriding size) should override -// MakeGarbageCollectedTrait (see below) and inherit their trait from -// MakeGarbageCollectedTraitBase to get access to low-level primitives. +/** + * Base trait that provides utilities for advancers users that have custom + * allocation needs (e.g., overriding size). It's expected that users override + * MakeGarbageCollectedTrait (see below) and inherit from + * MakeGarbageCollectedTraitBase and make use of the low-level primitives + * offered to allocate and construct an object. + */ template class MakeGarbageCollectedTraitBase : private internal::MakeGarbageCollectedTraitInternal { + private: + template + struct SpacePolicy { + static void* Allocate(Heap* heap, size_t size) { + // Custom space. + static_assert(std::is_base_of::value, + "Custom space must inherit from CustomSpaceBase."); + return internal::MakeGarbageCollectedTraitInternal::Allocate( + heap, size, internal::GCInfoTrait::Index(), + CustomSpace::kSpaceIndex); + } + }; + + template + struct SpacePolicy { + static void* Allocate(Heap* heap, size_t size) { + // Default space. + return internal::MakeGarbageCollectedTraitInternal::Allocate( + heap, size, internal::GCInfoTrait::Index()); + } + }; + protected: - // Allocates an object of |size| bytes on |heap|. - // - // TODO(mlippautz): Allow specifying arena for specific embedder uses. + /** + * Allocates memory for an object of type T. + * + * \param heap The heap to allocate this object on. + * \param size The size that should be reserved for the object. + * \returns the memory to construct an object of type T on. + */ static void* Allocate(Heap* heap, size_t size) { - return internal::MakeGarbageCollectedTraitInternal::Allocate( - heap, size, internal::GCInfoTrait::Index()); + return SpacePolicy::Space>::Allocate(heap, size); } - // Marks an object as being fully constructed, resulting in precise handling - // by the garbage collector. + /** + * Marks an object as fully constructed, resulting in precise handling by the + * garbage collector. + * + * \param payload The base pointer the object is allocated at. + */ static void MarkObjectAsFullyConstructed(const void* payload) { - // internal::MarkObjectAsFullyConstructed(payload); internal::MakeGarbageCollectedTraitInternal::MarkObjectAsFullyConstructed( payload); } }; +/** + * Default trait class that specifies how to construct an object of type T. + * Advanced users may override how an object is constructed using the utilities + * that are provided through MakeGarbageCollectedTraitBase. + * + * Any trait overriding construction must + * - allocate through MakeGarbageCollectedTraitBase::Allocate; + * - mark the object as fully constructed using + * MakeGarbageCollectedTraitBase::MarkObjectAsFullyConstructed; + */ template class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase { public: @@ -72,6 +118,10 @@ class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase { static T* Call(Heap* heap, Args&&... args) { static_assert(internal::IsGarbageCollectedType::value, "T needs to be a garbage collected object"); + static_assert( + !internal::IsGarbageCollectedMixinType::value || + sizeof(T) <= internal::api_constants::kLargeObjectSizeThreshold, + "GarbageCollectedMixin may not be a large object"); void* memory = MakeGarbageCollectedTraitBase::Allocate(heap, sizeof(T)); T* object = ::new (memory) T(std::forward(args)...); MakeGarbageCollectedTraitBase::MarkObjectAsFullyConstructed(object); @@ -79,11 +129,31 @@ class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase { } }; -// Default MakeGarbageCollected: Constructs an instance of T, which is a garbage -// collected type. +/** + * Allows users to specify a post-construction callback for specific types. The + * callback is invoked on the instance of type T right after it has been + * constructed. This can be useful when the callback requires a + * fully-constructed object to be able to dispatch to virtual methods. + */ +template +struct PostConstructionCallbackTrait { + static void Call(T*) {} +}; + +/** + * Constructs a managed object of type T where T transitively inherits from + * GarbageCollected. + * + * \param args List of arguments with which an instance of T will be + * constructed. + * \returns an instance of type T. + */ template T* MakeGarbageCollected(Heap* heap, Args&&... args) { - return MakeGarbageCollectedTrait::Call(heap, std::forward(args)...); + T* object = + MakeGarbageCollectedTrait::Call(heap, std::forward(args)...); + PostConstructionCallbackTrait::Call(object); + return object; } } // namespace cppgc diff --git a/deps/v8/include/cppgc/common.h b/deps/v8/include/cppgc/common.h new file mode 100644 index 00000000000000..228b9abb74e763 --- /dev/null +++ b/deps/v8/include/cppgc/common.h @@ -0,0 +1,26 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_COMMON_H_ +#define INCLUDE_CPPGC_COMMON_H_ + +// TODO(chromium:1056170): Remove dependency on v8. +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +// Indicator for the stack state of the embedder. +enum class EmbedderStackState { + kMayContainHeapPointers, + kNoHeapPointers, + kUnknown V8_ENUM_DEPRECATE_SOON("Use kMayContainHeapPointers") = + kMayContainHeapPointers, + kNonEmpty V8_ENUM_DEPRECATE_SOON("Use kMayContainHeapPointers") = + kMayContainHeapPointers, + kEmpty V8_ENUM_DEPRECATE_SOON("Use kNoHeapPointers") = kNoHeapPointers, +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_COMMON_H_ diff --git a/deps/v8/include/cppgc/custom-space.h b/deps/v8/include/cppgc/custom-space.h new file mode 100644 index 00000000000000..2597a5bdef7a41 --- /dev/null +++ b/deps/v8/include/cppgc/custom-space.h @@ -0,0 +1,62 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_CUSTOM_SPACE_H_ +#define INCLUDE_CPPGC_CUSTOM_SPACE_H_ + +#include + +namespace cppgc { + +struct CustomSpaceIndex { + CustomSpaceIndex(size_t value) : value(value) {} // NOLINT + size_t value; +}; + +/** + * Top-level base class for custom spaces. Users must inherit from CustomSpace + * below. + */ +class CustomSpaceBase { + public: + virtual ~CustomSpaceBase() = default; + virtual CustomSpaceIndex GetCustomSpaceIndex() const = 0; +}; + +/** + * Base class custom spaces should directly inherit from. The class inheriting + * from CustomSpace must define kSpaceIndex as unique space index. These + * indices need for form a sequence starting at 0. + * + * Example: + * \code + * class CustomSpace1 : public CustomSpace { + * public: + * static constexpr CustomSpaceIndex kSpaceIndex = 0; + * }; + * class CustomSpace2 : public CustomSpace { + * public: + * static constexpr CustomSpaceIndex kSpaceIndex = 1; + * }; + * \endcode + */ +template +class CustomSpace : public CustomSpaceBase { + public: + CustomSpaceIndex GetCustomSpaceIndex() const final { + return ConcreteCustomSpace::kSpaceIndex; + } +}; + +/** + * User-overridable trait that allows pinning types to custom spaces. + */ +template +struct SpaceTrait { + using Space = void; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_CUSTOM_SPACE_H_ diff --git a/deps/v8/include/cppgc/garbage-collected.h b/deps/v8/include/cppgc/garbage-collected.h index 6c62daafdc5d8d..c263a9fecf0d96 100644 --- a/deps/v8/include/cppgc/garbage-collected.h +++ b/deps/v8/include/cppgc/garbage-collected.h @@ -7,31 +7,20 @@ #include -#include "include/cppgc/internals.h" -#include "include/cppgc/platform.h" +#include "cppgc/internal/api-constants.h" +#include "cppgc/macros.h" +#include "cppgc/platform.h" +#include "cppgc/trace-trait.h" +#include "cppgc/type-traits.h" namespace cppgc { -namespace internal { - -template -struct IsGarbageCollectedType : std::false_type { - static_assert(sizeof(T), "T must be fully defined"); -}; -template -struct IsGarbageCollectedType< - T, void_t::IsGarbageCollectedTypeMarker>> - : std::true_type { - static_assert(sizeof(T), "T must be fully defined"); -}; +class Visitor; -} // namespace internal +namespace internal { -template -class GarbageCollected { +class GarbageCollectedBase { public: - using IsGarbageCollectedTypeMarker = void; - // Must use MakeGarbageCollected. void* operator new(size_t) = delete; void* operator new[](size_t) = delete; @@ -44,10 +33,160 @@ class GarbageCollected { } void operator delete[](void*) = delete; + protected: + GarbageCollectedBase() = default; +}; + +} // namespace internal + +/** + * Base class for managed objects. Only descendent types of GarbageCollected + * can be constructed using MakeGarbageCollected. Must be inherited from as + * left-most base class. + * + * Types inheriting from GarbageCollected must provide a method of + * signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed + * pointers to the visitor and delegates to garbage-collected base classes. + * The method must be virtual if the type is not directly a child of + * GarbageCollected and marked as final. + * + * \code + * // Example using final class. + * class FinalType final : public GarbageCollected { + * public: + * void Trace(cppgc::Visitor* visitor) const { + * // Dispatch using visitor->Trace(...); + * } + * }; + * + * // Example using non-final base class. + * class NonFinalBase : public GarbageCollected { + * public: + * virtual void Trace(cppgc::Visitor*) const {} + * }; + * + * class FinalChild final : public NonFinalBase { + * public: + * void Trace(cppgc::Visitor* visitor) const final { + * // Dispatch using visitor->Trace(...); + * NonFinalBase::Trace(visitor); + * } + * }; + * \endcode + */ +template +class GarbageCollected : public internal::GarbageCollectedBase { + public: + using IsGarbageCollectedTypeMarker = void; + protected: GarbageCollected() = default; }; +/** + * Base class for managed mixin objects. Such objects cannot be constructed + * directly but must be mixed into the inheritance hierarchy of a + * GarbageCollected object. + * + * Types inheriting from GarbageCollectedMixin must override a virtual method + * of signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed + * pointers to the visitor and delegates to base classes. + * + * \code + * class Mixin : public GarbageCollectedMixin { + * public: + * void Trace(cppgc::Visitor* visitor) const override { + * // Dispatch using visitor->Trace(...); + * } + * }; + * \endcode + */ +class GarbageCollectedMixin : public internal::GarbageCollectedBase { + public: + using IsGarbageCollectedMixinTypeMarker = void; + + // Sentinel used to mark not-fully-constructed mixins. + static constexpr void* kNotFullyConstructedObject = nullptr; + + // Provide default implementation that indicate that the vtable is not yet + // set up properly. This is used to to get GCInfo objects for mixins so that + // these objects can be processed later on. + virtual TraceDescriptor GetTraceDescriptor() const { + return {kNotFullyConstructedObject, nullptr}; + } + + /** + * This Trace method must be overriden by objects inheriting from + * GarbageCollectedMixin. + */ + virtual void Trace(cppgc::Visitor*) const {} +}; + +/** + * Macro defines all methods and markers needed for handling mixins. Must be + * used on the type that is inheriting from GarbageCollected *and* + * GarbageCollectedMixin. + * + * \code + * class Mixin : public GarbageCollectedMixin { + * public: + * void Trace(cppgc::Visitor* visitor) const override { + * // Dispatch using visitor->Trace(...); + * } + * }; + * + * class Foo : public GarbageCollected, public Mixin { + * USING_GARBAGE_COLLECTED_MIXIN(); + * public: + * void Trace(cppgc::Visitor* visitor) const override { + * // Dispatch using visitor->Trace(...); + * Mixin::Trace(visitor); + * } + * }; + * \endcode + */ +#define USING_GARBAGE_COLLECTED_MIXIN() \ + public: \ + /* Marker is used by clang to check for proper usages of the macro. */ \ + typedef int HasUsingGarbageCollectedMixinMacro; \ + \ + TraceDescriptor GetTraceDescriptor() const override { \ + static_assert( \ + internal::IsSubclassOfTemplate< \ + std::remove_const_t>, \ + cppgc::GarbageCollected>::value, \ + "Only garbage collected objects can have garbage collected mixins"); \ + return {this, TraceTrait>>::Trace}; \ + } \ + \ + private: \ + friend class internal::__thisIsHereToForceASemicolonAfterThisMacro + +/** + * Merge two or more Mixins into one. + * + * \code + * class A : public GarbageCollectedMixin {}; + * class B : public GarbageCollectedMixin {}; + * class C : public A, public B { + * MERGE_GARBAGE_COLLECTED_MIXINS(); + * public: + * }; + * \endcode + */ +#define MERGE_GARBAGE_COLLECTED_MIXINS() \ + public: \ + /* When using multiple mixins the methods become */ \ + /* ambigous. Providing additional implementations */ \ + /* disambiguate them again. */ \ + TraceDescriptor GetTraceDescriptor() const override { \ + return {kNotFullyConstructedObject, nullptr}; \ + } \ + \ + private: \ + friend class internal::__thisIsHereToForceASemicolonAfterThisMacro + } // namespace cppgc #endif // INCLUDE_CPPGC_GARBAGE_COLLECTED_H_ diff --git a/deps/v8/include/cppgc/heap.h b/deps/v8/include/cppgc/heap.h index a0568d534fbee2..90046c35055e2e 100644 --- a/deps/v8/include/cppgc/heap.h +++ b/deps/v8/include/cppgc/heap.h @@ -6,8 +6,11 @@ #define INCLUDE_CPPGC_HEAP_H_ #include +#include -#include "include/v8config.h" +#include "cppgc/common.h" +#include "cppgc/custom-space.h" +#include "v8config.h" // NOLINT(build/include_directory) namespace cppgc { namespace internal { @@ -16,10 +19,39 @@ class Heap; class V8_EXPORT Heap { public: - static std::unique_ptr Create(); + /** + * Specifies the stack state the embedder is in. + */ + using StackState = EmbedderStackState; + + struct HeapOptions { + static HeapOptions Default() { return {}; } + + /** + * Custom spaces added to heap are required to have indices forming a + * numbered sequence starting at 0, i.e., their kSpaceIndex must correspond + * to the index they reside in the vector. + */ + std::vector> custom_spaces; + }; + + static std::unique_ptr Create(HeapOptions = HeapOptions::Default()); virtual ~Heap() = default; + /** + * Forces garbage collection. + * + * \param source String specifying the source (or caller) triggering a + * forced garbage collection. + * \param reason String specifying the reason for the forced garbage + * collection. + * \param stack_state The embedder stack state, see StackState. + */ + void ForceGarbageCollectionSlow( + const char* source, const char* reason, + StackState stack_state = StackState::kMayContainHeapPointers); + private: Heap() = default; diff --git a/deps/v8/include/cppgc/internal/accessors.h b/deps/v8/include/cppgc/internal/accessors.h new file mode 100644 index 00000000000000..ee0a0042fe07b7 --- /dev/null +++ b/deps/v8/include/cppgc/internal/accessors.h @@ -0,0 +1,26 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_ACCESSORS_H_ +#define INCLUDE_CPPGC_INTERNAL_ACCESSORS_H_ + +#include "cppgc/internal/api-constants.h" + +namespace cppgc { + +class Heap; + +namespace internal { + +inline cppgc::Heap* GetHeapFromPayload(const void* payload) { + return *reinterpret_cast( + ((reinterpret_cast(payload) & api_constants::kPageBaseMask) + + api_constants::kGuardPageSize) + + api_constants::kHeapOffset); +} + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_ACCESSORS_H_ diff --git a/deps/v8/include/cppgc/internals.h b/deps/v8/include/cppgc/internal/api-constants.h similarity index 57% rename from deps/v8/include/cppgc/internals.h rename to deps/v8/include/cppgc/internal/api-constants.h index 1e57779758b6c7..ef910a48571f46 100644 --- a/deps/v8/include/cppgc/internals.h +++ b/deps/v8/include/cppgc/internal/api-constants.h @@ -2,25 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef INCLUDE_CPPGC_INTERNALS_H_ -#define INCLUDE_CPPGC_INTERNALS_H_ +#ifndef INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_ +#define INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_ #include #include -#include "include/v8config.h" +#include "v8config.h" // NOLINT(build/include_directory) namespace cppgc { namespace internal { -// Pre-C++17 custom implementation of std::void_t. -template -struct make_void { - typedef void type; -}; -template -using void_t = typename make_void::type; - // Embedders should not rely on this code! // Internal constants to avoid exposing internal types on the API surface. @@ -33,9 +25,20 @@ static constexpr size_t kFullyConstructedBitFieldOffsetFromPayload = // Mask for in-construction bit. static constexpr size_t kFullyConstructedBitMask = size_t{1}; +// Page constants used to align pointers to page begin. +static constexpr size_t kPageSize = size_t{1} << 17; +static constexpr size_t kPageAlignment = kPageSize; +static constexpr size_t kPageBaseMask = ~(kPageAlignment - 1); +static constexpr size_t kGuardPageSize = 4096; + +// Offset of the Heap backref. +static constexpr size_t kHeapOffset = 0; + +static constexpr size_t kLargeObjectSizeThreshold = kPageSize / 2; + } // namespace api_constants } // namespace internal } // namespace cppgc -#endif // INCLUDE_CPPGC_INTERNALS_H_ +#endif // INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_ diff --git a/deps/v8/include/cppgc/internal/compiler-specific.h b/deps/v8/include/cppgc/internal/compiler-specific.h new file mode 100644 index 00000000000000..e1f5c1d57fb850 --- /dev/null +++ b/deps/v8/include/cppgc/internal/compiler-specific.h @@ -0,0 +1,26 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_ +#define INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_ + +namespace cppgc { + +#if defined(__has_cpp_attribute) +#define CPPGC_HAS_CPP_ATTRIBUTE(FEATURE) __has_cpp_attribute(FEATURE) +#else +#define CPPGC_HAS_CPP_ATTRIBUTE(FEATURE) 0 +#endif + +// [[no_unique_address]] comes in C++20 but supported in clang with -std >= +// c++11. +#if CPPGC_HAS_CPP_ATTRIBUTE(no_unique_address) // NOLINTNEXTLINE +#define CPPGC_NO_UNIQUE_ADDRESS [[no_unique_address]] +#else +#define CPPGC_NO_UNIQUE_ADDRESS +#endif + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_ diff --git a/deps/v8/include/cppgc/finalizer-trait.h b/deps/v8/include/cppgc/internal/finalizer-trait.h similarity index 92% rename from deps/v8/include/cppgc/finalizer-trait.h rename to deps/v8/include/cppgc/internal/finalizer-trait.h index 12216ed84ed9f6..a95126591cb72d 100644 --- a/deps/v8/include/cppgc/finalizer-trait.h +++ b/deps/v8/include/cppgc/internal/finalizer-trait.h @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef INCLUDE_CPPGC_FINALIZER_TRAIT_H_ -#define INCLUDE_CPPGC_FINALIZER_TRAIT_H_ +#ifndef INCLUDE_CPPGC_INTERNAL_FINALIZER_TRAIT_H_ +#define INCLUDE_CPPGC_INTERNAL_FINALIZER_TRAIT_H_ #include -#include "include/cppgc/internals.h" +#include "cppgc/type-traits.h" namespace cppgc { namespace internal { @@ -87,4 +87,4 @@ constexpr FinalizationCallback FinalizerTrait::kCallback; } // namespace internal } // namespace cppgc -#endif // INCLUDE_CPPGC_FINALIZER_TRAIT_H_ +#endif // INCLUDE_CPPGC_INTERNAL_FINALIZER_TRAIT_H_ diff --git a/deps/v8/include/cppgc/gc-info.h b/deps/v8/include/cppgc/internal/gc-info.h similarity index 81% rename from deps/v8/include/cppgc/gc-info.h rename to deps/v8/include/cppgc/internal/gc-info.h index 987ba34fa4254c..9aac1361c61afd 100644 --- a/deps/v8/include/cppgc/gc-info.h +++ b/deps/v8/include/cppgc/internal/gc-info.h @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef INCLUDE_CPPGC_GC_INFO_H_ -#define INCLUDE_CPPGC_GC_INFO_H_ +#ifndef INCLUDE_CPPGC_INTERNAL_GC_INFO_H_ +#define INCLUDE_CPPGC_INTERNAL_GC_INFO_H_ #include -#include "include/cppgc/finalizer-trait.h" -#include "include/v8config.h" +#include "cppgc/internal/finalizer-trait.h" +#include "v8config.h" // NOLINT(build/include_directory) namespace cppgc { namespace internal { @@ -40,4 +40,4 @@ struct GCInfoTrait { } // namespace internal } // namespace cppgc -#endif // INCLUDE_CPPGC_GC_INFO_H_ +#endif // INCLUDE_CPPGC_INTERNAL_GC_INFO_H_ diff --git a/deps/v8/include/cppgc/internal/logging.h b/deps/v8/include/cppgc/internal/logging.h new file mode 100644 index 00000000000000..79beaef7d4f80d --- /dev/null +++ b/deps/v8/include/cppgc/internal/logging.h @@ -0,0 +1,50 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_LOGGING_H_ +#define INCLUDE_CPPGC_INTERNAL_LOGGING_H_ + +#include "cppgc/source-location.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { + +void V8_EXPORT DCheckImpl(const char*, + const SourceLocation& = SourceLocation::Current()); +[[noreturn]] void V8_EXPORT +FatalImpl(const char*, const SourceLocation& = SourceLocation::Current()); + +// Used to ignore -Wunused-variable. +template +struct EatParams {}; + +#if DEBUG +#define CPPGC_DCHECK_MSG(condition, message) \ + do { \ + if (V8_UNLIKELY(!(condition))) { \ + ::cppgc::internal::DCheckImpl(message); \ + } \ + } while (false) +#else +#define CPPGC_DCHECK_MSG(condition, message) \ + (static_cast(::cppgc::internal::EatParams(condition), message)>{})) +#endif + +#define CPPGC_DCHECK(condition) CPPGC_DCHECK_MSG(condition, #condition) + +#define CPPGC_CHECK_MSG(condition, message) \ + do { \ + if (V8_UNLIKELY(!(condition))) { \ + ::cppgc::internal::FatalImpl(message); \ + } \ + } while (false) + +#define CPPGC_CHECK(condition) CPPGC_CHECK_MSG(condition, #condition) + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_LOGGING_H_ diff --git a/deps/v8/include/cppgc/internal/persistent-node.h b/deps/v8/include/cppgc/internal/persistent-node.h new file mode 100644 index 00000000000000..11cf69623e8dad --- /dev/null +++ b/deps/v8/include/cppgc/internal/persistent-node.h @@ -0,0 +1,109 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_ +#define INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_ + +#include +#include +#include + +#include "cppgc/internal/logging.h" +#include "cppgc/trace-trait.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class Visitor; + +namespace internal { + +// PersistentNode represesents a variant of two states: +// 1) traceable node with a back pointer to the Persistent object; +// 2) freelist entry. +class PersistentNode final { + public: + PersistentNode() = default; + + PersistentNode(const PersistentNode&) = delete; + PersistentNode& operator=(const PersistentNode&) = delete; + + void InitializeAsUsedNode(void* owner, TraceCallback trace) { + owner_ = owner; + trace_ = trace; + } + + void InitializeAsFreeNode(PersistentNode* next) { + next_ = next; + trace_ = nullptr; + } + + void UpdateOwner(void* owner) { + CPPGC_DCHECK(IsUsed()); + owner_ = owner; + } + + PersistentNode* FreeListNext() const { + CPPGC_DCHECK(!IsUsed()); + return next_; + } + + void Trace(Visitor* visitor) const { + CPPGC_DCHECK(IsUsed()); + trace_(visitor, owner_); + } + + bool IsUsed() const { return trace_; } + + private: + // PersistentNode acts as a designated union: + // If trace_ != nullptr, owner_ points to the corresponding Persistent handle. + // Otherwise, next_ points to the next freed PersistentNode. + union { + void* owner_ = nullptr; + PersistentNode* next_; + }; + TraceCallback trace_ = nullptr; +}; + +class V8_EXPORT PersistentRegion { + using PersistentNodeSlots = std::array; + + public: + PersistentRegion() = default; + + PersistentRegion(const PersistentRegion&) = delete; + PersistentRegion& operator=(const PersistentRegion&) = delete; + + PersistentNode* AllocateNode(void* owner, TraceCallback trace) { + if (!free_list_head_) { + EnsureNodeSlots(); + } + PersistentNode* node = free_list_head_; + free_list_head_ = free_list_head_->FreeListNext(); + node->InitializeAsUsedNode(owner, trace); + return node; + } + + void FreeNode(PersistentNode* node) { + node->InitializeAsFreeNode(free_list_head_); + free_list_head_ = node; + } + + void Trace(Visitor*); + + size_t NodesInUse() const; + + private: + void EnsureNodeSlots(); + + std::vector> nodes_; + PersistentNode* free_list_head_ = nullptr; +}; + +} // namespace internal + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_ diff --git a/deps/v8/include/cppgc/internal/pointer-policies.h b/deps/v8/include/cppgc/internal/pointer-policies.h new file mode 100644 index 00000000000000..fe8d94b57a68bb --- /dev/null +++ b/deps/v8/include/cppgc/internal/pointer-policies.h @@ -0,0 +1,133 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_ +#define INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_ + +#include +#include + +#include "cppgc/source-location.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { + +class PersistentRegion; + +// Tags to distinguish between strong and weak member types. +class StrongMemberTag; +class WeakMemberTag; +class UntracedMemberTag; + +struct DijkstraWriteBarrierPolicy { + static void InitializingBarrier(const void*, const void*) { + // Since in initializing writes the source object is always white, having no + // barrier doesn't break the tri-color invariant. + } + static void AssigningBarrier(const void*, const void*) { + // TODO(chromium:1056170): Add actual implementation. + } +}; + +struct NoWriteBarrierPolicy { + static void InitializingBarrier(const void*, const void*) {} + static void AssigningBarrier(const void*, const void*) {} +}; + +class V8_EXPORT EnabledCheckingPolicy { + protected: + EnabledCheckingPolicy(); + void CheckPointer(const void* ptr); + + private: + void* impl_; +}; + +class DisabledCheckingPolicy { + protected: + void CheckPointer(const void* raw) {} +}; + +#if V8_ENABLE_CHECKS +using DefaultCheckingPolicy = EnabledCheckingPolicy; +#else +using DefaultCheckingPolicy = DisabledCheckingPolicy; +#endif + +class KeepLocationPolicy { + public: + constexpr const SourceLocation& Location() const { return location_; } + + protected: + constexpr explicit KeepLocationPolicy(const SourceLocation& location) + : location_(location) {} + + // KeepLocationPolicy must not copy underlying source locations. + KeepLocationPolicy(const KeepLocationPolicy&) = delete; + KeepLocationPolicy& operator=(const KeepLocationPolicy&) = delete; + + // Location of the original moved from object should be preserved. + KeepLocationPolicy(KeepLocationPolicy&&) = default; + KeepLocationPolicy& operator=(KeepLocationPolicy&&) = default; + + private: + SourceLocation location_; +}; + +class IgnoreLocationPolicy { + public: + constexpr SourceLocation Location() const { return {}; } + + protected: + constexpr explicit IgnoreLocationPolicy(const SourceLocation&) {} +}; + +#if CPPGC_SUPPORTS_OBJECT_NAMES +using DefaultLocationPolicy = KeepLocationPolicy; +#else +using DefaultLocationPolicy = IgnoreLocationPolicy; +#endif + +struct StrongPersistentPolicy { + using IsStrongPersistent = std::true_type; + + static V8_EXPORT PersistentRegion& GetPersistentRegion(void* object); +}; + +struct WeakPersistentPolicy { + using IsStrongPersistent = std::false_type; + + static V8_EXPORT PersistentRegion& GetPersistentRegion(void* object); +}; + +// Persistent/Member forward declarations. +template +class BasicPersistent; +template +class BasicMember; + +// Special tag type used to denote some sentinel member. The semantics of the +// sentinel is defined by the embedder. +struct SentinelPointer { + template + operator T*() const { // NOLINT + static constexpr intptr_t kSentinelValue = -1; + return reinterpret_cast(kSentinelValue); + } + // Hidden friends. + friend bool operator==(SentinelPointer, SentinelPointer) { return true; } + friend bool operator!=(SentinelPointer, SentinelPointer) { return false; } +}; + +} // namespace internal + +constexpr internal::SentinelPointer kSentinelPointer; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_ diff --git a/deps/v8/include/cppgc/internal/prefinalizer-handler.h b/deps/v8/include/cppgc/internal/prefinalizer-handler.h new file mode 100644 index 00000000000000..939a9b8ff0a8fd --- /dev/null +++ b/deps/v8/include/cppgc/internal/prefinalizer-handler.h @@ -0,0 +1,31 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_ +#define INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_ + +#include "cppgc/heap.h" +#include "cppgc/liveness-broker.h" + +namespace cppgc { +namespace internal { + +class V8_EXPORT PreFinalizerRegistrationDispatcher final { + public: + using PreFinalizerCallback = bool (*)(const LivenessBroker&, void*); + struct PreFinalizer { + void* object_; + PreFinalizerCallback callback_; + + bool operator==(const PreFinalizer& other); + }; + + static void RegisterPrefinalizer(cppgc::Heap* heap, + PreFinalizer prefinalzier); +}; + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_ diff --git a/deps/v8/include/cppgc/liveness-broker.h b/deps/v8/include/cppgc/liveness-broker.h new file mode 100644 index 00000000000000..69dbc11f1f4a95 --- /dev/null +++ b/deps/v8/include/cppgc/liveness-broker.h @@ -0,0 +1,50 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_LIVENESS_BROKER_H_ +#define INCLUDE_CPPGC_LIVENESS_BROKER_H_ + +#include "cppgc/heap.h" +#include "cppgc/member.h" +#include "cppgc/trace-trait.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +namespace internal { +class LivenessBrokerFactory; +} // namespace internal + +class V8_EXPORT LivenessBroker final { + public: + template + bool IsHeapObjectAlive(const T* object) const { + return object && + IsHeapObjectAliveImpl( + TraceTrait::GetTraceDescriptor(object).base_object_payload); + } + + template + bool IsHeapObjectAlive(const WeakMember& weak_member) const { + return (weak_member != kSentinelPointer) && + IsHeapObjectAlive(weak_member.Get()); + } + + template + bool IsHeapObjectAlive(const UntracedMember& untraced_member) const { + return (untraced_member != kSentinelPointer) && + IsHeapObjectAlive(untraced_member.Get()); + } + + private: + LivenessBroker() = default; + + bool IsHeapObjectAliveImpl(const void*) const; + + friend class internal::LivenessBrokerFactory; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_LIVENESS_BROKER_H_ diff --git a/deps/v8/include/cppgc/macros.h b/deps/v8/include/cppgc/macros.h new file mode 100644 index 00000000000000..7c7a10e433a894 --- /dev/null +++ b/deps/v8/include/cppgc/macros.h @@ -0,0 +1,26 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_MACROS_H_ +#define INCLUDE_CPPGC_MACROS_H_ + +namespace cppgc { + +namespace internal { +class __thisIsHereToForceASemicolonAfterThisMacro {}; +} // namespace internal + +// Use if the object is only stack allocated. +#define CPPGC_STACK_ALLOCATED() \ + public: \ + using IsStackAllocatedTypeMarker = int; \ + \ + private: \ + void* operator new(size_t) = delete; \ + void* operator new(size_t, void*) = delete; \ + friend class internal::__thisIsHereToForceASemicolonAfterThisMacro + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_MACROS_H_ diff --git a/deps/v8/include/cppgc/member.h b/deps/v8/include/cppgc/member.h new file mode 100644 index 00000000000000..a183edb96fd030 --- /dev/null +++ b/deps/v8/include/cppgc/member.h @@ -0,0 +1,206 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_MEMBER_H_ +#define INCLUDE_CPPGC_MEMBER_H_ + +#include +#include +#include + +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/type-traits.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class Visitor; + +namespace internal { + +// The basic class from which all Member classes are 'generated'. +template +class BasicMember : private CheckingPolicy { + public: + using PointeeType = T; + + constexpr BasicMember() = default; + constexpr BasicMember(std::nullptr_t) {} // NOLINT + BasicMember(SentinelPointer s) : raw_(s) {} // NOLINT + BasicMember(T* raw) : raw_(raw) { // NOLINT + InitializingWriteBarrier(); + this->CheckPointer(raw_); + } + BasicMember(T& raw) : BasicMember(&raw) {} // NOLINT + BasicMember(const BasicMember& other) : BasicMember(other.Get()) {} + // Allow heterogeneous construction. + template ::value>> + BasicMember( // NOLINT + const BasicMember& other) + : BasicMember(other.Get()) {} + // Construction from Persistent. + template ::value>> + BasicMember( // NOLINT + const BasicPersistent& + p) + : BasicMember(p.Get()) {} + + BasicMember& operator=(const BasicMember& other) { + return operator=(other.Get()); + } + // Allow heterogeneous assignment. + template ::value>> + BasicMember& operator=( + const BasicMember& other) { + return operator=(other.Get()); + } + // Assignment from Persistent. + template ::value>> + BasicMember& operator=( + const BasicPersistent& + other) { + return operator=(other.Get()); + } + BasicMember& operator=(T* other) { + SetRawAtomic(other); + AssigningWriteBarrier(); + this->CheckPointer(Get()); + return *this; + } + BasicMember& operator=(std::nullptr_t) { + Clear(); + return *this; + } + BasicMember& operator=(SentinelPointer s) { + SetRawAtomic(s); + return *this; + } + + template + void Swap(BasicMember& other) { + T* tmp = Get(); + *this = other; + other = tmp; + } + + explicit operator bool() const { return Get(); } + operator T*() const { return Get(); } // NOLINT + T* operator->() const { return Get(); } + T& operator*() const { return *Get(); } + + T* Get() const { + // Executed by the mutator, hence non atomic load. + return raw_; + } + + void Clear() { SetRawAtomic(nullptr); } + + T* Release() { + T* result = Get(); + Clear(); + return result; + } + + private: + void SetRawAtomic(T* raw) { + reinterpret_cast*>(&raw_)->store(raw, + std::memory_order_relaxed); + } + T* GetRawAtomic() const { + return reinterpret_cast*>(&raw_)->load( + std::memory_order_relaxed); + } + + void InitializingWriteBarrier() const { + WriteBarrierPolicy::InitializingBarrier( + reinterpret_cast(&raw_), static_cast(raw_)); + } + void AssigningWriteBarrier() const { + WriteBarrierPolicy::AssigningBarrier(reinterpret_cast(&raw_), + static_cast(raw_)); + } + + T* raw_ = nullptr; + + friend class cppgc::Visitor; +}; + +template +bool operator==( + BasicMember member1, + BasicMember + member2) { + return member1.Get() == member2.Get(); +} + +template +bool operator!=( + BasicMember member1, + BasicMember + member2) { + return !(member1 == member2); +} + +template +struct IsWeak< + internal::BasicMember> + : std::true_type {}; + +} // namespace internal + +/** + * Members are used in classes to contain strong pointers to other garbage + * collected objects. All Member fields of a class must be traced in the class' + * trace method. + */ +template +using Member = internal::BasicMember; + +/** + * WeakMember is similar to Member in that it is used to point to other garbage + * collected objects. However instead of creating a strong pointer to the + * object, the WeakMember creates a weak pointer, which does not keep the + * pointee alive. Hence if all pointers to to a heap allocated object are weak + * the object will be garbage collected. At the time of GC the weak pointers + * will automatically be set to null. + */ +template +using WeakMember = internal::BasicMember; + +/** + * UntracedMember is a pointer to an on-heap object that is not traced for some + * reason. Do not use this unless you know what you are doing. Keeping raw + * pointers to on-heap objects is prohibited unless used from stack. Pointee + * must be kept alive through other means. + */ +template +using UntracedMember = internal::BasicMember; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_MEMBER_H_ diff --git a/deps/v8/include/cppgc/persistent.h b/deps/v8/include/cppgc/persistent.h new file mode 100644 index 00000000000000..fc6b0b9d92efa1 --- /dev/null +++ b/deps/v8/include/cppgc/persistent.h @@ -0,0 +1,304 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_PERSISTENT_H_ +#define INCLUDE_CPPGC_PERSISTENT_H_ + +#include + +#include "cppgc/internal/persistent-node.h" +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/source-location.h" +#include "cppgc/type-traits.h" +#include "cppgc/visitor.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { + +// The basic class from which all Persistent classes are generated. +template +class BasicPersistent : public LocationPolicy, + private WeaknessPolicy, + private CheckingPolicy { + public: + using typename WeaknessPolicy::IsStrongPersistent; + using PointeeType = T; + + // Null-state/sentinel constructors. + BasicPersistent( // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc) {} + + BasicPersistent(std::nullptr_t, // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc) {} + + BasicPersistent( // NOLINT + SentinelPointer s, const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc), raw_(s) {} + + // Raw value contstructors. + BasicPersistent(T* raw, // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc), raw_(raw) { + if (!IsValid()) return; + node_ = WeaknessPolicy::GetPersistentRegion(raw_).AllocateNode( + this, &BasicPersistent::Trace); + this->CheckPointer(Get()); + } + + BasicPersistent(T& raw, // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(&raw, loc) {} + + // Copy ctor. + BasicPersistent(const BasicPersistent& other, + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(other.Get(), loc) {} + + // Heterogeneous ctor. + template ::value>> + BasicPersistent( // NOLINT + const BasicPersistent& other, + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(other.Get(), loc) {} + + // Move ctor. The heterogeneous move ctor is not supported since e.g. + // persistent can't reuse persistent node from weak persistent. + BasicPersistent( + BasicPersistent&& other, + const SourceLocation& loc = SourceLocation::Current()) noexcept + : LocationPolicy(std::move(other)), + raw_(std::move(other.raw_)), + node_(std::move(other.node_)) { + if (!IsValid()) return; + node_->UpdateOwner(this); + other.raw_ = nullptr; + other.node_ = nullptr; + this->CheckPointer(Get()); + } + + // Constructor from member. + template ::value>> + BasicPersistent(internal::BasicMember + member, + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(member.Get(), loc) {} + + ~BasicPersistent() { Clear(); } + + // Copy assignment. + BasicPersistent& operator=(const BasicPersistent& other) { + return operator=(other.Get()); + } + + template ::value>> + BasicPersistent& operator=( + const BasicPersistent& other) { + return operator=(other.Get()); + } + + // Move assignment. + BasicPersistent& operator=(BasicPersistent&& other) { + if (this == &other) return *this; + Clear(); + LocationPolicy::operator=(std::move(other)); + raw_ = std::move(other.raw_); + node_ = std::move(other.node_); + if (!IsValid()) return *this; + node_->UpdateOwner(this); + other.raw_ = nullptr; + other.node_ = nullptr; + this->CheckPointer(Get()); + return *this; + } + + // Assignment from member. + template ::value>> + BasicPersistent& operator=( + internal::BasicMember + member) { + return operator=(member.Get()); + } + + BasicPersistent& operator=(T* other) { + Assign(other); + return *this; + } + + BasicPersistent& operator=(std::nullptr_t) { + Clear(); + return *this; + } + + BasicPersistent& operator=(SentinelPointer s) { + Assign(s); + return *this; + } + + explicit operator bool() const { return Get(); } + operator T*() const { return Get(); } + T* operator->() const { return Get(); } + T& operator*() const { return *Get(); } + + T* Get() const { return raw_; } + + void Clear() { Assign(nullptr); } + + T* Release() { + T* result = Get(); + Clear(); + return result; + } + + private: + static void Trace(Visitor* v, const void* ptr) { + const auto* persistent = static_cast(ptr); + v->TraceRoot(*persistent, persistent->Location()); + } + + bool IsValid() const { + // Ideally, handling kSentinelPointer would be done by the embedder. On the + // other hand, having Persistent aware of it is beneficial since no node + // gets wasted. + return raw_ != nullptr && raw_ != kSentinelPointer; + } + + void Assign(T* ptr) { + if (IsValid()) { + if (ptr && ptr != kSentinelPointer) { + // Simply assign the pointer reusing the existing node. + raw_ = ptr; + this->CheckPointer(ptr); + return; + } + WeaknessPolicy::GetPersistentRegion(raw_).FreeNode(node_); + node_ = nullptr; + } + raw_ = ptr; + if (!IsValid()) return; + node_ = WeaknessPolicy::GetPersistentRegion(raw_).AllocateNode( + this, &BasicPersistent::Trace); + this->CheckPointer(Get()); + } + + T* raw_ = nullptr; + PersistentNode* node_ = nullptr; +}; + +template +bool operator==(const BasicPersistent& p1, + const BasicPersistent& p2) { + return p1.Get() == p2.Get(); +} + +template +bool operator!=(const BasicPersistent& p1, + const BasicPersistent& p2) { + return !(p1 == p2); +} + +template +bool operator==(const BasicPersistent& p, + BasicMember + m) { + return p.Get() == m.Get(); +} + +template +bool operator!=(const BasicPersistent& p, + BasicMember + m) { + return !(p == m); +} + +template +bool operator==(BasicMember + m, + const BasicPersistent& p) { + return m.Get() == p.Get(); +} + +template +bool operator!=(BasicMember + m, + const BasicPersistent& p) { + return !(m == p); +} + +template +struct IsWeak> : std::true_type {}; +} // namespace internal + +/** + * Persistent is a way to create a strong pointer from an off-heap object to + * another on-heap object. As long as the Persistent handle is alive the GC will + * keep the object pointed to alive. The Persistent handle is always a GC root + * from the point of view of the GC. Persistent must be constructed and + * destructed in the same thread. + */ +template +using Persistent = + internal::BasicPersistent; + +/** + * WeakPersistent is a way to create a weak pointer from an off-heap object to + * an on-heap object. The pointer is automatically cleared when the pointee gets + * collected. WeakPersistent must be constructed and destructed in the same + * thread. + */ +template +using WeakPersistent = + internal::BasicPersistent; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_PERSISTENT_H_ diff --git a/deps/v8/include/cppgc/platform.h b/deps/v8/include/cppgc/platform.h index f216c2730a4dea..8dc5e14a7d6f07 100644 --- a/deps/v8/include/cppgc/platform.h +++ b/deps/v8/include/cppgc/platform.h @@ -5,8 +5,8 @@ #ifndef INCLUDE_CPPGC_PLATFORM_H_ #define INCLUDE_CPPGC_PLATFORM_H_ -#include "include/v8-platform.h" -#include "include/v8config.h" +#include "v8-platform.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) namespace cppgc { diff --git a/deps/v8/include/cppgc/prefinalizer.h b/deps/v8/include/cppgc/prefinalizer.h new file mode 100644 index 00000000000000..2f6d68a1dac808 --- /dev/null +++ b/deps/v8/include/cppgc/prefinalizer.h @@ -0,0 +1,54 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_PREFINALIZER_H_ +#define INCLUDE_CPPGC_PREFINALIZER_H_ + +#include "cppgc/internal/accessors.h" +#include "cppgc/internal/compiler-specific.h" +#include "cppgc/internal/prefinalizer-handler.h" +#include "cppgc/liveness-broker.h" +#include "cppgc/macros.h" + +namespace cppgc { + +namespace internal { + +template +class PrefinalizerRegistration final { + public: + explicit PrefinalizerRegistration(T* self) { + static_assert(sizeof(&T::InvokePreFinalizer) > 0, + "USING_PRE_FINALIZER(T) must be defined."); + + cppgc::internal::PreFinalizerRegistrationDispatcher::RegisterPrefinalizer( + internal::GetHeapFromPayload(self), {self, T::InvokePreFinalizer}); + } + + void* operator new(size_t, void* location) = delete; + void* operator new(size_t) = delete; +}; + +} // namespace internal + +#define CPPGC_USING_PRE_FINALIZER(Class, PreFinalizer) \ + public: \ + static bool InvokePreFinalizer(const LivenessBroker& liveness_broker, \ + void* object) { \ + static_assert(internal::IsGarbageCollectedTypeV, \ + "Only garbage collected objects can have prefinalizers"); \ + Class* self = static_cast(object); \ + if (liveness_broker.IsHeapObjectAlive(self)) return false; \ + self->Class::PreFinalizer(); \ + return true; \ + } \ + \ + private: \ + CPPGC_NO_UNIQUE_ADDRESS internal::PrefinalizerRegistration \ + prefinalizer_dummy_{this}; \ + friend class internal::__thisIsHereToForceASemicolonAfterThisMacro + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_PREFINALIZER_H_ diff --git a/deps/v8/include/cppgc/source-location.h b/deps/v8/include/cppgc/source-location.h new file mode 100644 index 00000000000000..8cc52d6a539c2f --- /dev/null +++ b/deps/v8/include/cppgc/source-location.h @@ -0,0 +1,59 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_SOURCE_LOCATION_H_ +#define INCLUDE_CPPGC_SOURCE_LOCATION_H_ + +#include + +#include "v8config.h" // NOLINT(build/include_directory) + +#if defined(__has_builtin) +#define CPPGC_SUPPORTS_SOURCE_LOCATION \ + (__has_builtin(__builtin_FUNCTION) && __has_builtin(__builtin_FILE) && \ + __has_builtin(__builtin_LINE)) // NOLINT +#elif defined(V8_CC_GNU) && __GNUC__ >= 7 +#define CPPGC_SUPPORTS_SOURCE_LOCATION 1 +#elif defined(V8_CC_INTEL) && __ICC >= 1800 +#define CPPGC_SUPPORTS_SOURCE_LOCATION 1 +#else +#define CPPGC_SUPPORTS_SOURCE_LOCATION 0 +#endif + +namespace cppgc { + +// Encapsulates source location information. Mimics C++20's +// std::source_location. +class V8_EXPORT SourceLocation final { + public: +#if CPPGC_SUPPORTS_SOURCE_LOCATION + static constexpr SourceLocation Current( + const char* function = __builtin_FUNCTION(), + const char* file = __builtin_FILE(), size_t line = __builtin_LINE()) { + return SourceLocation(function, file, line); + } +#else + static constexpr SourceLocation Current() { return SourceLocation(); } +#endif // CPPGC_SUPPORTS_SOURCE_LOCATION + + constexpr SourceLocation() = default; + + constexpr const char* Function() const { return function_; } + constexpr const char* FileName() const { return file_; } + constexpr size_t Line() const { return line_; } + + std::string ToString() const; + + private: + constexpr SourceLocation(const char* function, const char* file, size_t line) + : function_(function), file_(file), line_(line) {} + + const char* function_ = nullptr; + const char* file_ = nullptr; + size_t line_ = 0u; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_SOURCE_LOCATION_H_ diff --git a/deps/v8/include/cppgc/trace-trait.h b/deps/v8/include/cppgc/trace-trait.h new file mode 100644 index 00000000000000..e246bc53b7d9aa --- /dev/null +++ b/deps/v8/include/cppgc/trace-trait.h @@ -0,0 +1,67 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_TRACE_TRAIT_H_ +#define INCLUDE_CPPGC_TRACE_TRAIT_H_ + +#include +#include "cppgc/type-traits.h" + +namespace cppgc { + +class Visitor; + +namespace internal { + +template ::type>> +struct TraceTraitImpl; + +} // namespace internal + +using TraceCallback = void (*)(Visitor*, const void*); + +// TraceDescriptor is used to describe how to trace an object. +struct TraceDescriptor { + // The adjusted base pointer of the object that should be traced. + const void* base_object_payload; + // A callback for tracing the object. + TraceCallback callback; +}; + +template +struct TraceTrait { + static_assert(internal::IsTraceableV, "T must have a Trace() method"); + + static TraceDescriptor GetTraceDescriptor(const void* self) { + return internal::TraceTraitImpl::GetTraceDescriptor( + static_cast(self)); + } + + static void Trace(Visitor* visitor, const void* self) { + static_cast(self)->Trace(visitor); + } +}; + +namespace internal { + +template +struct TraceTraitImpl { + static TraceDescriptor GetTraceDescriptor(const void* self) { + return {self, TraceTrait::Trace}; + } +}; + +template +struct TraceTraitImpl { + static TraceDescriptor GetTraceDescriptor(const void* self) { + return static_cast(self)->GetTraceDescriptor(); + } +}; + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_TRACE_TRAIT_H_ diff --git a/deps/v8/include/cppgc/type-traits.h b/deps/v8/include/cppgc/type-traits.h new file mode 100644 index 00000000000000..4d8ab809c8d439 --- /dev/null +++ b/deps/v8/include/cppgc/type-traits.h @@ -0,0 +1,109 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_TYPE_TRAITS_H_ +#define INCLUDE_CPPGC_TYPE_TRAITS_H_ + +#include + +namespace cppgc { + +class Visitor; + +namespace internal { + +// Pre-C++17 custom implementation of std::void_t. +template +struct make_void { + typedef void type; +}; +template +using void_t = typename make_void::type; + +// Not supposed to be specialized by the user. +template +struct IsWeak : std::false_type {}; + +template class U> +struct IsSubclassOfTemplate { + private: + template + static std::true_type SubclassCheck(U*); + static std::false_type SubclassCheck(...); + + public: + static constexpr bool value = + decltype(SubclassCheck(std::declval()))::value; +}; + +// IsTraceMethodConst is used to verify that all Trace methods are marked as +// const. It is equivalent to IsTraceable but for a non-const object. +template +struct IsTraceMethodConst : std::false_type {}; + +template +struct IsTraceMethodConst().Trace( + std::declval()))>> : std::true_type { +}; + +template +struct IsTraceable : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsTraceable< + T, void_t().Trace(std::declval()))>> + : std::true_type { + // All Trace methods should be marked as const. If an object of type + // 'T' is traceable then any object of type 'const T' should also + // be traceable. + static_assert(IsTraceMethodConst(), + "Trace methods should be marked as const."); +}; + +template +constexpr bool IsTraceableV = IsTraceable::value; + +template +struct IsGarbageCollectedMixinType : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedMixinType< + T, + void_t::IsGarbageCollectedMixinTypeMarker>> + : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedType : IsGarbageCollectedMixinType { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedType< + T, void_t::IsGarbageCollectedTypeMarker>> + : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +constexpr bool IsGarbageCollectedTypeV = + internal::IsGarbageCollectedType::value; + +template +constexpr bool IsGarbageCollectedMixinTypeV = + internal::IsGarbageCollectedMixinType::value; + +} // namespace internal + +template +constexpr bool IsWeakV = internal::IsWeak::value; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_TYPE_TRAITS_H_ diff --git a/deps/v8/include/cppgc/visitor.h b/deps/v8/include/cppgc/visitor.h new file mode 100644 index 00000000000000..a73a4abb2bdb7c --- /dev/null +++ b/deps/v8/include/cppgc/visitor.h @@ -0,0 +1,138 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_VISITOR_H_ +#define INCLUDE_CPPGC_VISITOR_H_ + +#include "cppgc/garbage-collected.h" +#include "cppgc/internal/logging.h" +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/liveness-broker.h" +#include "cppgc/member.h" +#include "cppgc/source-location.h" +#include "cppgc/trace-trait.h" + +namespace cppgc { +namespace internal { +class VisitorBase; +} // namespace internal + +using WeakCallback = void (*)(const LivenessBroker&, const void*); + +/** + * Visitor passed to trace methods. All managed pointers must have called the + * visitor's trace method on them. + */ +class Visitor { + public: + template + void Trace(const Member& member) { + const T* value = member.GetRawAtomic(); + CPPGC_DCHECK(value != kSentinelPointer); + Trace(value); + } + + template + void Trace(const WeakMember& weak_member) { + static_assert(sizeof(T), "T must be fully defined"); + static_assert(internal::IsGarbageCollectedType::value, + "T must be GarabgeCollected or GarbageCollectedMixin type"); + + const T* value = weak_member.GetRawAtomic(); + + // Bailout assumes that WeakMember emits write barrier. + if (!value) { + return; + } + + // TODO(chromium:1056170): DCHECK (or similar) for deleted values as they + // should come in at a different path. + VisitWeak(value, TraceTrait::GetTraceDescriptor(value), + &HandleWeak>, &weak_member); + } + + template * = nullptr> + void TraceRoot(const Persistent& p, const SourceLocation& loc) { + using PointeeType = typename Persistent::PointeeType; + static_assert(sizeof(PointeeType), + "Persistent's pointee type must be fully defined"); + static_assert(internal::IsGarbageCollectedType::value, + "Persisent's pointee type must be GarabgeCollected or " + "GarbageCollectedMixin"); + if (!p.Get()) { + return; + } + VisitRoot(p.Get(), TraceTrait::GetTraceDescriptor(p.Get())); + } + + template < + typename WeakPersistent, + std::enable_if_t* = nullptr> + void TraceRoot(const WeakPersistent& p, const SourceLocation& loc) { + using PointeeType = typename WeakPersistent::PointeeType; + static_assert(sizeof(PointeeType), + "Persistent's pointee type must be fully defined"); + static_assert(internal::IsGarbageCollectedType::value, + "Persisent's pointee type must be GarabgeCollected or " + "GarbageCollectedMixin"); + VisitWeakRoot(p.Get(), TraceTrait::GetTraceDescriptor(p.Get()), + &HandleWeak, &p); + } + + template + void RegisterWeakCallbackMethod(const T* obj) { + RegisterWeakCallback(&WeakCallbackMethodDelegate, obj); + } + + virtual void RegisterWeakCallback(WeakCallback, const void*) {} + + protected: + virtual void Visit(const void* self, TraceDescriptor) {} + virtual void VisitWeak(const void* self, TraceDescriptor, WeakCallback, + const void* weak_member) {} + virtual void VisitRoot(const void*, TraceDescriptor) {} + virtual void VisitWeakRoot(const void* self, TraceDescriptor, WeakCallback, + const void* weak_root) {} + + private: + template + static void WeakCallbackMethodDelegate(const LivenessBroker& info, + const void* self) { + // Callback is registered through a potential const Trace method but needs + // to be able to modify fields. See HandleWeak. + (const_cast(static_cast(self))->*method)(info); + } + + template + static void HandleWeak(const LivenessBroker& info, const void* object) { + const PointerType* weak = static_cast(object); + const auto* raw = weak->Get(); + if (raw && !info.IsHeapObjectAlive(raw)) { + // Object is passed down through the marker as const. Alternatives are + // - non-const Trace method; + // - mutable pointer in MemberBase; + const_cast(weak)->Clear(); + } + } + + Visitor() = default; + + template + void Trace(const T* t) { + static_assert(sizeof(T), "T must be fully defined"); + static_assert(internal::IsGarbageCollectedType::value, + "T must be GarabgeCollected or GarbageCollectedMixin type"); + if (!t) { + return; + } + Visit(t, TraceTrait::GetTraceDescriptor(t)); + } + + friend class internal::VisitorBase; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_VISITOR_H_ diff --git a/deps/v8/include/js_protocol.pdl b/deps/v8/include/js_protocol.pdl index 3f5410d1e1f787..706c37f958e4a0 100644 --- a/deps/v8/include/js_protocol.pdl +++ b/deps/v8/include/js_protocol.pdl @@ -204,6 +204,21 @@ domain Debugger # Exception details. optional Runtime.ExceptionDetails exceptionDetails + # Execute a Wasm Evaluator module on a given call frame. + experimental command executeWasmEvaluator + parameters + # WebAssembly call frame identifier to evaluate on. + CallFrameId callFrameId + # Code of the evaluator module. + binary evaluator + # Terminate execution after timing out (number of milliseconds). + experimental optional Runtime.TimeDelta timeout + returns + # Object wrapper for the evaluation result. + Runtime.RemoteObject result + # Exception details. + optional Runtime.ExceptionDetails exceptionDetails + # Returns possible locations for breakpoint. scriptId in start and end range locations should be # the same. command getPossibleBreakpoints @@ -510,6 +525,18 @@ domain Debugger JavaScript WebAssembly + # Debug symbols available for a wasm script. + type DebugSymbols extends object + properties + # Type of the debug symbols. + enum type + None + SourceMap + EmbeddedDWARF + ExternalDWARF + # URL of the external symbol source. + optional string externalURL + # Fired when virtual machine fails to parse the script. event scriptFailedToParse parameters @@ -584,6 +611,8 @@ domain Debugger experimental optional integer codeOffset # The language of the script. experimental optional Debugger.ScriptLanguage scriptLanguage + # If the scriptLanguage is WebASsembly, the source of debug symbols for the module. + experimental optional Debugger.DebugSymbols debugSymbols experimental domain HeapProfiler depends on Runtime @@ -980,6 +1009,7 @@ domain Runtime f32 f64 v128 + anyref # Object class (constructor) name. Specified for `object` type values only. optional string className # Remote object value in case of primitive values or JSON values (if it was requested). diff --git a/deps/v8/include/libplatform/libplatform.h b/deps/v8/include/libplatform/libplatform.h index 6051b644fb9b59..c7ea4c2bd38575 100644 --- a/deps/v8/include/libplatform/libplatform.h +++ b/deps/v8/include/libplatform/libplatform.h @@ -9,8 +9,8 @@ #include "libplatform/libplatform-export.h" #include "libplatform/v8-tracing.h" -#include "v8-platform.h" // NOLINT(build/include) -#include "v8config.h" // NOLINT(build/include) +#include "v8-platform.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { namespace platform { diff --git a/deps/v8/include/libplatform/v8-tracing.h b/deps/v8/include/libplatform/v8-tracing.h index 79e6f62d23e1bb..45822d00f371d4 100644 --- a/deps/v8/include/libplatform/v8-tracing.h +++ b/deps/v8/include/libplatform/v8-tracing.h @@ -12,9 +12,12 @@ #include #include "libplatform/libplatform-export.h" -#include "v8-platform.h" // NOLINT(build/include) +#include "v8-platform.h" // NOLINT(build/include_directory) namespace perfetto { +namespace trace_processor { +class TraceProcessorStorage; +} class TracingSession; } @@ -28,7 +31,6 @@ namespace platform { namespace tracing { class TraceEventListener; -class JSONTraceEventListener; const int kTraceMaxNumArgs = 2; @@ -197,6 +199,9 @@ class V8_PLATFORM_EXPORT TraceConfig { TraceConfig() : enable_systrace_(false), enable_argument_filter_(false) {} TraceRecordMode GetTraceRecordMode() const { return record_mode_; } + const StringList& GetEnabledCategories() const { + return included_categories_; + } bool IsSystraceEnabled() const { return enable_systrace_; } bool IsArgumentFilterEnabled() const { return enable_argument_filter_; } @@ -229,6 +234,17 @@ class V8_PLATFORM_EXPORT TraceConfig { class V8_PLATFORM_EXPORT TracingController : public V8_PLATFORM_NON_EXPORTED_BASE(v8::TracingController) { public: + TracingController(); + ~TracingController() override; + +#if defined(V8_USE_PERFETTO) + // Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides + // the output stream for the JSON trace data. + void InitializeForPerfetto(std::ostream* output_stream); + // Provide an optional listener for testing that will receive trace events. + // Must be called before StartTracing(). + void SetTraceEventListenerForTesting(TraceEventListener* listener); +#else // defined(V8_USE_PERFETTO) // The pointer returned from GetCategoryGroupEnabled() points to a value with // zero or more of the following bits. Used in this class only. The // TRACE_EVENT macros should only use the value as a bool. These values must @@ -242,19 +258,8 @@ class V8_PLATFORM_EXPORT TracingController ENABLED_FOR_ETW_EXPORT = 1 << 3 }; - TracingController(); - ~TracingController() override; - // Takes ownership of |trace_buffer|. void Initialize(TraceBuffer* trace_buffer); -#ifdef V8_USE_PERFETTO - // Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides - // the output stream for the JSON trace data. - void InitializeForPerfetto(std::ostream* output_stream); - // Provide an optional listener for testing that will receive trace events. - // Must be called before StartTracing(). - void SetTraceEventListenerForTesting(TraceEventListener* listener); -#endif // v8::TracingController implementation. const uint8_t* GetCategoryGroupEnabled(const char* category_group) override; @@ -274,6 +279,10 @@ class V8_PLATFORM_EXPORT TracingController unsigned int flags, int64_t timestamp) override; void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, const char* name, uint64_t handle) override; + + static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag); +#endif // !defined(V8_USE_PERFETTO) + void AddTraceStateObserver( v8::TracingController::TraceStateObserver* observer) override; void RemoveTraceStateObserver( @@ -282,27 +291,32 @@ class V8_PLATFORM_EXPORT TracingController void StartTracing(TraceConfig* trace_config); void StopTracing(); - static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag); - protected: +#if !defined(V8_USE_PERFETTO) virtual int64_t CurrentTimestampMicroseconds(); virtual int64_t CurrentCpuTimestampMicroseconds(); +#endif // !defined(V8_USE_PERFETTO) private: +#if !defined(V8_USE_PERFETTO) void UpdateCategoryGroupEnabledFlag(size_t category_index); void UpdateCategoryGroupEnabledFlags(); +#endif // !defined(V8_USE_PERFETTO) - std::unique_ptr trace_buffer_; - std::unique_ptr trace_config_; std::unique_ptr mutex_; - std::unordered_set observers_; + std::unique_ptr trace_config_; std::atomic_bool recording_{false}; -#ifdef V8_USE_PERFETTO + std::unordered_set observers_; + +#if defined(V8_USE_PERFETTO) std::ostream* output_stream_ = nullptr; - std::unique_ptr json_listener_; + std::unique_ptr + trace_processor_; TraceEventListener* listener_for_testing_ = nullptr; std::unique_ptr tracing_session_; -#endif +#else // !defined(V8_USE_PERFETTO) + std::unique_ptr trace_buffer_; +#endif // !defined(V8_USE_PERFETTO) // Disallow copy and assign TracingController(const TracingController&) = delete; diff --git a/deps/v8/include/v8-fast-api-calls.h b/deps/v8/include/v8-fast-api-calls.h index 79a5d4d82a764d..f74406493bcf2a 100644 --- a/deps/v8/include/v8-fast-api-calls.h +++ b/deps/v8/include/v8-fast-api-calls.h @@ -165,7 +165,7 @@ #include #include -#include "v8config.h" // NOLINT(build/include) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { diff --git a/deps/v8/include/v8-inspector-protocol.h b/deps/v8/include/v8-inspector-protocol.h index 612a2ebc3911f5..a5ffb7d6954bcf 100644 --- a/deps/v8/include/v8-inspector-protocol.h +++ b/deps/v8/include/v8-inspector-protocol.h @@ -5,9 +5,9 @@ #ifndef V8_V8_INSPECTOR_PROTOCOL_H_ #define V8_V8_INSPECTOR_PROTOCOL_H_ -#include "inspector/Debugger.h" // NOLINT(build/include) -#include "inspector/Runtime.h" // NOLINT(build/include) -#include "inspector/Schema.h" // NOLINT(build/include) -#include "v8-inspector.h" // NOLINT(build/include) +#include "inspector/Debugger.h" // NOLINT(build/include_directory) +#include "inspector/Runtime.h" // NOLINT(build/include_directory) +#include "inspector/Schema.h" // NOLINT(build/include_directory) +#include "v8-inspector.h" // NOLINT(build/include_directory) #endif // V8_V8_INSPECTOR_PROTOCOL_H_ diff --git a/deps/v8/include/v8-inspector.h b/deps/v8/include/v8-inspector.h index 01274625c1f476..6573940e2fe3c3 100644 --- a/deps/v8/include/v8-inspector.h +++ b/deps/v8/include/v8-inspector.h @@ -11,7 +11,7 @@ #include #include -#include "v8.h" // NOLINT(build/include) +#include "v8.h" // NOLINT(build/include_directory) namespace v8_inspector { diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h index 876408ebba98f9..127a77dbfca070 100644 --- a/deps/v8/include/v8-internal.h +++ b/deps/v8/include/v8-internal.h @@ -10,8 +10,8 @@ #include #include -#include "v8-version.h" // NOLINT(build/include) -#include "v8config.h" // NOLINT(build/include) +#include "v8-version.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { @@ -106,6 +106,20 @@ const int kApiTaggedSize = kApiInt32Size; const int kApiTaggedSize = kApiSystemPointerSize; #endif +constexpr bool PointerCompressionIsEnabled() { + return kApiTaggedSize != kApiSystemPointerSize; +} + +constexpr bool HeapSandboxIsEnabled() { +#ifdef V8_HEAP_SANDBOX + return true; +#else + return false; +#endif +} + +using ExternalPointer_t = Address; + #ifdef V8_31BIT_SMIS_ON_64BIT_ARCH using PlatformSmiTagging = SmiTagging; #else @@ -126,6 +140,15 @@ V8_INLINE static constexpr internal::Address IntToSmi(int value) { kSmiTag; } +// {obj} must be the raw tagged pointer representation of a HeapObject +// that's guaranteed to never be in ReadOnlySpace. +V8_EXPORT internal::Isolate* IsolateFromNeverReadOnlySpaceObject(Address obj); + +// Returns if we need to throw when an error occurs. This infers the language +// mode based on the current context and the closure. This returns true if the +// language mode is strict. +V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate* isolate); + /** * This class exports constants and functionality from within v8 that * is necessary to implement inline functions in the v8 api. Don't @@ -141,7 +164,6 @@ class Internals { 1 * kApiTaggedSize + 2 * kApiInt32Size; static const int kOddballKindOffset = 4 * kApiTaggedSize + kApiDoubleSize; - static const int kForeignAddressOffset = kApiTaggedSize; static const int kJSObjectHeaderSize = 3 * kApiTaggedSize; static const int kFixedArrayHeaderSize = 2 * kApiTaggedSize; static const int kEmbedderDataArrayHeaderSize = 2 * kApiTaggedSize; @@ -326,11 +348,36 @@ class Internals { #endif } + V8_INLINE static internal::Isolate* GetIsolateForHeapSandbox( + internal::Address obj) { +#ifdef V8_HEAP_SANDBOX + return internal::IsolateFromNeverReadOnlySpaceObject(obj); +#else + // Not used in non-sandbox mode. + return nullptr; +#endif + } + + V8_INLINE static internal::Address ReadExternalPointerField( + internal::Isolate* isolate, internal::Address heap_object_ptr, + int offset) { + internal::Address value = ReadRawField
(heap_object_ptr, offset); +#ifdef V8_HEAP_SANDBOX + // We currently have to treat zero as nullptr in embedder slots. + if (value) value = DecodeExternalPointer(isolate, value); +#endif + return value; + } + #ifdef V8_COMPRESS_POINTERS // See v8:7703 or src/ptr-compr.* for details about pointer compression. static constexpr size_t kPtrComprHeapReservationSize = size_t{1} << 32; static constexpr size_t kPtrComprIsolateRootAlignment = size_t{1} << 32; + // See v8:10391 for details about V8 heap sandbox. + static constexpr uint32_t kExternalPointerSalt = + 0x7fffffff & ~static_cast(kHeapObjectTagMask); + V8_INLINE static internal::Address GetRootFromOnHeapAddress( internal::Address addr) { return addr & -static_cast(kPtrComprIsolateRootAlignment); @@ -341,6 +388,15 @@ class Internals { internal::Address root = GetRootFromOnHeapAddress(heap_object_ptr); return root + static_cast(static_cast(value)); } + + V8_INLINE static Address DecodeExternalPointer( + const Isolate* isolate, ExternalPointer_t encoded_pointer) { +#ifndef V8_HEAP_SANDBOX + return encoded_pointer; +#else + return encoded_pointer ^ kExternalPointerSalt; +#endif + } #endif // V8_COMPRESS_POINTERS }; @@ -367,15 +423,6 @@ V8_INLINE void PerformCastCheck(T* data) { CastCheck::value>::Perform(data); } -// {obj} must be the raw tagged pointer representation of a HeapObject -// that's guaranteed to never be in ReadOnlySpace. -V8_EXPORT internal::Isolate* IsolateFromNeverReadOnlySpaceObject(Address obj); - -// Returns if we need to throw when an error occurs. This infers the language -// mode based on the current context and the closure. This returns true if the -// language mode is strict. -V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate* isolate); - // A base class for backing stores, which is needed due to vagaries of // how static casts work with std::shared_ptr. class BackingStoreBase {}; diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 5d23cd665ed399..7cfd18b5708d57 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -11,12 +11,34 @@ #include #include -#include "v8config.h" // NOLINT(build/include) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { class Isolate; +// Valid priorities supported by the task scheduling infrastructure. +enum class TaskPriority : uint8_t { + /** + * Best effort tasks are not critical for performance of the application. The + * platform implementation should preempt such tasks if higher priority tasks + * arrive. + */ + kBestEffort, + /** + * User visible tasks are long running background tasks that will + * improve performance and memory usage of the application upon completion. + * Example: background compilation and garbage collection. + */ + kUserVisible, + /** + * User blocking tasks are highest priority tasks that block the execution + * thread (e.g. major garbage collection). They must be finished as soon as + * possible. + */ + kUserBlocking, +}; + /** * A Task represents a unit of work. */ @@ -113,6 +135,82 @@ class TaskRunner { TaskRunner& operator=(const TaskRunner&) = delete; }; +/** + * Delegate that's passed to Job's worker task, providing an entry point to + * communicate with the scheduler. + */ +class JobDelegate { + public: + /** + * Returns true if this thread should return from the worker task on the + * current thread ASAP. Workers should periodically invoke ShouldYield (or + * YieldIfNeeded()) as often as is reasonable. + */ + virtual bool ShouldYield() = 0; + + /** + * Notifies the scheduler that max concurrency was increased, and the number + * of worker should be adjusted accordingly. See Platform::PostJob() for more + * details. + */ + virtual void NotifyConcurrencyIncrease() = 0; +}; + +/** + * Handle returned when posting a Job. Provides methods to control execution of + * the posted Job. + */ +class JobHandle { + public: + virtual ~JobHandle() = default; + + /** + * Notifies the scheduler that max concurrency was increased, and the number + * of worker should be adjusted accordingly. See Platform::PostJob() for more + * details. + */ + virtual void NotifyConcurrencyIncrease() = 0; + + /** + * Contributes to the job on this thread. Doesn't return until all tasks have + * completed and max concurrency becomes 0. When Join() is called and max + * concurrency reaches 0, it should not increase again. This also promotes + * this Job's priority to be at least as high as the calling thread's + * priority. + */ + virtual void Join() = 0; + + /** + * Forces all existing workers to yield ASAP. Waits until they have all + * returned from the Job's callback before returning. + */ + virtual void Cancel() = 0; + + /** + * Returns true if associated with a Job and other methods may be called. + * Returns false after Join() or Cancel() was called. + */ + virtual bool IsRunning() = 0; +}; + +/** + * A JobTask represents work to run in parallel from Platform::PostJob(). + */ +class JobTask { + public: + virtual ~JobTask() = default; + + virtual void Run(JobDelegate* delegate) = 0; + + /** + * Controls the maximum number of threads calling Run() concurrently. Run() is + * only invoked if the number of threads previously running Run() was less + * than the value returned. Since GetMaxConcurrency() is a leaf function, it + * must not call back any JobHandle methods. + */ + virtual size_t GetMaxConcurrency() const = 0; +}; + /** * The interface represents complex arguments to trace events. */ @@ -138,6 +236,10 @@ class TracingController { public: virtual ~TracingController() = default; + // In Perfetto mode, trace events are written using Perfetto's Track Event + // API directly without going through the embedder. However, it is still + // possible to observe tracing being enabled and disabled. +#if !defined(V8_USE_PERFETTO) /** * Called by TRACE_EVENT* macros, don't call this directly. * The name parameter is a category group for example: @@ -183,6 +285,7 @@ class TracingController { **/ virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, const char* name, uint64_t handle) {} +#endif // !defined(V8_USE_PERFETTO) class TraceStateObserver { public: @@ -368,6 +471,64 @@ class Platform { */ virtual bool IdleTasksEnabled(Isolate* isolate) { return false; } + /** + * Posts |job_task| to run in parallel. Returns a JobHandle associated with + * the Job, which can be joined or canceled. + * This avoids degenerate cases: + * - Calling CallOnWorkerThread() for each work item, causing significant + * overhead. + * - Fixed number of CallOnWorkerThread() calls that split the work and might + * run for a long time. This is problematic when many components post + * "num cores" tasks and all expect to use all the cores. In these cases, + * the scheduler lacks context to be fair to multiple same-priority requests + * and/or ability to request lower priority work to yield when high priority + * work comes in. + * A canonical implementation of |job_task| looks like: + * class MyJobTask : public JobTask { + * public: + * MyJobTask(...) : worker_queue_(...) {} + * // JobTask: + * void Run(JobDelegate* delegate) override { + * while (!delegate->ShouldYield()) { + * // Smallest unit of work. + * auto work_item = worker_queue_.TakeWorkItem(); // Thread safe. + * if (!work_item) return; + * ProcessWork(work_item); + * } + * } + * + * size_t GetMaxConcurrency() const override { + * return worker_queue_.GetSize(); // Thread safe. + * } + * }; + * auto handle = PostJob(TaskPriority::kUserVisible, + * std::make_unique(...)); + * handle->Join(); + * + * PostJob() and methods of the returned JobHandle/JobDelegate, must never be + * called while holding a lock that could be acquired by JobTask::Run or + * JobTask::GetMaxConcurrency -- that could result in a deadlock. This is + * because [1] JobTask::GetMaxConcurrency may be invoked while holding + * internal lock (A), hence JobTask::GetMaxConcurrency can only use a lock (B) + * if that lock is *never* held while calling back into JobHandle from any + * thread (A=>B/B=>A deadlock) and [2] JobTask::Run or + * JobTask::GetMaxConcurrency may be invoked synchronously from JobHandle + * (B=>JobHandle::foo=>B deadlock). + * + * A sufficient PostJob() implementation that uses the default Job provided in + * libplatform looks like: + * std::unique_ptr PostJob( + * TaskPriority priority, std::unique_ptr job_task) override { + * return std::make_unique( + * std::make_shared( + * this, std::move(job_task), kNumThreads)); + * } + */ + virtual std::unique_ptr PostJob( + TaskPriority priority, std::unique_ptr job_task) { + return nullptr; + } + /** * Monotonically increasing time in seconds from an arbitrary fixed point in * the past. This function is expected to return at least diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 866d799076e9db..c3b25e8d6a6302 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -10,7 +10,7 @@ #include #include -#include "v8.h" // NOLINT(build/include) +#include "v8.h" // NOLINT(build/include_directory) /** * Profiler support for the V8 JavaScript engine. diff --git a/deps/v8/include/v8-util.h b/deps/v8/include/v8-util.h index 29d813e4274d16..89ec4f6a789c03 100644 --- a/deps/v8/include/v8-util.h +++ b/deps/v8/include/v8-util.h @@ -5,7 +5,7 @@ #ifndef V8_UTIL_H_ #define V8_UTIL_H_ -#include "v8.h" // NOLINT(build/include) +#include "v8.h" // NOLINT(build/include_directory) #include #include #include diff --git a/deps/v8/include/v8-version-string.h b/deps/v8/include/v8-version-string.h index fb84144d544106..8faed2a740592b 100644 --- a/deps/v8/include/v8-version-string.h +++ b/deps/v8/include/v8-version-string.h @@ -5,7 +5,7 @@ #ifndef V8_VERSION_STRING_H_ #define V8_VERSION_STRING_H_ -#include "v8-version.h" // NOLINT(build/include) +#include "v8-version.h" // NOLINT(build/include_directory) // This is here rather than v8-version.h to keep that file simple and // machine-processable. diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 64f184866537b5..cee7990e4bc193 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 8 -#define V8_MINOR_VERSION 3 -#define V8_BUILD_NUMBER 110 -#define V8_PATCH_LEVEL 9 +#define V8_MINOR_VERSION 4 +#define V8_BUILD_NUMBER 371 +#define V8_PATCH_LEVEL 19 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/include/v8-wasm-trap-handler-posix.h b/deps/v8/include/v8-wasm-trap-handler-posix.h index 998d0a41bb73d8..9b8e8a5b496aa0 100644 --- a/deps/v8/include/v8-wasm-trap-handler-posix.h +++ b/deps/v8/include/v8-wasm-trap-handler-posix.h @@ -7,7 +7,7 @@ #include -#include "v8config.h" // NOLINT(build/include) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { /** diff --git a/deps/v8/include/v8-wasm-trap-handler-win.h b/deps/v8/include/v8-wasm-trap-handler-win.h index 0185df6401c24b..9d3cad58483285 100644 --- a/deps/v8/include/v8-wasm-trap-handler-win.h +++ b/deps/v8/include/v8-wasm-trap-handler-win.h @@ -7,7 +7,7 @@ #include -#include "v8config.h" // NOLINT(build/include) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { /** diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index da4eb341295671..18d72f1630ccd5 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -18,15 +18,17 @@ #include #include #include + #include #include #include #include #include -#include "v8-internal.h" // NOLINT(build/include) -#include "v8-version.h" // NOLINT(build/include) -#include "v8config.h" // NOLINT(build/include) +#include "cppgc/common.h" +#include "v8-internal.h" // NOLINT(build/include_directory) +#include "v8-version.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) // We reserve the V8_* prefix for macros defined in V8 public API and // assume there are no name conflicts with the embedder's code. @@ -123,19 +125,21 @@ namespace internal { enum class ArgumentsType; template class Arguments; +template +class CustomArguments; class DeferredHandles; +class FunctionCallbackArguments; +class GlobalHandles; class Heap; class HeapObject; class ExternalString; class Isolate; class LocalEmbedderHeapTracer; class MicrotaskQueue; -struct ScriptStreamingData; -template class CustomArguments; class PropertyCallbackArguments; -class FunctionCallbackArguments; -class GlobalHandles; +class ReadOnlyHeap; class ScopedExternalStringLock; +struct ScriptStreamingData; class ThreadLocalTop; namespace wasm { @@ -1752,11 +1756,9 @@ class V8_EXPORT ScriptCompiler { public: enum Encoding { ONE_BYTE, TWO_BYTE, UTF8 }; -#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */ V8_DEPRECATE_SOON( "This class takes ownership of source_stream, so use the constructor " "taking a unique_ptr to make these semantics clearer") -#endif StreamedSource(ExternalSourceStream* source_stream, Encoding encoding); StreamedSource(std::unique_ptr source_stream, Encoding encoding); @@ -4764,11 +4766,17 @@ class V8_EXPORT CompiledWasmModule { */ MemorySpan GetWireBytesRef(); + const std::string& source_url() const { return source_url_; } + private: - explicit CompiledWasmModule(std::shared_ptr); - friend class Utils; + friend class WasmModuleObject; + friend class WasmStreaming; + + explicit CompiledWasmModule(std::shared_ptr, + const char* source_url, size_t url_length); const std::shared_ptr native_module_; + const std::string source_url_; }; // An instance of WebAssembly.Module. @@ -5935,37 +5943,6 @@ class V8_EXPORT RegExp : public Object { static void CheckCast(Value* obj); }; -/** - * An instance of the built-in FinalizationRegistry constructor. - * - * The C++ name is FinalizationGroup for backwards compatibility. This API is - * experimental and deprecated. - */ -class V8_EXPORT FinalizationGroup : public Object { - public: - /** - * Runs the cleanup callback of the given FinalizationRegistry. - * - * V8 will inform the embedder that there are finalizer callbacks be - * called through HostCleanupFinalizationGroupCallback. - * - * HostCleanupFinalizationGroupCallback should schedule a task to - * call FinalizationGroup::Cleanup() at some point in the - * future. It's the embedders responsiblity to make this call at a - * time which does not interrupt synchronous ECMAScript code - * execution. - * - * If the result is Nothing then an exception has - * occurred. Otherwise the result is |true| if the cleanup callback - * was called successfully. The result is never |false|. - */ - V8_DEPRECATED( - "FinalizationGroup cleanup is automatic if " - "HostCleanupFinalizationGroupCallback is not set") - static V8_WARN_UNUSED_RESULT Maybe Cleanup( - Local finalization_group); -}; - /** * A JavaScript value that wraps a C++ void*. This type of value is mainly used * to associate C++ data structures with JavaScript objects. @@ -6451,11 +6428,6 @@ class V8_EXPORT FunctionTemplate : public Template { SideEffectType side_effect_type = SideEffectType::kHasSideEffect, const CFunction* c_function = nullptr); - /** Get a template included in the snapshot by index. */ - V8_DEPRECATED("Use v8::Isolate::GetDataFromSnapshotOnce instead") - static MaybeLocal FromSnapshot(Isolate* isolate, - size_t index); - /** * Creates a function template backed/cached by a private property. */ @@ -6745,11 +6717,6 @@ class V8_EXPORT ObjectTemplate : public Template { Isolate* isolate, Local constructor = Local()); - /** Get a template included in the snapshot by index. */ - V8_DEPRECATED("Use v8::Isolate::GetDataFromSnapshotOnce instead") - static MaybeLocal FromSnapshot(Isolate* isolate, - size_t index); - /** Creates a new instance of this template.*/ V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(Local context); @@ -7182,6 +7149,9 @@ class V8_EXPORT Exception { static Local ReferenceError(Local message); static Local SyntaxError(Local message); static Local TypeError(Local message); + static Local WasmCompileError(Local message); + static Local WasmLinkError(Local message); + static Local WasmRuntimeError(Local message); static Local Error(Local message); /** @@ -7225,20 +7195,6 @@ typedef void (*AddCrashKeyCallback)(CrashKeyId id, const std::string& value); typedef void (*BeforeCallEnteredCallback)(Isolate*); typedef void (*CallCompletedCallback)(Isolate*); -/** - * HostCleanupFinalizationGroupCallback is called when we require the - * embedder to enqueue a task that would call - * FinalizationGroup::Cleanup(). - * - * The FinalizationGroup is the one for which the embedder needs to - * call FinalizationGroup::Cleanup() on. - * - * The context provided is the one in which the FinalizationGroup was - * created in. - */ -typedef void (*HostCleanupFinalizationGroupCallback)( - Local context, Local fg); - /** * HostImportModuleDynamicallyCallback is called when we require the * embedder to load a module. This is used as part of the dynamic @@ -7265,7 +7221,8 @@ typedef MaybeLocal (*HostImportModuleDynamicallyCallback)( /** * HostInitializeImportMetaObjectCallback is called the first time import.meta - * is accessed for a module. Subsequent access will reuse the same value. + * is accessed for a module. Subsequent access will reuse the same value. The + * callback must not throw. * * The method combines two implementation-defined abstract operations into one: * HostGetImportMetaProperties and HostFinalizeImportMeta. @@ -7336,6 +7293,7 @@ class PromiseRejectMessage { typedef void (*PromiseRejectCallback)(PromiseRejectMessage message); // --- Microtasks Callbacks --- +V8_DEPRECATE_SOON("Use *WithData version.") typedef void (*MicrotasksCompletedCallback)(Isolate*); typedef void (*MicrotasksCompletedCallbackWithData)(Isolate*, void*); typedef void (*MicrotaskCallback)(void* data); @@ -7527,6 +7485,9 @@ typedef bool (*WasmThreadsEnabledCallback)(Local context); typedef Local (*WasmLoadSourceMapCallback)(Isolate* isolate, const char* name); +// --- Callback for checking if WebAssembly Simd is enabled --- +typedef bool (*WasmSimdEnabledCallback)(Local context); + // --- Garbage Collection Callbacks --- /** @@ -7604,6 +7565,7 @@ class V8_EXPORT SharedMemoryStatistics { size_t read_only_space_physical_size_; friend class V8; + friend class internal::ReadOnlyHeap; }; /** @@ -7883,16 +7845,12 @@ enum class MemoryPressureLevel { kNone, kModerate, kCritical }; */ class V8_EXPORT EmbedderHeapTracer { public: + using EmbedderStackState = cppgc::EmbedderStackState; + enum TraceFlags : uint64_t { kNoFlags = 0, kReduceMemory = 1 << 0, - }; - - // Indicator for the stack state of the embedder. - enum EmbedderStackState { - kUnknown, - kNonEmpty, - kEmpty, + kForced = 1 << 2, }; /** @@ -8455,7 +8413,7 @@ class V8_EXPORT Isolate { kOptimizedFunctionWithOneShotBytecode = 71, kRegExpMatchIsTrueishOnNonJSRegExp = 72, kRegExpMatchIsFalseishOnJSRegExp = 73, - kDateGetTimezoneOffset = 74, + kDateGetTimezoneOffset = 74, // Unused. kStringNormalize = 75, kCallSiteAPIGetFunctionSloppyCall = 76, kCallSiteAPIGetThisSloppyCall = 77, @@ -8471,6 +8429,24 @@ class V8_EXPORT Isolate { kDateTimeFormatDateTimeStyle = 87, kBreakIteratorTypeWord = 88, kBreakIteratorTypeLine = 89, + kInvalidatedArrayBufferDetachingProtector = 90, + kInvalidatedArrayConstructorProtector = 91, + kInvalidatedArrayIteratorLookupChainProtector = 92, + kInvalidatedArraySpeciesLookupChainProtector = 93, + kInvalidatedIsConcatSpreadableLookupChainProtector = 94, + kInvalidatedMapIteratorLookupChainProtector = 95, + kInvalidatedNoElementsProtector = 96, + kInvalidatedPromiseHookProtector = 97, + kInvalidatedPromiseResolveLookupChainProtector = 98, + kInvalidatedPromiseSpeciesLookupChainProtector = 99, + kInvalidatedPromiseThenLookupChainProtector = 100, + kInvalidatedRegExpSpeciesLookupChainProtector = 101, + kInvalidatedSetIteratorLookupChainProtector = 102, + kInvalidatedStringIteratorLookupChainProtector = 103, + kInvalidatedStringLengthOverflowLookupChainProtector = 104, + kInvalidatedTypedArraySpeciesLookupChainProtector = 105, + kWasmSimdOpcodes = 106, + kVarRedeclaredCatchBinding = 107, // If you add new values here, you'll also need to update Chromium's: // web_feature.mojom, use_counter_callback.cc, and enums.xml. V8 changes to @@ -8559,17 +8535,6 @@ class V8_EXPORT Isolate { void SetAbortOnUncaughtExceptionCallback( AbortOnUncaughtExceptionCallback callback); - /** - * This specifies the callback to be called when FinalizationRegistries - * are ready to be cleaned up and require FinalizationGroup::Cleanup() - * to be called in a future task. - */ - V8_DEPRECATED( - "FinalizationRegistry cleanup is automatic if " - "HostCleanupFinalizationGroupCallback is not set") - void SetHostCleanupFinalizationGroupCallback( - HostCleanupFinalizationGroupCallback callback); - /** * This specifies the callback called by the upcoming dynamic * import() language feature to load modules. @@ -9384,6 +9349,8 @@ class V8_EXPORT Isolate { void SetWasmLoadSourceMapCallback(WasmLoadSourceMapCallback callback); + void SetWasmSimdEnabledCallback(WasmSimdEnabledCallback callback); + /** * Check if V8 is dead and therefore unusable. This is the case after * fatal errors such as out-of-memory situations. @@ -9522,7 +9489,6 @@ class V8_EXPORT Isolate { internal::Address* GetDataFromSnapshotOnce(size_t index); void ReportExternalAllocationLimitReached(); - void CheckMemoryPressure(); }; class V8_EXPORT StartupData { @@ -9608,7 +9574,13 @@ class V8_EXPORT V8 { * Initializes V8. This function needs to be called before the first Isolate * is created. It always returns true. */ - static bool Initialize(); + V8_INLINE static bool Initialize() { + const int kBuildConfiguration = + (internal::PointerCompressionIsEnabled() ? kPointerCompression : 0) | + (internal::SmiValuesAre31Bits() ? k31BitSmis : 0) | + (internal::HeapSandboxIsEnabled() ? kHeapSandbox : 0); + return Initialize(kBuildConfiguration); + } /** * Allows the host application to provide a callback which can be used @@ -9742,6 +9714,18 @@ class V8_EXPORT V8 { private: V8(); + enum BuildConfigurationFeatures { + kPointerCompression = 1 << 0, + k31BitSmis = 1 << 1, + kHeapSandbox = 1 << 2, + }; + + /** + * Checks that the embedder build configuration is compatible with + * the V8 binary and if so initializes V8. + */ + static bool Initialize(int build_config); + static internal::Address* GlobalizeReference(internal::Isolate* isolate, internal::Address* handle); static internal::Address* GlobalizeTracedReference(internal::Isolate* isolate, @@ -9865,13 +9849,6 @@ class V8_EXPORT SnapshotCreator { SerializeInternalFieldsCallback callback = SerializeInternalFieldsCallback()); - /** - * Add a template to be included in the snapshot blob. - * \returns the index of the template in the snapshot blob. - */ - V8_DEPRECATED("use AddData instead") - size_t AddTemplate(Local