As discussed in chat, let's finally do this!
I guess there's no better way than one big CL, so here it is...
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
struct MarkAsIndirectJumpTargetTag;I think explicitly declaring the tag shouldn't be needed?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I think explicitly declaring the tag shouldn't be needed?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (module_->memories.empty() || module_->memories[0].!is_shared) {Gemini spotted a syntax error here (supposedly unnoticed since it's only for interpreter builds?).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (module_->memories.empty() || module_->memories[0].!is_shared) {Gemini spotted a syntax error here (supposedly unnoticed since it's only for interpreter builds?).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
lazy_deopt_on_throw == compiler::LazyDeoptOnThrow{false});nit: Ditto here.
DCHECK_IMPLIES(lazy_deopt_on_throw == compiler::LazyDeoptOnThrow{true},nit: Does it compile if we omit the "== ..." part entirely?
const bool type_is_shared = module_->types[type_index].is_shared;There are also `v8_enable_drumbrake` build errors here and in 2750 where the implicit conversion is attempted. I'm not sure though if the CL is expected to take care of all that since it's externally-maintained.
DCHECK_EQ(shared_, SharedFlag{false});nit: Does it work to simply say `DCHECK(!shared_)`?
Ditto for other `DCHECK_EQ(shared_`, `DCHECK_EQ(table_type.is_shared()`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
lazy_deopt_on_throw == compiler::LazyDeoptOnThrow{false});Clemens Backesnit: Ditto here.
Done
DCHECK_IMPLIES(lazy_deopt_on_throw == compiler::LazyDeoptOnThrow{true},nit: Does it compile if we omit the "== ..." part entirely?
Sure, it does! Fixed.
const bool type_is_shared = module_->types[type_index].is_shared;There are also `v8_enable_drumbrake` build errors here and in 2750 where the implicit conversion is attempted. I'm not sure though if the CL is expected to take care of all that since it's externally-maintained.
We usually don't care about them. We could also opt to not touch the wasm interpreter directly at all. In this case though it's simple enough to ask gemini to just update that as well.
+Paolo FYI. Let me know if we should handle this differently.
nit: Does it work to simply say `DCHECK(!shared_)`?
Ditto for other `DCHECK_EQ(shared_`, `DCHECK_EQ(table_type.is_shared()`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
thanks! lgtm
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks for the changes under wasm/interpreter/ !
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
overall lgtm
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
Nice, let's land this then before it needs another rebase!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[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=clem...@chromium.org
NO_IFTTT=renaming only
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |