Bug 225080 - UnlinkedCodeBlock should have better accounting for extra memory
Summary: UnlinkedCodeBlock should have better accounting for extra memory
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: Keith Miller
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-26 16:28 PDT by Keith Miller
Modified: 2021-04-26 18:11 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.85 KB, patch)
2021-04-26 16:30 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch for landing (4.79 KB, patch)
2021-04-26 16:50 PDT, Keith Miller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>