Bug 187448

Summary: [JSC] Optimize padding of UnlinkedCodeBlock to shrink
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: REOPENED ---    
Severity: Normal CC: benjamin, cdumez, cmarcelo, commit-queue, dbates, ews-watchlist, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 187746    
Bug Blocks:    
Attachments:
Description Flags
Patch none

Description Yusuke Suzuki 2018-07-08 09:48:13 PDT
[JSC] Optimize padding of UnlinkedCodeBlock to shrink
Comment 1 Yusuke Suzuki 2018-07-08 09:50:07 PDT
Created attachment 344548 [details]
Patch
Comment 2 WebKit Commit Bot 2018-07-08 10:40:02 PDT
Comment on attachment 344548 [details]
Patch

Clearing flags on attachment: 344548

Committed r233629: <https://trac.webkit.org/changeset/233629>
Comment 3 WebKit Commit Bot 2018-07-08 10:40:04 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2018-07-08 10:41:25 PDT
<rdar://problem/41950243>
Comment 5 Keith Miller 2018-07-10 14:56:48 PDT
Comment on attachment 344548 [details]
Patch

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

> Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h:465
> +    unsigned m_codeType : 2; // CodeType
> +    unsigned m_didOptimize : 2; // TriState

Nit: I think these can still be the enum types btw.
Comment 6 Yusuke Suzuki 2018-07-10 15:02:16 PDT
(In reply to Keith Miller from comment #5)
> Comment on attachment 344548 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=344548&action=review
> 
> > Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h:465
> > +    unsigned m_codeType : 2; // CodeType
> > +    unsigned m_didOptimize : 2; // TriState
> 
> Nit: I think these can still be the enum types btw.

IIRC, using different types for bit fields adds unnecessary paddings in MSVC.
So, conservatively, I choose `unsigned` here.
Comment 7 Keith Miller 2018-07-17 21:35:40 PDT
I'm reverting this with https://bugs.webkit.org/show_bug.cgi?id=187746 since it seems to have broken internal wasm benchmarks. I think this patch just happened to exemplify an existing issue though. I'll investigate...