Bug 180804 - [DFG] Reduce register pressure of WeakMapGet to be used for 32bit
Summary: [DFG] Reduce register pressure of WeakMapGet to be used for 32bit
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: 2017-12-14 03:39 PST by Yusuke Suzuki
Modified: 2017-12-15 05:59 PST (History)
8 users (show)

See Also:


Attachments
Patch (5.34 KB, patch)
2017-12-14 03:39 PST, Yusuke Suzuki
saam: 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 2017-12-14 03:39:28 PST
[DFG] Reduce register pressure of WeakMapGet to be used for 32bit
Comment 1 Yusuke Suzuki 2017-12-14 03:39:57 PST
Created attachment 329343 [details]
Patch
Comment 2 Yusuke Suzuki 2017-12-14 03:41:06 PST
Comment on attachment 329343 [details]
Patch

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

> Source/JavaScriptCore/dfg/DFGRegisterBank.h:150
> +    }

Helper method for debugging.
Comment 3 Saam Barati 2017-12-14 09:49:24 PST
Comment on attachment 329343 [details]
Patch

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

r=me

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:10977
> +    std::optional<GPRTemporary> index;

Why optional? Does GPRTemporary have an empty constructor? If not, maybe it’s worth adding and you can just WTFMove() to it below instead of emplace

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:10982
> +        index.emplace(this, Reuse, hash);

Does Reuse only reuse if we’re the last user of the value?
Comment 4 Yusuke Suzuki 2017-12-14 17:38:11 PST
Comment on attachment 329343 [details]
Patch

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

>> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:10977
>> +    std::optional<GPRTemporary> index;
> 
> Why optional? Does GPRTemporary have an empty constructor? If not, maybe it’s worth adding and you can just WTFMove() to it below instead of emplace

OK, changed to using WTFMove(GPRTemporary()).

>> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:10982
>> +        index.emplace(this, Reuse, hash);
> 
> Does Reuse only reuse if we’re the last user of the value?

Yes, so this Reuse is just an optimization.
Comment 5 Yusuke Suzuki 2017-12-14 17:45:34 PST
Committed r225952: <https://trac.webkit.org/changeset/225952>
Comment 6 Radar WebKit Bug Importer 2017-12-14 17:49:23 PST
<rdar://problem/36064081>
Comment 7 Yusuke Suzuki 2017-12-15 05:59:04 PST
Committed r225971: <https://trac.webkit.org/changeset/225971>