LibJS: Make IteratorRecord slightly smaller

By reordering the members, we take this from 40 bytes to 32 bytes.
This commit is contained in:
Andreas Kling 2025-04-01 15:18:22 +02:00 committed by Andreas Kling
parent 23f0fddeab
commit fd0a0e963a
Notes: github-actions[bot] 2025-04-01 18:17:32 +00:00

View file

@ -23,20 +23,22 @@ class IteratorRecord final : public Cell {
public:
IteratorRecord(GC::Ptr<Object> iterator, Value next_method, bool done)
: iterator(iterator)
: done(done)
, iterator(iterator)
, next_method(next_method)
, done(done)
{
}
bool done { false }; // [[Done]]
GC::Ptr<Object> iterator; // [[Iterator]]
Value next_method; // [[NextMethod]]
bool done { false }; // [[Done]]
private:
virtual void visit_edges(Cell::Visitor&) override;
};
static_assert(sizeof(IteratorRecord) == 32);
class Iterator : public Object {
JS_OBJECT(Iterator, Object);
GC_DECLARE_ALLOCATOR(Iterator);