Bug 225080

Summary: UnlinkedCodeBlock should have better accounting for extra memory
Product: WebKit Reporter: Keith Miller <keith_miller>
Component: New BugsAssignee: Keith Miller <keith_miller>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Keith Miller 2021-04-26 16:28:23 PDT
UnlinkedCodeBlock should have better accounting for extra memory
Comment 1 Keith Miller 2021-04-26 16:30:30 PDT
Created attachment 427101 [details]
Patch
Comment 2 Mark Lam 2021-04-26 16:33:09 PDT
Comment on attachment 427101 [details]
Patch

r=me
Comment 3 Yusuke Suzuki 2021-04-26 16:34:05 PDT
Comment on attachment 427101 [details]
Patch

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

> Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp:119
> +size_t UnlinkedCodeBlock::RareData::sizeInBytes() const

Let's take a locker parameter to ensure that this is accessed while taking a lock.
Comment 4 Yusuke Suzuki 2021-04-26 16:35:29 PDT
Comment on attachment 427101 [details]
Patch

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

>> Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp:119
>> +size_t UnlinkedCodeBlock::RareData::sizeInBytes() const
> 
> Let's take a locker parameter to ensure that this is accessed while taking a lock.

And can you ensure that these fields are initialized while taking a lock?
Comment 5 Keith Miller 2021-04-26 16:49:48 PDT
Comment on attachment 427101 [details]
Patch

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

>>> Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp:119
>>> +size_t UnlinkedCodeBlock::RareData::sizeInBytes() const
>> 
>> Let's take a locker parameter to ensure that this is accessed while taking a lock.
> 
> And can you ensure that these fields are initialized while taking a lock?

Done, and it did look like there were a few places where the initializer was not holding the lock... I fixed those.
Comment 6 Keith Miller 2021-04-26 16:50:16 PDT
Created attachment 427105 [details]
Patch for landing
Comment 7 EWS 2021-04-26 18:10:07 PDT
Committed r276625 (237053@main): <https://commits.webkit.org/237053@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427105 [details].
Comment 8 Radar WebKit Bug Importer 2021-04-26 18:11:20 PDT
<rdar://problem/77185832>