Bug 197833 - [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
Summary: [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
Status: RESOLVED FIXED
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:
Blocks:
 
Reported: 2019-05-13 01:31 PDT by Yusuke Suzuki
Modified: 2019-05-14 13:51 PDT (History)
11 users (show)

See Also:


Attachments
Patch (18.74 KB, patch)
2019-05-13 01:32 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (18.71 KB, patch)
2019-05-13 01:33 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-highsierra (3.06 MB, application/zip)
2019-05-13 02:49 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews106 for mac-highsierra-wk2 (2.83 MB, application/zip)
2019-05-13 02:54 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews112 for mac-highsierra (3.01 MB, application/zip)
2019-05-13 03:24 PDT, EWS Watchlist
no flags Details
Patch (19.55 KB, patch)
2019-05-13 19:55 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (27.55 KB, patch)
2019-05-13 22:16 PDT, Yusuke Suzuki
darin: 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-05-13 01:31:35 PDT
[JSC] Shrink sizeof(UnlinkedFunctionExecutable) more
Comment 1 Yusuke Suzuki 2019-05-13 01:32:31 PDT
Created attachment 369710 [details]
Patch
Comment 2 Yusuke Suzuki 2019-05-13 01:33:35 PDT
Created attachment 369712 [details]
Patch
Comment 3 EWS Watchlist 2019-05-13 02:49:31 PDT
Comment on attachment 369712 [details]
Patch

Attachment 369712 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/12174771

New failing tests:
inspector/debugger/js-stacktrace.html
Comment 4 EWS Watchlist 2019-05-13 02:49:33 PDT
Created attachment 369721 [details]
Archive of layout-test-results from ews103 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 5 EWS Watchlist 2019-05-13 02:54:17 PDT
Comment on attachment 369712 [details]
Patch

Attachment 369712 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/12174749

New failing tests:
inspector/debugger/js-stacktrace.html
Comment 6 EWS Watchlist 2019-05-13 02:54:19 PDT
Created attachment 369722 [details]
Archive of layout-test-results from ews106 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 7 EWS Watchlist 2019-05-13 03:24:19 PDT
Comment on attachment 369712 [details]
Patch

Attachment 369712 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/12174857

New failing tests:
inspector/debugger/js-stacktrace.html
Comment 8 EWS Watchlist 2019-05-13 03:24:21 PDT
Created attachment 369723 [details]
Archive of layout-test-results from ews112 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 9 Yusuke Suzuki 2019-05-13 19:55:38 PDT
Created attachment 369814 [details]
Patch
Comment 10 Yusuke Suzuki 2019-05-13 22:16:40 PDT
Created attachment 369821 [details]
Patch
Comment 11 Tadeu Zagallo 2019-05-14 02:09:45 PDT
Nice. It might be worth doing the same to CachedFunctionExecutable so we can also shrink the bytecode cache size (or at least adding a FIXME).
Comment 12 Darin Adler 2019-05-14 09:06:01 PDT
Comment on attachment 369821 [details]
Patch

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

> Source/JavaScriptCore/ChangeLog:16
> +        2. We drop m_inferredName and prefer m_ecmaName. The inferred name is used to offer better function name when the function expression lacks
> +           the name, but now ECMAScript has a specified semantics to name those functions with intuitive names. We should use ecmaName consistently,
> +           and should not eat 8 bytes for inferred names in UnlinkedFunctionExecutable.

Seems like a great strategy, but longer term there has to be something more elegant than calling this "ECMA name".
Comment 13 Yusuke Suzuki 2019-05-14 10:05:01 PDT
Comment on attachment 369821 [details]
Patch

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

>> Source/JavaScriptCore/ChangeLog:16
>> +           and should not eat 8 bytes for inferred names in UnlinkedFunctionExecutable.
> 
> Seems like a great strategy, but longer term there has to be something more elegant than calling this "ECMA name".

Right! Currently, we hold m_ecmaName and m_name separately, but I think we could remove m_name side since m_ecmaName should subsume the use case of m_name.
Once it is done, we can just call it "m_name".
Comment 14 Yusuke Suzuki 2019-05-14 10:19:51 PDT
(In reply to Tadeu Zagallo from comment #11)
> Nice. It might be worth doing the same to CachedFunctionExecutable so we can
> also shrink the bytecode cache size (or at least adding a FIXME).

Nice, done!
Comment 15 Yusuke Suzuki 2019-05-14 10:31:59 PDT
Committed r245288: <https://trac.webkit.org/changeset/245288>
Comment 16 Radar WebKit Bug Importer 2019-05-14 10:32:32 PDT
<rdar://problem/50772182>
Comment 17 Truitt Savell 2019-05-14 13:37:53 PDT
Rebaslined inspector/model/remote-object.html in:
https://trac.webkit.org/changeset/245303/webkit

After it was broken by https://trac.webkit.org/changeset/245288/webkit
Comment 18 Devin Rousso 2019-05-14 13:51:13 PDT
Comment on attachment 369821 [details]
Patch

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

> Source/JavaScriptCore/parser/ASTBuilder.h:-1506
> -            static_cast<BaseFuncExprNode*>(expr)->metadata()->setInferredName(dot->identifier());

FWIW, this slightly alters the object previews shown in Web Inspector.
<http://trac.webkit.org/r245303>