mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
LibJS: Make IteratorRecord slightly smaller
By reordering the members, we take this from 40 bytes to 32 bytes.
This commit is contained in:
parent
b9c57d3122
commit
628862e779
1 changed files with 5 additions and 3 deletions
|
@ -23,20 +23,22 @@ class IteratorRecord final : public Cell {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IteratorRecord(GC::Ptr<Object> iterator, Value next_method, bool done)
|
IteratorRecord(GC::Ptr<Object> iterator, Value next_method, bool done)
|
||||||
: iterator(iterator)
|
: done(done)
|
||||||
|
, iterator(iterator)
|
||||||
, next_method(next_method)
|
, next_method(next_method)
|
||||||
, done(done)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool done { false }; // [[Done]]
|
||||||
GC::Ptr<Object> iterator; // [[Iterator]]
|
GC::Ptr<Object> iterator; // [[Iterator]]
|
||||||
Value next_method; // [[NextMethod]]
|
Value next_method; // [[NextMethod]]
|
||||||
bool done { false }; // [[Done]]
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void visit_edges(Cell::Visitor&) override;
|
virtual void visit_edges(Cell::Visitor&) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static_assert(sizeof(IteratorRecord) == 32);
|
||||||
|
|
||||||
class Iterator : public Object {
|
class Iterator : public Object {
|
||||||
JS_OBJECT(Iterator, Object);
|
JS_OBJECT(Iterator, Object);
|
||||||
GC_DECLARE_ALLOCATOR(Iterator);
|
GC_DECLARE_ALLOCATOR(Iterator);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue