| Summary: | [JSC] Introduce UnlinkedCodeBlockGenerator and reduce sizeof(UnlinkedCodeBlock) | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||||||
| Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, dbates, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer | ||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||
| Version: | WebKit Nightly Build | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Yusuke Suzuki
2020-02-01 00:19:09 PST
Created attachment 389635 [details]
Patch
I think this can offer sub-1% memory reduction in Gmail. Ah,dead-lock! Fixing Created attachment 389639 [details]
Patch
Created attachment 389640 [details]
Patch
Created attachment 389645 [details]
Patch
Comment on attachment 389645 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=389645&action=review Nice! > Source/JavaScriptCore/bytecode/UnlinkedCodeBlockGenerator.cpp:150 > + if (!m_codeBlock->m_rareData) { Why would the code block have rare data at this point? > Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:291 > + m_codeBlock->finalize(m_writer.finalize()); Not necessarily on this patch, but ideally I think UnlinkedCodeBlockGenerator should own the UnlinkedCodeBlock and return it from finalize. > Source/WTF/wtf/RefCountedArray.h:201 > + T& front() { return (*this)[0]; } > + const T& front() const { return (*this)[0]; } I believe this called `first` in Vector, should we just call the same here? Comment on attachment 389645 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=389645&action=review Thanks! >> Source/JavaScriptCore/bytecode/UnlinkedCodeBlockGenerator.cpp:150 >> + if (!m_codeBlock->m_rareData) { > > Why would the code block have rare data at this point? If `NeedsClassFieldInitializer::Yes` is specified, we create a rareData in UnlinkedCodeBlock's constructor. >> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:291 >> + m_codeBlock->finalize(m_writer.finalize()); > > Not necessarily on this patch, but ideally I think UnlinkedCodeBlockGenerator should own the UnlinkedCodeBlock and return it from finalize. Right! Filed a issue here. https://bugs.webkit.org/show_bug.cgi?id=207212 >> Source/WTF/wtf/RefCountedArray.h:201 >> + const T& front() const { return (*this)[0]; } > > I believe this called `first` in Vector, should we just call the same here? Nice, fixed. Committed r255687: <https://trac.webkit.org/changeset/255687> |