CellAttributes fits in 16 bits, and client code never modifies returned CellAttributes values. Hence, there is no reason to return them by reference.
<rdar://problem/85568435>
Created attachment 444741 [details] [fast-cq] proposed patch.
Comment on attachment 444741 [details] [fast-cq] proposed patch. r=me
Comment on attachment 444741 [details] [fast-cq] proposed patch. Thanks for the review.
Committed r286033 (244421@main): <https://commits.webkit.org/244421@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 444741 [details].
Comment on attachment 444741 [details] [fast-cq] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=444741&action=review > Source/JavaScriptCore/heap/BlockDirectory.h:77 > + const CellAttributes attributes() const { return m_attributes; } The const here in "const CellAttributes" doesn't provide much value, and should be removed. Same in all the other sites below. When returning a scalar, specifying const has almost no effect. We don’t label functions that return an int as returning a "const int". > Source/JavaScriptCore/heap/MarkedBlock.h:350 > + const CellAttributes attributes() const; Ditto.
(In reply to Darin Adler from comment #6) > Comment on attachment 444741 [details] > [fast-cq] proposed patch. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=444741&action=review > > > Source/JavaScriptCore/heap/BlockDirectory.h:77 > > + const CellAttributes attributes() const { return m_attributes; } > > The const here in "const CellAttributes" doesn't provide much value, and > should be removed. Same in all the other sites below. When returning a > scalar, specifying const has almost no effect. We don’t label functions that > return an int as returning a "const int". > > > Source/JavaScriptCore/heap/MarkedBlock.h:350 > > + const CellAttributes attributes() const; > > Ditto. I'll take care of this in an upcoming patch.
(In reply to Mark Lam from comment #7) > (In reply to Darin Adler from comment #6) > > > Source/JavaScriptCore/heap/BlockDirectory.h:77 > > > + const CellAttributes attributes() const { return m_attributes; } > > > > The const here in "const CellAttributes" doesn't provide much value, and > > should be removed. Same in all the other sites below. When returning a > > scalar, specifying const has almost no effect. We don’t label functions that > > return an int as returning a "const int". > > I'll take care of this in an upcoming patch. Fixing this in https://bugs.webkit.org/show_bug.cgi?id=233341.