Bug 224593 - [JSC] Remove CodeBlock::RareData::m_catchProfiles
Summary: [JSC] Remove CodeBlock::RareData::m_catchProfiles
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: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-14 23:51 PDT by Yusuke Suzuki
Modified: 2021-04-19 22:01 PDT (History)
7 users (show)

See Also:


Attachments
Patch (10.38 KB, patch)
2021-04-14 23:53 PDT, 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 2021-04-14 23:51:21 PDT
[JSC] Remove CodeBlock::RareData::m_catchProfiles
Comment 1 Yusuke Suzuki 2021-04-14 23:53:29 PDT
Created attachment 426078 [details]
Patch
Comment 2 Mark Lam 2021-04-15 02:19:59 PDT
Comment on attachment 426078 [details]
Patch

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

Nice work.  r=me

> Source/JavaScriptCore/ChangeLog:10
> +        So we should just iterate metadata for that and destroy them in the destructor. Do not need to keep them separately.

/Do not need/No need/

> Source/JavaScriptCore/bytecode/ValueProfile.h:210
> +        return bitwise_cast<ValueProfileAndVirtualRegister*>(bitwise_cast<uint8_t*>(this) + sizeof(ValueProfileAndVirtualRegisterBuffer));

Would the following work?  It's shorter:
    return bitwise_cast<ValueProfileAndVirtualRegister*>(this + 1);
Comment 3 Yusuke Suzuki 2021-04-15 11:56:29 PDT
Comment on attachment 426078 [details]
Patch

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

>> Source/JavaScriptCore/ChangeLog:10
>> +        So we should just iterate metadata for that and destroy them in the destructor. Do not need to keep them separately.
> 
> /Do not need/No need/

Fixed.

>> Source/JavaScriptCore/bytecode/ValueProfile.h:210
>> +        return bitwise_cast<ValueProfileAndVirtualRegister*>(bitwise_cast<uint8_t*>(this) + sizeof(ValueProfileAndVirtualRegisterBuffer));
> 
> Would the following work?  It's shorter:
>     return bitwise_cast<ValueProfileAndVirtualRegister*>(this + 1);

It does not work since it is not guaranteed `sizeof(ValueProfileAndVirtualRegister)` == `alignof(ValueProfileAndVirtualRegisterBuffer)`.
Comment 4 Mark Lam 2021-04-15 11:58:20 PDT
Comment on attachment 426078 [details]
Patch

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

>>> Source/JavaScriptCore/bytecode/ValueProfile.h:210
>>> +        return bitwise_cast<ValueProfileAndVirtualRegister*>(bitwise_cast<uint8_t*>(this) + sizeof(ValueProfileAndVirtualRegisterBuffer));
>> 
>> Would the following work?  It's shorter:
>>     return bitwise_cast<ValueProfileAndVirtualRegister*>(this + 1);
> 
> It does not work since it is not guaranteed `sizeof(ValueProfileAndVirtualRegister)` == `alignof(ValueProfileAndVirtualRegisterBuffer)`.

But `this` is a ValueProfileAndVirtualRegisterBuffer.  Hence, this + 1 adds sizeof(ValueProfileAndVirtualRegisterBuffer), no?
Comment 5 Yusuke Suzuki 2021-04-15 18:28:47 PDT
Comment on attachment 426078 [details]
Patch

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

>>>> Source/JavaScriptCore/bytecode/ValueProfile.h:210
>>>> +        return bitwise_cast<ValueProfileAndVirtualRegister*>(bitwise_cast<uint8_t*>(this) + sizeof(ValueProfileAndVirtualRegisterBuffer));
>>> 
>>> Would the following work?  It's shorter:
>>>     return bitwise_cast<ValueProfileAndVirtualRegister*>(this + 1);
>> 
>> It does not work since it is not guaranteed `sizeof(ValueProfileAndVirtualRegister)` == `alignof(ValueProfileAndVirtualRegisterBuffer)`.
> 
> But `this` is a ValueProfileAndVirtualRegisterBuffer.  Hence, this + 1 adds sizeof(ValueProfileAndVirtualRegisterBuffer), no?

Ah! Right. Changed.
Comment 6 Yusuke Suzuki 2021-04-15 18:37:53 PDT
Committed r276102 (236602@main): <https://commits.webkit.org/236602@main>
Comment 7 Ryan Haddad 2021-04-19 22:01:02 PDT
rdar://76735679