Skip to content

Commit

Permalink
Restore exact BitsInIncreasingOrder check in generated serializers
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=259792
rdar://113352975

Reviewed by Dean Jackson.

266549@main shifted things around to fix the visionOS build, but it relaxed an important order check.

* Source/WebKit/Scripts/generate-serializers.py:
(generate_impl):
* Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.cpp:
* Source/WebKit/Shared/RemoteLayerTree/LayerProperties.h:

Canonical link: https://commits.webkit.org/266553@main
  • Loading branch information
achristensen07 committed Aug 3, 2023
1 parent cf2caed commit 01cc4e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Source/WebKit/Scripts/generate-serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ def generate_impl(serialized_types, serialized_enums, headers, generating_webkit
result.append(' static constexpr bool value = true;')
result.append('};')
result.append('template<uint64_t firstBit, uint64_t secondBit, uint64_t... remainingBits> struct BitsInIncreasingOrder<firstBit, secondBit, remainingBits...> {')
result.append(' static constexpr bool value = firstBit < secondBit && BitsInIncreasingOrder<secondBit, remainingBits...>::value;')
result.append(' static constexpr bool value = firstBit == secondBit >> 1 && BitsInIncreasingOrder<secondBit, remainingBits...>::value;')
result.append('};')
result.append('')
result.append('template<bool, bool> struct VirtualTableAndRefCountOverhead;')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ template<uint64_t onlyBit> struct BitsInIncreasingOrder<onlyBit> {
static constexpr bool value = true;
};
template<uint64_t firstBit, uint64_t secondBit, uint64_t... remainingBits> struct BitsInIncreasingOrder<firstBit, secondBit, remainingBits...> {
static constexpr bool value = firstBit < secondBit && BitsInIncreasingOrder<secondBit, remainingBits...>::value;
static constexpr bool value = firstBit == secondBit >> 1 && BitsInIncreasingOrder<secondBit, remainingBits...>::value;
};

template<bool, bool> struct VirtualTableAndRefCountOverhead;
Expand Down
8 changes: 4 additions & 4 deletions Source/WebKit/Shared/RemoteLayerTree/LayerProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ enum class LayerChange : uint64_t {
ScrollingNodeIDChanged = 1LLU << 39,
#endif
#if HAVE(CORE_ANIMATION_SEPARATED_LAYERS)
SeparatedChanged = 1LLU << 40,
SeparatedChanged = 1LLU << 39,
#if HAVE(CORE_ANIMATION_SEPARATED_PORTALS)
SeparatedPortalChanged = 1LLU << 41,
DescendentOfSeparatedPortalChanged = 1LLU << 42,
SeparatedPortalChanged = 1LLU << 40,
DescendentOfSeparatedPortalChanged = 1LLU << 41,
#endif
#endif
#if ENABLE(INTERACTION_REGIONS_IN_EVENT_REGION)
CoverageRectChanged = 1LLU << 43,
CoverageRectChanged = 1LLU << 42,
#endif
};

Expand Down

0 comments on commit 01cc4e8

Please sign in to comment.