Bug 213587 - [Intl] Disprefer using ICU enums directly as instance variables
Summary: [Intl] Disprefer using ICU enums directly as instance variables
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ross Kirsling
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-24 19:09 PDT by Ross Kirsling
Modified: 2020-06-25 17:02 PDT (History)
9 users (show)

See Also:


Attachments
Patch (9.05 KB, patch)
2020-06-24 19:11 PDT, Ross Kirsling
no flags Details | Formatted Diff | Diff
Patch for landing (9.33 KB, patch)
2020-06-24 19:32 PDT, Ross Kirsling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Kirsling 2020-06-24 19:09:44 PDT
[Intl] Disprefer using ICU enums directly as instance variables
Comment 1 Ross Kirsling 2020-06-24 19:11:12 PDT
Created attachment 402707 [details]
Patch
Comment 2 Ross Kirsling 2020-06-24 19:12:46 PDT
Here's the patch whether we choose to use it or not.

Either way, IntlPluralRules is 72 bytes (padding 6 → 9) and IntlRelativeTimeFormat is 56 bytes (padding 3 → 6).
Comment 3 Yusuke Suzuki 2020-06-24 19:27:31 PDT
Comment on attachment 402707 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=402707&action=review

r=me

> Source/JavaScriptCore/runtime/IntlPluralRules.h:83
> +    bool m_isOrdinal { false };

I think `enum class OrdinalType : uint8_t { Ordinal, Cardinal };` would be better.
Comment 4 Ross Kirsling 2020-06-24 19:32:50 PDT
Created attachment 402708 [details]
Patch for landing
Comment 5 EWS 2020-06-24 20:58:12 PDT
Committed r263497: <https://trac.webkit.org/changeset/263497>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 402708 [details].
Comment 6 Darin Adler 2020-06-25 12:33:40 PDT
Comment on attachment 402707 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=402707&action=review

>> Source/JavaScriptCore/runtime/IntlPluralRules.h:83
>> +    bool m_isOrdinal { false };
> 
> I think `enum class OrdinalType : uint8_t { Ordinal, Cardinal };` would be better.

Why not "enum class OrdinalType : bool { Cardinal, Ordinal };"?
Comment 7 Ross Kirsling 2020-06-25 12:37:16 PDT
(In reply to Darin Adler from comment #6)
> Comment on attachment 402707 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=402707&action=review
> 
> >> Source/JavaScriptCore/runtime/IntlPluralRules.h:83
> >> +    bool m_isOrdinal { false };
> > 
> > I think `enum class OrdinalType : uint8_t { Ordinal, Cardinal };` would be better.
> 
> Why not "enum class OrdinalType : bool { Cardinal, Ordinal };"?

I landed it as Type : bool.
Comment 8 Radar WebKit Bug Importer 2020-06-25 17:02:00 PDT
<rdar://problem/64781188>