Bug 213155 - [JSC] el(Greek) characters' upper-case conversion is locale-sensitive
Summary: [JSC] el(Greek) characters' upper-case conversion is locale-sensitive
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: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-12 16:34 PDT by Yusuke Suzuki
Modified: 2020-06-12 18:15 PDT (History)
9 users (show)

See Also:


Attachments
Patch (5.07 KB, patch)
2020-06-12 16:37 PDT, Yusuke Suzuki
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2020-06-12 16:34:05 PDT
[JSC] el(Greek) characters' upper-case conversion is locale-sensitive
Comment 1 Yusuke Suzuki 2020-06-12 16:37:31 PDT
Created attachment 401801 [details]
Patch
Comment 2 Yusuke Suzuki 2020-06-12 16:37:34 PDT
<rdar://problem/55018467>
Comment 3 Darin Adler 2020-06-12 16:43:09 PDT
Comment on attachment 401801 [details]
Patch

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

> Source/JavaScriptCore/runtime/StringPrototype.cpp:1586
> +    const HashSet<String> availableLocales({ "az"_s, "el"_s , "lt"_s, "tr"_s });

Seems that our implementation is far too literal. Making a HashSet here seems so inefficient. And repeating this information here instead of getting it from ICU also seems weak.

Anyway, not a comment about this patch, I suppose.
Comment 4 Yusuke Suzuki 2020-06-12 17:23:07 PDT
Comment on attachment 401801 [details]
Patch

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

>> Source/JavaScriptCore/runtime/StringPrototype.cpp:1586
>> +    const HashSet<String> availableLocales({ "az"_s, "el"_s , "lt"_s, "tr"_s });
> 
> Seems that our implementation is far too literal. Making a HashSet here seems so inefficient. And repeating this information here instead of getting it from ICU also seems weak.
> 
> Anyway, not a comment about this patch, I suppose.

Yeah, for HashSet thing, I think just iterating with array is better since each string is so small & there is only 4 elements. Maybe that is faster. Changed.
Comment 5 Darin Adler 2020-06-12 17:23:48 PDT
Comment on attachment 401801 [details]
Patch

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

>>> Source/JavaScriptCore/runtime/StringPrototype.cpp:1586
>>> +    const HashSet<String> availableLocales({ "az"_s, "el"_s , "lt"_s, "tr"_s });
>> 
>> Seems that our implementation is far too literal. Making a HashSet here seems so inefficient. And repeating this information here instead of getting it from ICU also seems weak.
>> 
>> Anyway, not a comment about this patch, I suppose.
> 
> Yeah, for HashSet thing, I think just iterating with array is better since each string is so small & there is only 4 elements. Maybe that is faster. Changed.

Yes and it can be an array of const char* or ASCIILiteral.
Comment 6 Yusuke Suzuki 2020-06-12 17:24:09 PDT
Comment on attachment 401801 [details]
Patch

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

>>> Source/JavaScriptCore/runtime/StringPrototype.cpp:1586
>>> +    const HashSet<String> availableLocales({ "az"_s, "el"_s , "lt"_s, "tr"_s });
>> 
>> Seems that our implementation is far too literal. Making a HashSet here seems so inefficient. And repeating this information here instead of getting it from ICU also seems weak.
>> 
>> Anyway, not a comment about this patch, I suppose.
> 
> Yeah, for HashSet thing, I think just iterating with array is better since each string is so small & there is only 4 elements. Maybe that is faster. Changed.

Ah, but for now, I leave it since availableLocales code relies on HashSet and availableLocales is used by the other places.
Comment 7 Yusuke Suzuki 2020-06-12 17:24:34 PDT
Comment on attachment 401801 [details]
Patch

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

>>>>> Source/JavaScriptCore/runtime/StringPrototype.cpp:1586
>>>>> +    const HashSet<String> availableLocales({ "az"_s, "el"_s , "lt"_s, "tr"_s });
>>>> 
>>>> Seems that our implementation is far too literal. Making a HashSet here seems so inefficient. And repeating this information here instead of getting it from ICU also seems weak.
>>>> 
>>>> Anyway, not a comment about this patch, I suppose.
>>> 
>>> Yeah, for HashSet thing, I think just iterating with array is better since each string is so small & there is only 4 elements. Maybe that is faster. Changed.
>> 
>> Yes and it can be an array of const char* or ASCIILiteral.
> 
> Ah, but for now, I leave it since availableLocales code relies on HashSet and availableLocales is used by the other places.

