Skip to content

Commit 1424f06

Browse files
committed
Rename LChar to Latin1Character
rdar://161048219 https://bugs.webkit.org/show_bug.cgi?id=299254 Reviewed by Sam Weinig. * Source/WTF/wtf/text/Latin1Character.h: Renamed from Source/WTF/wtf/text/LChar.h. Also removed "using LChar =" lines and all the FIXMEs. * Tools/Scripts/do-webcore-rename: Updated the script so it only skips our copy of icu, not our icu directories. And updated the "things to rename" to rename LChar. * <many files>: Let the do-webcore-rename script do its thing! Canonical link: https://commits.webkit.org/300302@main
1 parent 93d3de0 commit 1424f06

216 files changed

Lines changed: 849 additions & 845 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Source/JavaScriptCore/API/JSStringRefCF.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ JSStringRef JSStringCreateWithCFString(CFStringRef string)
4545
if (!length)
4646
return &OpaqueJSString::create(""_span8).leakRef();
4747

48-
Vector<LChar, 1024> lcharBuffer(length);
48+
Vector<Latin1Character, 1024> lcharBuffer(length);
4949
CFIndex usedBufferLength;
5050
CFIndex convertedSize = CFStringGetBytes(string, CFRangeMake(0, length), kCFStringEncodingISOLatin1, 0, false, byteCast<UInt8>(lcharBuffer.mutableSpan().data()), length, &usedBufferLength);
5151
if (static_cast<size_t>(convertedSize) == length && static_cast<size_t>(usedBufferLength) == length)

‎Source/JavaScriptCore/API/JSValueRef.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ JSValueRef JSValueMakeFromJSONString(JSContextRef ctx, JSStringRef string)
697697
JSLockHolder locker(globalObject);
698698
String str = string->string();
699699
if (str.is8Bit()) {
700-
LiteralParser<LChar, JSONReviverMode::Disabled> parser(globalObject, str.span8(), StrictJSON);
700+
LiteralParser<Latin1Character, JSONReviverMode::Disabled> parser(globalObject, str.span8(), StrictJSON);
701701
return toRef(globalObject, parser.tryLiteralParse());
702702
}
703703
LiteralParser<char16_t, JSONReviverMode::Disabled> parser(globalObject, str.span16(), StrictJSON);

‎Source/JavaScriptCore/API/OpaqueJSString.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
4040
return adoptRef(*new OpaqueJSString);
4141
}
4242

43-
static Ref<OpaqueJSString> create(std::span<const LChar> characters)
43+
static Ref<OpaqueJSString> create(std::span<const Latin1Character> characters)
4444
{
4545
return adoptRef(*new OpaqueJSString(characters));
4646
}
@@ -56,7 +56,7 @@ struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
5656
JS_EXPORT_PRIVATE ~OpaqueJSString();
5757

5858
bool is8Bit() { return m_string.is8Bit(); }
59-
std::span<const LChar> span8() LIFETIME_BOUND { return m_string.span8(); }
59+
std::span<const Latin1Character> span8() LIFETIME_BOUND { return m_string.span8(); }
6060
std::span<const char16_t> span16() LIFETIME_BOUND { return m_string.span16(); }
6161
unsigned length() { return m_string.length(); }
6262

@@ -87,7 +87,7 @@ struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
8787
{
8888
}
8989

