3 Commits
Author SHA1 Message Date
Olivier Flückiger 5166809f70 [maglev] Merge TryOnStackReplacement with loop interrupt
Change-Id: I065a350a053ccd68c145d22f8a52ee0465a23200
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8174385
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Auto-Submit: Olivier Flückiger <olivf@chromium.org>
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109106}
2026-08-06 08:05:03 -07:00
Clemens Backes a59996fbdd [wasm][common] Use StrongAlias for boolean-like enums
Migrate several boolean-like enums to base::StrongAlias<Tag, bool> to
improve type safety and align with the Blink C++ style guide. This
change replaces plain enums and "enum class : bool" with StrongAlias,
providing stronger typing while maintaining semantic clarity.

For most types, direct constructor calls (e.g., SharedFlag{true}) are
used at call sites to follow the style guide's recommendation for
explicit boolean-like StrongAlias usage. StrongAlias instances wrapping
bool are used directly in boolean expressions (e.g., if (flag)),
leveraging contextual conversion to bool.

Enums migrated to StrongAlias:
- SharedFlag, AllowAllocation, PerformHeapLimitCheck,
  PerformIneffectiveMarkCompactCheck, NeedsContext, AdaptArguments
- CanThrow, LazyDeoptOnThrow
- AlignmentCheck, EnforceBoundsCheck (fully migrated from enum class)
- CreateSourcePositions, CodeObjectRequired
- MarkAsIndirectJumpTarget
- ResizableFlag, ImmutableFlag
- Validation, EmptyNames, UpdateResult
- InitializedFlag, InSharedSpace

Newly introduced StrongAlias types:
- HasGuardRegions (for BackingStore/Wasm memory)
- CustomDeleter (for BackingStore)
- EmptyDeleter (for BackingStore)

Key Improvements and Cleanups:
- Used direct brace initialization (e.g., Type{true}) instead of named
  constants for MarkAsIndirectJumpTarget, AlignmentCheck, and
  InSharedSpace to leverage the expressiveness of the type names.
- Leveraged contextual boolean conversion for StrongAlias types to
  simplify checks (e.g., using 'if (flag)' instead of explicit equality
  comparisons with constants or literal values).
- Refactored the BackingStore constructor to replace five raw boolean
  parameters with type-safe StrongAlias and WasmMemoryFlag types,
  preventing accidental parameter swapping.
- Improved Turboshaft PrintOptions to use the custom operator<< for
  SharedFlag, ensuring consistent terminology in debug output.

Infrastructure support was added to base::StrongAlias for hashing and
Turboshaft integration (is_strong_alias_v).

TAG=agy
R=clemensb@chromium.org
NO_IFTTT=renaming only

Change-Id: Id703bdd17327b46177b74ffd633f3362a1c2b503
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8005975
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Maksim Ivanov <emaxx@google.com>
Cr-Commit-Position: refs/heads/main@{#108374}
2026-07-01 08:39:23 -07:00
Leszek Swirski 3df8267ce5 [docs] Start documentation for V8 internals
Start an attempt at documenting V8's internals, from high-level concepts
to low-level implementation details. These docs are intended to be
readable to both humans and AI agents, with the hope that documentation
like this can help both humans and AIs maintain a concept of the overall
design and design constraints when making changes. It merges in the
existing documentation we had along with a bunch of AI-assisted extra
docs.

Includes a web viewer that renders the markdown and mermaid diagrams.
The viewer supports commenting, where comments are saved in
docs/viewer/comments.json, and can be manually or agentically resolved.

#ai-assisted

Bug: 500280354
Change-Id: Ie9ffc2f2f85de1496b8266027ca8b5b455acdb63
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7761899
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106585}
2026-04-17 08:13:40 -07:00