Bug 194733 - [JSC] Shrink UnlinkedFunctionExecutable
Summary: [JSC] Shrink UnlinkedFunctionExecutable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-02-15 17:46 PST by Yusuke Suzuki
Modified: 2019-02-16 00:59 PST (History)
10 users (show)

See Also:


Attachments
Patch (27.12 KB, patch)
2019-02-15 18:07 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (26.89 KB, patch)
2019-02-15 20:27 PST, 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 2019-02-15 17:46:43 PST
Shrink UnlinkedFunctionExecutable more to put more instances in one MarkedBlock. Right now, 2 MarkedBlocks are allocated just after initialization of JSGlobalObject, and the second one only uses 8%.
If we can shrink UnlinkedFunctionExecutable, we can make it only one MarkedBlock.
Comment 1 Yusuke Suzuki 2019-02-15 18:07:26 PST
Created attachment 362197 [details]
Patch
Comment 2 Yusuke Suzuki 2019-02-15 19:00:55 PST
Comment on attachment 362197 [details]
Patch

Need to check the test. But it is strange because the test thinks source URL directive should be used even for function constructor.
Comment 3 Yusuke Suzuki 2019-02-15 20:27:23 PST
Created attachment 362202 [details]
Patch
Comment 4 Mark Lam 2019-02-16 00:21:15 PST
Comment on attachment 362202 [details]
Patch

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

r=me

> Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp:45
> +static_assert(sizeof(UnlinkedFunctionExecutable) <= 128, "UnlinkedFunctionExecutable should fit in a 128-byte cell to keep allocated block only one just after initializing JSGlobalObject.");

I would rephrase the message as "UnlinkedFunctionExecutable should fit in a 128-byte cell to keep allocated blocks count to only one after initializing JSGlobalObject."
Comment 5 Yusuke Suzuki 2019-02-16 00:52:23 PST
Comment on attachment 362202 [details]
Patch

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

Thank you!

>> Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp:45
>> +static_assert(sizeof(UnlinkedFunctionExecutable) <= 128, "UnlinkedFunctionExecutable should fit in a 128-byte cell to keep allocated block only one just after initializing JSGlobalObject.");
> 
> I would rephrase the message as "UnlinkedFunctionExecutable should fit in a 128-byte cell to keep allocated blocks count to only one after initializing JSGlobalObject."

Sounds nice! Fixed.
Comment 6 Yusuke Suzuki 2019-02-16 00:58:42 PST
Committed r241645: <https://trac.webkit.org/changeset/241645>
Comment 7 Radar WebKit Bug Importer 2019-02-16 00:59:23 PST
<rdar://problem/48136411>