Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d583cf1b5117746c0c7bbf50169f8679b103f7ea
https://github.com/WebKit/WebKit/commit/d583cf1b5117746c0c7bbf50169f8679b103f7ea
Author: Ahmad Saleem <[email protected]>
Date: 2026-07-31 (Fri, 31 Jul 2026)
Changed paths:
M Source/WebCore/dom/ViewportArguments.cpp
M Source/WebCore/dom/ViewportArguments.h
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
Log Message:
-----------
Reduce sizeof(ViewportArguments) and stop copying it into
computeViewportAttributes()
https://bugs.webkit.org/show_bug.cgi?id=320730
rdar://183715116
Reviewed by Jessica Cheung.
ViewportArguments declares its 1-byte Type member ahead of eight floats, so the
compiler inserts 3 bytes of padding after it, and the three trailing 1-byte
members leave another byte of tail padding: sizeof() is 40 where 36 would do.
Move `type` down beside the other small members so all four pack into the final
word.
Two things have to move with it. The generated IPC code asserts that the member
order in the .serialization.in description matches the declaration order -- see
the ShouldBeSameSizeAs and IsIncreasing static_asserts emitted by
Scripts/generate-serializers.py -- so the description is reordered to match. The
generated decoder also constructs the struct positionally, so the 12-argument
constructor, which has no callers other than that decoder, takes `type` in its
new position.
Also stop passing ViewportArguments to computeViewportAttributes() by value. It
is only read there, through the const resolve(), so a const reference is both
cheaper and a more honest signature.
No change in behavior.
* Source/WebCore/dom/ViewportArguments.cpp:
(WebCore::computeViewportAttributes):
* Source/WebCore/dom/ViewportArguments.h:
(WebCore::ViewportArguments::ViewportArguments):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
Canonical link: https://commits.webkit.org/318335@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications