Bug 223481 - WebCore::ThreadGlobalData should not initialize fields eagerly
Summary: WebCore::ThreadGlobalData should not initialize fields eagerly
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: 2021-03-18 14:37 PDT by Yusuke Suzuki
Modified: 2021-03-19 00:54 PDT (History)
5 users (show)

See Also:


Attachments
Patch (7.25 KB, patch)
2021-03-18 14:40 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2021-03-18 14:37:57 PDT
WebCore::ThreadGlobalData should not initialize fields eagerly
Comment 1 Yusuke Suzuki 2021-03-18 14:40:15 PDT
Created attachment 423660 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2021-03-18 14:41:23 PDT
<rdar://problem/75591436>
Comment 3 Chris Dumez 2021-03-18 14:57:37 PDT
Comment on attachment 423660 [details]
Patch

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

> Source/WebCore/platform/ThreadGlobalData.cpp:118
> +void ThreadGlobalData::initializeCachedResourceRequestInitiators()

Why the separate initialize*() functions? Seems we could inline all those.
Comment 4 Yusuke Suzuki 2021-03-18 14:59:47 PDT
Comment on attachment 423660 [details]
Patch

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

>> Source/WebCore/platform/ThreadGlobalData.cpp:118
>> +void ThreadGlobalData::initializeCachedResourceRequestInitiators()
> 
> Why the separate initialize*() functions? Seems we could inline all those.

Because this should be executed rarely, I've extracted it from inlined part of the function.
Comment 5 Yusuke Suzuki 2021-03-18 15:00:27 PDT
Comment on attachment 423660 [details]
Patch

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

>>> Source/WebCore/platform/ThreadGlobalData.cpp:118
>>> +void ThreadGlobalData::initializeCachedResourceRequestInitiators()
>> 
>> Why the separate initialize*() functions? Seems we could inline all those.
> 
> Because this should be executed rarely, I've extracted it from inlined part of the function.

This also allows us not to include CachedResourceRequestInitiators.h EventNames.h QualifiedNameCache.h etc. in the header side.
Comment 6 Chris Dumez 2021-03-18 15:02:26 PDT
Comment on attachment 423660 [details]
Patch

OK
Comment 7 EWS 2021-03-19 00:54:46 PDT
Committed r274705: <https://commits.webkit.org/r274705>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 423660 [details].