I'll file a bug for this.
Comment 8 Darin Adler 2020-06-12 17:24:55 PDT
Comment on attachment 401801 [details]
Patch

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

>>>>> Source/JavaScriptCore/runtime/StringPrototype.cpp:1586
>>>>> +    const HashSet<String> availableLocales({ "az"_s, "el"_s , "lt"_s, "tr"_s });
>>>> 
>>>> Seems that our implementation is far too literal. Making a HashSet here seems so inefficient. And repeating this information here instead of getting it from ICU also seems weak.
>>>> 
>>>> Anyway, not a comment about this patch, I suppose.
>>> 
>>> Yeah, for HashSet thing, I think just iterating with array is better since each string is so small & there is only 4 elements. Maybe that is faster. Changed.
>> 
>> Yes and it can be an array of const char* or ASCIILiteral.
> 
> Ah, but for now, I leave it since availableLocales code relies on HashSet and availableLocales is used by the other places.

Yes, no pressure to do it right now. Just a little concerned that we aren’t making judicious choices about algorithms.
Comment 9 Yusuke Suzuki 2020-06-12 17:26:19 PDT
Comment on attachment 401801 [details]
Patch

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

>>>>>>> Source/JavaScriptCore/runtime/StringPrototype.cpp:1586
>>>>>>> +    const HashSet<String> availableLocales({ "az"_s, "el"_s , "lt"_s, "tr"_s });
>>>>>> 
>>>>>> Seems that our implementation is far too literal. Making a HashSet here seems so inefficient. And repeating this information here instead of getting it from ICU also seems weak.
>>>>>> 
>>>>>> Anyway, not a comment about this patch, I suppose.
>>>>> 
>>>>> Yeah, for HashSet thing, I think just iterating with array is better since each string is so small & there is only 4 elements. Maybe that is faster. Changed.
>>>> 
>>>> Yes and it can be an array of const char* or ASCIILiteral.
>>> 
>>> Ah, but for now, I leave it since availableLocales code relies on HashSet and availableLocales is used by the other places.
>> 
>> I'll file a bug for this.
> 
> Yes, no pressure to do it right now. Just a little concerned that we aren’t making judicious choices about algorithms.

Right. Filed in https://bugs.webkit.org/show_bug.cgi?id=213158
Comment 10 Yusuke Suzuki 2020-06-12 17:26:40 PDT
Comment on attachment 401801 [details]
Patch

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

>>>>>>>> Source/JavaScriptCore/runtime/StringPrototype.cpp:1586
>>>>>>>> +    const HashSet<String> availableLocales({ "az"_s, "el"_s , "lt"_s, "tr"_s });
>>>>>>> 
>>>>>>> Seems that our implementation is far too literal. Making a HashSet here seems so inefficient. And repeating this information here instead of getting it from ICU also seems weak.
>>>>>>> 
>>>>>>> Anyway, not a comment about this patch, I suppose.
>>>>>> 
>>>>>> Yeah, for HashSet thing, I think just iterating with array is better since each string is so small & there is only 4 elements. Maybe that is faster. Changed.
>>>>> 
>>>>> Yes and it can be an array of const char* or ASCIILiteral.
>>>> 
>>>> Ah, but for now, I leave it since availableLocales code relies on HashSet and availableLocales is used by the other places.
>>> 
>>> I'll file a bug for this.
>> 
>> Yes, no pressure to do it right now. Just a little concerned that we aren’t making judicious choices about algorithms.
> 
> Right. Filed in https://bugs.webkit.org/show_bug.cgi?id=213158

And I'll put FIXME with https://bugs.webkit.org/show_bug.cgi?id=213158
Comment 11 Yusuke Suzuki 2020-06-12 18:09:52 PDT
webaudio/webaudio-gc.html in mac-debug-wk1 is unrelated. Landing.
Comment 12 Yusuke Suzuki 2020-06-12 18:15:27 PDT
Committed r262992: <https://trac.webkit.org/changeset/262992>