Bug 234387 - [JSC][ARMv7] Minor code size improvements
Summary: [JSC][ARMv7] Minor code size improvements
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: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-16 03:45 PST by Geza Lore
Modified: 2022-02-10 16:37 PST (History)
8 users (show)

See Also:


Attachments
Patch (26.92 KB, patch)
2021-12-16 03:47 PST, Geza Lore
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (26.90 KB, patch)
2021-12-16 04:36 PST, Geza Lore
no flags Details | Formatted Diff | Diff
Patch (26.90 KB, patch)
2021-12-16 04:38 PST, Geza Lore
no flags Details | Formatted Diff | Diff
Fix review feedback (27.86 KB, patch)
2021-12-20 01:01 PST, Geza Lore
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geza Lore 2021-12-16 03:45:47 PST
[JSC][ARMv7] Minor code size improvements
Comment 1 Geza Lore 2021-12-16 03:47:17 PST
Created attachment 447342 [details]
Patch
Comment 2 Geza Lore 2021-12-16 04:36:44 PST
Created attachment 447343 [details]
Patch
Comment 3 Geza Lore 2021-12-16 04:38:29 PST
Created attachment 447344 [details]
Patch
Comment 4 Yusuke Suzuki 2021-12-18 03:29:55 PST
Comment on attachment 447344 [details]
Patch

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

Nice. Commented.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:-696
> -        GPRReg thisArgumentTagGPR = thisArgument.tagGPR();
> -        GPRReg thisArgumentPayloadGPR = thisArgument.payloadGPR();
>          thisArgument.use();
>          
> -        m_jit.store32(thisArgumentTagGPR, JITCompiler::calleeArgumentTagSlot(0));
> -        m_jit.store32(thisArgumentPayloadGPR, JITCompiler::calleeArgumentPayloadSlot(0));

Ditto.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:-758
> -                GPRReg argTagGPR = arg.tagGPR();
> -                GPRReg argPayloadGPR = arg.payloadGPR();
>                  use(argEdge);
> -            
> -                m_jit.store32(argTagGPR, m_jit.calleeArgumentTagSlot(i));
> -                m_jit.store32(argPayloadGPR, m_jit.calleeArgumentPayloadSlot(i));

This is not correct. Need to call arg.jsValueRegs() first before calling use() IIRC.
So, please follow the original way of the code, do not pass `arg.jsValueRegs()` arg directly, and instead, first define the following.

JSValueRegs argsRegs = args.jsValueRegs();

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:763
>          calleePayloadGPR = callee.payloadGPR();

Let's follow the protocol the other DFG part uses.

First, define

JSValueRegs calleeRegs = callee.jsValueRegs();

before calling use.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2193
>              GPRTemporary result(this);
>              GPRTemporary tag(this);

How about using JSValueRegsTemporary?

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2194
> +            m_jit.loadValue(JITCompiler::addressFor(node->machineLocal()), JSValueRegs { tag.gpr(), result.gpr() });

Ditto.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2263
> -            m_jit.store32(value.payloadGPR(), JITCompiler::payloadFor(node->machineLocal()));
> -            m_jit.store32(value.tagGPR(), JITCompiler::tagFor(node->machineLocal()));
> +            m_jit.storeValue(value.jsValueRegs(), JITCompiler::addressFor(node->machineLocal()));

First define JSValueRegs valueRegs = value.jsValueRegs();
Comment 5 Geza Lore 2021-12-20 01:01:33 PST
Created attachment 447589 [details]
Fix review feedback
Comment 6 Geza Lore 2021-12-20 01:42:44 PST
Comment on attachment 447344 [details]
Patch

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

Thanks these are very helpful. Fixed all.

>> Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp:2263
>> +            m_jit.storeValue(value.jsValueRegs(), JITCompiler::addressFor(node->machineLocal()));
> 
> First define JSValueRegs valueRegs = value.jsValueRegs();

Not sure this is necessary, most other cases don't do this.
Comment 7 Yusuke Suzuki 2021-12-21 00:10:39 PST
Comment on attachment 447589 [details]
Fix review feedback

r=me
Comment 8 EWS 2021-12-21 00:34:32 PST
Committed r287301 (245453@main): <https://commits.webkit.org/245453@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447589 [details].
Comment 9 Radar WebKit Bug Importer 2021-12-21 00:35:19 PST
<rdar://problem/86757902>