Bug 233918

Summary: [JSC] Introduce WriteBarrierStructureID
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ashvayka, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 233959    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch mark.lam: review+

Description Yusuke Suzuki 2021-12-07 01:39:29 PST
[JSC] Introduce WriteBarrierStructureID
Comment 1 Yusuke Suzuki 2021-12-07 08:52:18 PST
Created attachment 446178 [details]
Patch
Comment 2 Yusuke Suzuki 2021-12-07 17:11:49 PST
Created attachment 446259 [details]
Patch
Comment 3 Yusuke Suzuki 2021-12-07 17:28:10 PST
Created attachment 446262 [details]
Patch
Comment 4 Yusuke Suzuki 2021-12-07 17:42:59 PST
Created attachment 446270 [details]
Patch
Comment 5 Yusuke Suzuki 2021-12-07 18:20:35 PST
Created attachment 446273 [details]
Patch
Comment 6 Mark Lam 2021-12-08 01:08:41 PST
Comment on attachment 446273 [details]
Patch

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

r=me

> Source/JavaScriptCore/runtime/WriteBarrier.h:278
> +    // Should only be used by JSCell during early initialisation
> +    // when some basic types aren't yet completely instantiated

Why this comment?  In this patch, `setEarlyValue` looks more like a `setInternal` and can be made private.  Is this needed in code that is yet to come?

> Source/JavaScriptCore/runtime/WriteBarrier.h:283
> +        // Copy m_cell to a local to avoid multiple-read issues. (See <http://webkit.org/b/110854>)

/m_cell/m_structureID/

> Source/JavaScriptCore/runtime/WriteBarrier.h:313
> +        m_structureID = StructureID { };

Do we need the `StructureID` here?  Wouldn't it be implied by the type of m_structureID?

> Source/JavaScriptCore/runtime/WriteBarrier.h:332
> +            m_structureID = StructureID { };

Ditto.

> Source/JavaScriptCore/runtime/WriteBarrierInlines.h:82
> +        m_structureID = StructureID { };

Ditto.
Comment 7 Yusuke Suzuki 2021-12-08 11:04:58 PST
Comment on attachment 446273 [details]
Patch

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

>> Source/JavaScriptCore/runtime/WriteBarrier.h:278
>> +    // when some basic types aren't yet completely instantiated
> 
> Why this comment?  In this patch, `setEarlyValue` looks more like a `setInternal` and can be made private.  Is this needed in code that is yet to come?

Because it is aligned to WriteBarrier<JSCell>, so same methods and same comments are prepared. So, we should use setEarlyValue to align it to WriteBarrier<>.

>> Source/JavaScriptCore/runtime/WriteBarrier.h:283
>> +        // Copy m_cell to a local to avoid multiple-read issues. (See <http://webkit.org/b/110854>)
> 
> /m_cell/m_structureID/

Changed.

>> Source/JavaScriptCore/runtime/WriteBarrier.h:313
>> +        m_structureID = StructureID { };
> 
> Do we need the `StructureID` here?  Wouldn't it be implied by the type of m_structureID?

Dropped.

>> Source/JavaScriptCore/runtime/WriteBarrier.h:332
>> +            m_structureID = StructureID { };
> 
> Ditto.

Ditto.

>> Source/JavaScriptCore/runtime/WriteBarrierInlines.h:82
>> +        m_structureID = StructureID { };
> 
> Ditto.

Ditto.
Comment 8 Yusuke Suzuki 2021-12-08 11:11:57 PST
Committed r286667 (244975@trunk): <https://commits.webkit.org/244975@trunk>
Comment 9 Radar WebKit Bug Importer 2021-12-08 11:12:22 PST
<rdar://problem/86220662>