Bug 187448 - [JSC] Optimize padding of UnlinkedCodeBlock to shrink
Summary: [JSC] Optimize padding of UnlinkedCodeBlock to shrink
Status: REOPENED
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: 187746
Blocks:
  Show dependency treegraph
 
Reported: 2018-07-08 09:48 PDT by Yusuke Suzuki
Modified: 2018-07-17 21:35 PDT (History)
11 users (show)

See Also:


Attachments
Patch (7.89 KB, patch)
2018-07-08 09:50 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

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