Bug 207666 - CSSValuePool's constant CSS values should not be allocated dynamically (and same for Vectors)
Summary: CSSValuePool's constant CSS values should not be allocated dynamically (and s...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-12 14:42 PST by Yusuke Suzuki
Modified: 2020-02-12 17:11 PST (History)
8 users (show)

See Also:


Attachments
Patch (19.56 KB, patch)
2020-02-12 16:20 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (20.03 KB, patch)
2020-02-12 16:34 PST, Yusuke Suzuki
mark.lam: 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-02-12 14:42:12 PST
This causes memory regression.
Comment 1 Yusuke Suzuki 2020-02-12 14:43:35 PST
Let's introduce static CSSValues which can be shared by multiple threads, the concept is the same to StaticStringImpl.
Comment 2 Yusuke Suzuki 2020-02-12 14:44:54 PST
Further aggressive thing is like, encoding some of CSSValues into a pointer and using it as a value. But for now, let's just start fixing it.
Comment 3 Radar WebKit Bug Importer 2020-02-12 16:09:46 PST
<rdar://problem/59405553>
Comment 4 Yusuke Suzuki 2020-02-12 16:20:17 PST
Created attachment 390583 [details]
Patch
Comment 5 Yusuke Suzuki 2020-02-12 16:34:57 PST
Created attachment 390588 [details]
Patch
Comment 6 Mark Lam 2020-02-12 16:48:55 PST
Comment on attachment 390583 [details]
Patch

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

> Source/WebCore/css/CSSValue.h:68
> +        // Custoized deref() to ensure operator delete is called on

/Custoized/Customized/

> Source/WebCore/css/CSSValuePool.h:51
> +    friend class WTF::LazyNeverDestroyed<StaticCSSValuePool>;

The WTF qualifier here is not needed.
Comment 7 Mark Lam 2020-02-12 16:50:39 PST
Comment on attachment 390588 [details]
Patch

r=me with fixes for previously posted comments.
Comment 8 Yusuke Suzuki 2020-02-12 17:06:32 PST
Comment on attachment 390588 [details]
Patch

Thanks, fixed.
Comment 9 Yusuke Suzuki 2020-02-12 17:11:15 PST
Committed r256494: <https://trac.webkit.org/changeset/256494>