WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
208404
[JSC] BuiltinNames' HashMap should be small
https://bugs.webkit.org/show_bug.cgi?id=208404
Summary
[JSC] BuiltinNames' HashMap should be small
Yusuke Suzuki
Reported
2020-02-28 21:58:22 PST
[JSC] BuiltinNames' HashMap should be small
Attachments
Patch
(41.02 KB, patch)
2020-02-28 22:18 PST
,
Yusuke Suzuki
mark.lam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2020-02-28 22:18:54 PST
Created
attachment 392049
[details]
Patch
Mark Lam
Comment 2
2020-02-28 23:51:14 PST
Comment on
attachment 392049
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=392049&action=review
Nice work. r=me
> Source/JavaScriptCore/ChangeLog:8 > + This patch makes public-to-private-name-map from HashMap<RefPtr<UniquedStringImpl>, SymbolImpl*> to HashSet<String> to save half of memory.
/makes/converts/.
> Source/JavaScriptCore/builtins/BuiltinNames.cpp:66 > #define INITIALIZE_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY(name) \
nit: can we rename this to INITIALIZE_WELL_KNOWN_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY? I think this make its purpose clearer.
> Source/JavaScriptCore/builtins/BuiltinNames.h:239 > #ifndef NDEBUG
Let's change this to #if ASSERT_ENABLED
> Source/JavaScriptCore/builtins/BuiltinNames.h:252 > + UNUSED_PARAM(publicName); > + ASSERT(String(publicName.impl()) == String(privateName.impl()));
You can just use ASSERT_UNUSED(publicName, publicName.impl()) == String(privateName.impl()));
> Source/JavaScriptCore/runtime/CachedTypes.cpp:715 > + impl = symbol->substring(strlen("Symbol."));
Will the compiler fold strlen("Symbol.") into a constant? If not, then maybe we should express this as: constexpr char symbolPrefix = "Symbol."; constexpr size_t symbolPrefixLength = sizeof(symbolPrefix); impl = symbol->substring(symbolPrefixLength);
Yusuke Suzuki
Comment 3
2020-02-28 23:57:47 PST
Comment on
attachment 392049
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=392049&action=review
Thanks!
>> Source/JavaScriptCore/ChangeLog:8 >> + This patch makes public-to-private-name-map from HashMap<RefPtr<UniquedStringImpl>, SymbolImpl*> to HashSet<String> to save half of memory. > > /makes/converts/.
Fixed.
>> Source/JavaScriptCore/builtins/BuiltinNames.cpp:66 >> #define INITIALIZE_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY(name) \ > > nit: can we rename this to INITIALIZE_WELL_KNOWN_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY? I think this make its purpose clearer.
Fixed.
>> Source/JavaScriptCore/builtins/BuiltinNames.h:239 >> #ifndef NDEBUG > > Let's change this to #if ASSERT_ENABLED
Fixed.
>> Source/JavaScriptCore/builtins/BuiltinNames.h:252 >> + ASSERT(String(publicName.impl()) == String(privateName.impl())); > > You can just use ASSERT_UNUSED(publicName, publicName.impl()) == String(privateName.impl()));
Fixed.
>> Source/JavaScriptCore/runtime/CachedTypes.cpp:715 >> + impl = symbol->substring(strlen("Symbol.")); > > Will the compiler fold strlen("Symbol.") into a constant? If not, then maybe we should express this as: > constexpr char symbolPrefix = "Symbol."; > constexpr size_t symbolPrefixLength = sizeof(symbolPrefix); > impl = symbol->substring(symbolPrefixLength);
Yes, typical compiler folds it into a constant.
Yusuke Suzuki
Comment 4
2020-02-29 00:04:19 PST
Committed
r257681
: <
https://trac.webkit.org/changeset/257681
>
Radar WebKit Bug Importer
Comment 5
2020-02-29 00:05:13 PST
<
rdar://problem/59915238
>
Yusuke Suzuki
Comment 6
2020-03-02 10:53:45 PST
Committed
r257719
: <
https://trac.webkit.org/changeset/257719
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug