ItemBuffer::append() allocates a static buffer whose size = sizeof(DisplayList::Item) + uint64_t for the DisplayList::ItemType. But this static buffer is of type uint8_t. So this array should be aligned to the alignment of a single uint8_t which is 1. The expectation is to have this buffer aligned to 8 bytes so all each member in the encoded DisplayList::Item can be aligned to its alignment requirement. This was caught on Apple Silicon when trying to enable GPU rendering for 2D canvas for layout tests. See https://build.webkit.org/#/builders/103/builds/88. But the same assertion fires if the same page is just opened in mini browser while GPU rendering for 2D canvas is enabled.
Created attachment 422983 [details] Patch
Comment on attachment 422983 [details] Patch I think modern C++ has a nicer explicit feature to just say the alignment you want. alignas, maybe?
Created attachment 422987 [details] Patch
Created attachment 422998 [details] Patch
Created attachment 423002 [details] Patch
Created attachment 423004 [details] Patch
commit-queue failed to commit attachment 423004 [details] to WebKit repository. To retry, please set cq+ flag again.
Created attachment 423012 [details] Patch
Committed r274326: <https://commits.webkit.org/r274326> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423012 [details].
<rdar://problem/75348461>