[JSC] Remove CodeBlock::RareData::m_catchProfiles
Created attachment 426078 [details] Patch
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 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 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 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.
Committed r276102 (236602@main): <https://commits.webkit.org/236602@main>
rdar://76735679