90-
OpaqueJSString(std::span<const LChar> characters)
90+
OpaqueJSString(std::span<const Latin1Character> characters)
9191
: m_string(characters)
9292
, m_characters(nullptr)
9393
{

‎Source/JavaScriptCore/API/glib/JSCValue.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,7 @@ JSCValue* jsc_value_new_from_json(JSCContext* context, const char* json)
20932093
JSC::JSValue jsValue;
20942094
String jsonString = String::fromUTF8(json);
20952095
if (jsonString.is8Bit()) {
2096-
JSC::LiteralParser<LChar, JSC::JSONReviverMode::Disabled> jsonParser(globalObject, jsonString.span8(), JSC::StrictJSON);
2096+
JSC::LiteralParser<Latin1Character, JSC::JSONReviverMode::Disabled> jsonParser(globalObject, jsonString.span8(), JSC::StrictJSON);
20972097
jsValue = jsonParser.tryLiteralParse();
20982098
if (!jsValue)
20992099
exception = toRef(JSC::createSyntaxError(globalObject, jsonParser.getErrorMessage()));

‎Source/JavaScriptCore/KeywordLookupGenerator.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def printAsC(self):
185185
print("")
186186
print("namespace JSC {")
187187
print("")
188-
print("static ALWAYS_INLINE bool cannotBeIdentPartOrEscapeStart(LChar);")
188+
print("static ALWAYS_INLINE bool cannotBeIdentPartOrEscapeStart(Latin1Character);")
189189
print("static ALWAYS_INLINE bool cannotBeIdentPartOrEscapeStart(char16_t);")
190190
# max length + 1 so we don't need to do any bounds checking at all
191191
print("static constexpr int maxTokenLength = %d;" % (self.maxLength() + 1))
@@ -201,11 +201,11 @@ def printAsC(self):
201201
print("}")
202202
print("")
203203
print("template <>")
204-
print("template <bool shouldCreateIdentifier> ALWAYS_INLINE JSTokenType Lexer<LChar>::parseKeyword(JSTokenData* data)")
204+
print("template <bool shouldCreateIdentifier> ALWAYS_INLINE JSTokenType Lexer<Latin1Character>::parseKeyword(JSTokenData* data)")
205205
print("{")
206206
print(" ASSERT(m_codeEnd - m_code >= maxTokenLength);")
207207
print("")
208-
print(" const LChar* code = m_code;")
208+
print(" const Latin1Character* code = m_code;")
209209
self.printSubTreeAsC("CHAR", 4)
210210
print(" return IDENT;")
211211
print("}")

‎Source/JavaScriptCore/Scripts/xxd.pl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@
4444
my $array = join(', ', @values);
4545

4646
open(my $output, '>', $outName) or die "Can't open file for write: $outName $!";
47-
print $output "#ifdef __cplusplus\n#include <array>\n#include <wtf/text/LChar.h>\nstatic constexpr std::array<Latin1Character, $size> $arrayName\n#else\nstatic const unsigned char ${arrayName}[] =\n#endif\n{\n$array\n};\n";
47+
print $output "#ifdef __cplusplus\n#include <array>\n#include <wtf/text/Latin1Character.h>\nstatic constexpr std::array<Latin1Character, $size> $arrayName\n#else\nstatic const unsigned char ${arrayName}[] =\n#endif\n{\n$array\n};\n";
4848
close($output);

‎Source/JavaScriptCore/builtins/BuiltinExecutables.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ UnlinkedFunctionExecutable* BuiltinExecutables::createExecutable(VM& vm, const S
128128
continue;
129129
} else if (characters[i] == ',')
130130
++commas;
131-
else if (!Lexer<LChar>::isWhiteSpace(characters[i]))
131+
else if (!Lexer<Latin1Character>::isWhiteSpace(characters[i]))
132132
sawOneParam = true;
133133

134134
if (i + 2 < view.length() && characters[i] == '.' && characters[i + 1] == '.' && characters[i + 2] == '.') {

‎Source/JavaScriptCore/builtins/BuiltinNames.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ BuiltinNames::BuiltinNames(VM& vm, CommonIdentifiers* commonIdentifiers)
9696
#undef INITIALIZE_WELL_KNOWN_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY
9797

9898

99-
using LCharBuffer = WTF::HashTranslatorCharBuffer<LChar>;
99+
using LCharBuffer = WTF::HashTranslatorCharBuffer<Latin1Character>;
100100
using UCharBuffer = WTF::HashTranslatorCharBuffer<char16_t>;
101101

102102
template<typename CharacterType>
@@ -135,7 +135,7 @@ static SymbolImpl* lookUpWellKnownSymbolImpl(const BuiltinNames::WellKnownSymbol
135135
return iterator->value;
136136
}
137137

138-
PrivateSymbolImpl* BuiltinNames::lookUpPrivateName(std::span<const LChar> characters) const
138+
PrivateSymbolImpl* BuiltinNames::lookUpPrivateName(std::span<const Latin1Character> characters) const
139139
{
140140
LCharBuffer buffer { characters };
141141
return lookUpPrivateNameImpl(m_privateNameSet, buffer);
@@ -157,7 +157,7 @@ PrivateSymbolImpl* BuiltinNames::lookUpPrivateName(const String& string) const
157157
return lookUpPrivateNameImpl(m_privateNameSet, buffer);
158158
}
159159

160-
SymbolImpl* BuiltinNames::lookUpWellKnownSymbol(std::span<const LChar> characters) const
160+
SymbolImpl* BuiltinNames::lookUpWellKnownSymbol(std::span<const Latin1Character> characters) const
161161
{
162162
LCharBuffer buffer { characters };
163163
return lookUpWellKnownSymbolImpl(m_wellKnownSymbolsMap, buffer);

‎Source/JavaScriptCore/builtins/BuiltinNames.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,12 @@ class BuiltinNames {
253253

254254
PrivateSymbolImpl* lookUpPrivateName(const Identifier&) const;
255255
PrivateSymbolImpl* lookUpPrivateName(const String&) const;
256-
PrivateSymbolImpl* lookUpPrivateName(std::span<const LChar>) const;
256+
PrivateSymbolImpl* lookUpPrivateName(std::span<const Latin1Character>) const;
257257
PrivateSymbolImpl* lookUpPrivateName(std::span<const char16_t>) const;
258258

259259
SymbolImpl* lookUpWellKnownSymbol(const Identifier&) const;
260260
SymbolImpl* lookUpWellKnownSymbol(const String&) const;
261-
SymbolImpl* lookUpWellKnownSymbol(std::span<const LChar>) const;
261+
SymbolImpl* lookUpWellKnownSymbol(std::span<const Latin1Character>) const;
262262
SymbolImpl* lookUpWellKnownSymbol(std::span<const char16_t>) const;
263263

264264
void appendExternalName(const Identifier& publicName, const Identifier& privateName);

‎Source/JavaScriptCore/bytecode/CodeBlockHash.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ template<> class StringTypeAdapter<JSC::CodeBlockHash> {
8989
template<typename CharacterType> void writeTo(std::span<CharacterType> destination) const
9090
{
9191
auto buffer = integerToSixCharacterHashString(m_hash.hash());
92-
StringImpl::copyCharacters(destination, std::span<const LChar>(std::bit_cast<const LChar*>(buffer.data()), buffer.size()));
92+
StringImpl::copyCharacters(destination, std::span<const Latin1Character>(std::bit_cast<const Latin1Character*>(buffer.data()), buffer.size()));
9393
}
9494

9595
private:

0 commit comments

Comments
 (0)