[snapshot] Reset pending reference state at trusted section

A corrupted untrusted section can end with pending reference state, e.g.
a weak prefix that no reference consumes, or unresolved forward refs.
This state used to leak into the trusted section, where the startup and
shared heap deserializers immediately write root slots, so a stray weak
prefix could put a weak pointer into the roots table or the shared heap
object cache.

Reset this state when switching to the trusted section, like we already
do for back references.

TAG=agy
CONV=6cd7c82c-fcf5-401a-b286-ef139e5b8b3a

Bug: 564863360
Change-Id: I15d6b213f9c90afa9ad7424862e8115bf24d1c0f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8871054
Reviewed-by: Arash Kazemi <arashk@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#112728}
2 files changed
tree: 8dc07d6cc1dcb7e9586e78e5a505569543ec95a6
  1. .github/
  2. agents/
  3. bazel/
  4. build_overrides/
  5. custom_deps/
  6. docs/
  7. experimental/
  8. gni/
  9. include/
  10. infra/
  11. samples/
  12. src/
  13. test/
  14. testing/
  15. third_party/
  16. tools/
  17. .bazelrc
  18. .clang-format
  19. .clang-tidy
  20. .editorconfig
  21. .flake8
  22. .git-blame-ignore-revs
  23. .gitattributes
  24. .gitignore
  25. .gn
  26. .mailmap
  27. .rustfmt.toml
  28. .style.yapf
  29. .ycm_extra_conf.py
  30. AUTHORS
  31. BUILD.bazel
  32. BUILD.gn
  33. CODE_OF_CONDUCT.md
  34. codereview.settings
  35. COMMON_OWNERS
  36. DEPS
  37. DIR_METADATA
  38. ENG_REVIEW_OWNERS
  39. INFRA_OWNERS
  40. INTL_OWNERS
  41. LICENSE
  42. LICENSE.fdlibm
  43. LICENSE.strongtalk
  44. LICENSE.v8
  45. LOONG_OWNERS
  46. MIPS_OWNERS
  47. MODULE.bazel
  48. OWNERS
  49. PPC_OWNERS
  50. PRESUBMIT.py
  51. pyrightconfig.json
  52. README.md
  53. RISCV_OWNERS
  54. S390_OWNERS
  55. SECURITY.md
  56. vpython.toml
  57. vpython.toml.uv.lock
  58. WATCHLISTS
README.md

V8 JavaScript Engine

V8 is Google's open source JavaScript engine.

V8 implements ECMAScript as specified in ECMA-262.

V8 is written in C++ and is used in Chromium, the open source browser from Google.

V8 can run standalone, or can be embedded into any C++ application.

V8 Project page: https://v8.dev/docs

Getting the Code

Checkout depot tools, and run

    fetch v8

This will checkout V8 into the directory v8 and fetch all of its dependencies. To stay up to date, run

    git pull origin
    gclient sync

For fetching all branches, add the following into your remote configuration in .git/config:

    fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*
    fetch = +refs/tags/*:refs/tags/*

Contributing

Please follow the instructions mentioned at v8.dev/docs/contribute.