Change information
Commit message:
[tagged] Port SwissNameDictionary and SmallOrderedHash* to HeapObjectLayout
Convert the C++ classes to V8_OBJECT/HeapObjectLayout and flip the
.tq side from @doNotGenerateCppClass to @cppObjectLayoutDefinition,
using real members + a FLEXIBLE_ARRAY_MEMBER for the asserts to bind
to (the trailing ctrl/property-details/hash/chain sections still go
through offset arithmetic, since FAM models only one variable tail).
The CRTP base SmallOrderedHashTable<Derived> can't sit at a stable
sizeof() without arguments, so split it: a non-template
SmallOrderedHashTable empty-layout class becomes the public-facing
type, and the CRTP impl moves to SmallOrderedHashTableImpl<Derived>.
The Derived-independent constants (kMinCapacity, kMaxCapacity,
kNotFound, kLoadFactor, kGrowthHack) move down to the non-template
class so the .tq references resolve as plain
SmallOrderedHashTable::kFoo (no more <int> dummy).
Drive-by torque fix: the offset emitter reported size 0 for any
indexed field, including constant-indexed ones. Compute literal-
indexed sizes as N * element_size so e.g. padding[1] / padding[5]
generate correct asserts. Variable-indexed fields and named-constant
indexes still report 0 (same as before).
Bug: 42202654
Change-Id: Id138438db1b11ce655c51103b4db9508154d1fed
Cr-Commit-Position: refs/heads/main@{#106898}
Files:
- M src/diagnostics/objects-debug.cc
- M src/objects/objects-body-descriptors-inl.h
- M src/objects/ordered-hash-table-inl.h
- M src/objects/ordered-hash-table.cc
- M src/objects/ordered-hash-table.h
- M src/objects/ordered-hash-table.tq
- M src/objects/swiss-name-dictionary-inl.h
- M src/objects/swiss-name-dictionary.h
- M src/objects/swiss-name-dictionary.tq
- M src/torque/implementation-visitor.cc
Change size: L
Delta: 10 files changed, 214 insertions(+), 170 deletions(-)
Branch: refs/heads/main
Submit Requirements:
Code-Review: +1 by Leszek Swirski