Bug 165247 - Refactor SymbolImpl layout
Summary: Refactor SymbolImpl layout
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-01 00:47 PST by Yusuke Suzuki
Modified: 2019-02-02 06:38 PST (History)
3 users (show)

See Also:


Attachments
Patch (31.26 KB, patch)
2016-12-01 03:45 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (31.07 KB, patch)
2016-12-01 03:50 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (31.08 KB, patch)
2016-12-01 03:52 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (31.84 KB, patch)
2016-12-01 05:24 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (31.85 KB, patch)
2016-12-01 05:29 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (31.23 KB, patch)
2016-12-01 05:36 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (31.23 KB, patch)
2016-12-01 05:40 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (31.17 KB, patch)
2016-12-01 05:54 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews114 for mac-yosemite (313.90 KB, application/zip)
2016-12-01 06:59 PST, Build Bot
no flags Details
Patch (31.11 KB, patch)
2016-12-01 20:52 PST, 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 2016-12-01 00:47:27 PST
Let's put field in SymbolImpl. And add a flag for Null symbol (`Symbol()`).
Comment 1 Yusuke Suzuki 2016-12-01 03:45:53 PST
Created attachment 295830 [details]
Patch
Comment 2 WebKit Commit Bot 2016-12-01 03:48:19 PST
Attachment 295830 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:39:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:40:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:41:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Yusuke Suzuki 2016-12-01 03:50:52 PST
Created attachment 295831 [details]
Patch
Comment 4 Yusuke Suzuki 2016-12-01 03:52:08 PST
Created attachment 295832 [details]
Patch
Comment 5 WebKit Commit Bot 2016-12-01 03:53:20 PST
Attachment 295832 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:39:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:40:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:41:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Yusuke Suzuki 2016-12-01 05:24:23 PST
Created attachment 295836 [details]
Patch
Comment 7 WebKit Commit Bot 2016-12-01 05:25:40 PST
Attachment 295836 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:39:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:40:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:41:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Yusuke Suzuki 2016-12-01 05:29:45 PST
Created attachment 295837 [details]
Patch
Comment 9 WebKit Commit Bot 2016-12-01 05:32:29 PST
Attachment 295837 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:39:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:40:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:41:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Yusuke Suzuki 2016-12-01 05:36:25 PST
Created attachment 295838 [details]
Patch
Comment 11 WebKit Commit Bot 2016-12-01 05:39:20 PST
Attachment 295838 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:39:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:40:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:41:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Yusuke Suzuki 2016-12-01 05:40:54 PST
Created attachment 295839 [details]
Patch
Comment 13 WebKit Commit Bot 2016-12-01 05:42:26 PST
Attachment 295839 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:39:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:40:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:41:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 Yusuke Suzuki 2016-12-01 05:54:31 PST
Created attachment 295840 [details]
Patch
Comment 15 WebKit Commit Bot 2016-12-01 05:57:14 PST
Attachment 295840 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:39:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:40:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:41:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 16 Build Bot 2016-12-01 06:59:46 PST
Comment on attachment 295840 [details]
Patch

Attachment 295840 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2601095

Number of test failures exceeded the failure limit.
Comment 17 Build Bot 2016-12-01 06:59:50 PST
Created attachment 295848 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 18 Yusuke Suzuki 2016-12-01 20:52:28 PST
Created attachment 295927 [details]
Patch
Comment 19 WebKit Commit Bot 2016-12-01 20:54:03 PST
Attachment 295927 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:39:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:40:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WTF/wtf/text/UniquedStringImpl.h:41:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 20 Yusuke Suzuki 2016-12-02 02:19:41 PST
And this also paves the way for static SymbolImpl.
Comment 21 Darin Adler 2016-12-02 09:35:01 PST
Comment on attachment 295927 [details]
Patch

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

> Source/WTF/wtf/text/StringImpl.cpp:118
> +        SymbolImpl& symbol = static_cast<SymbolImpl&>(*this);

I would use auto& here.

> Source/WTF/wtf/text/StringImpl.cpp:120
> +        if (symbol.symbolRegistry())
> +            symbol.symbolRegistry()->remove(symbol);

I typically would put this into a scoped local variable, but not everyone agrees and I think it’s likely that the generated code will be identical.

> Source/WTF/wtf/text/StringImpl.h:732
> +    enum CreateSymbolTag { CreateSymbol };
> +    // Used to create new symbol strings that holds existing 8-bit [[Description]] string as a substring buffer (BufferSubstring).

I suggest a blank line here after the enum.

> Source/WTF/wtf/text/SymbolImpl.cpp:56
> +    return adoptRef(*new SymbolImpl());

No need for () here after SymbolImpl.

> Source/WTF/wtf/text/SymbolImpl.h:109
> +}
> +
> +
> +
>  #if !ASSERT_DISABLED

Should just have one blank line, not three.
Comment 22 Yusuke Suzuki 2016-12-03 16:29:16 PST
Comment on attachment 295927 [details]
Patch

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

>> Source/WTF/wtf/text/StringImpl.cpp:118
>> +        SymbolImpl& symbol = static_cast<SymbolImpl&>(*this);
> 
> I would use auto& here.

Fixed.

>> Source/WTF/wtf/text/StringImpl.cpp:120
>> +            symbol.symbolRegistry()->remove(symbol);
> 
> I typically would put this into a scoped local variable, but not everyone agrees and I think it’s likely that the generated code will be identical.

OK, i'll change this to `auto* symbolRegistry = symbol.symbolRegistry()`.

>> Source/WTF/wtf/text/StringImpl.h:732
>> +    // Used to create new symbol strings that holds existing 8-bit [[Description]] string as a substring buffer (BufferSubstring).
> 
> I suggest a blank line here after the enum.

Inserted.

>> Source/WTF/wtf/text/SymbolImpl.cpp:56
>> +    return adoptRef(*new SymbolImpl());
> 
> No need for () here after SymbolImpl.

Dropped.

>> Source/WTF/wtf/text/SymbolImpl.h:109
>>  #if !ASSERT_DISABLED
> 
> Should just have one blank line, not three.

Ooops. Fixed.
Comment 23 Yusuke Suzuki 2016-12-03 16:30:01 PST
Committed r209309: <http://trac.webkit.org/changeset/209309>