Bug 184236 - [DFG] Remove duplicate 32bit code more
Summary: [DFG] Remove duplicate 32bit code 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: 2018-04-02 09:49 PDT by Yusuke Suzuki
Modified: 2018-04-11 02:37 PDT (History)
8 users (show)

See Also:


Attachments
Patch (111.16 KB, patch)
2018-04-02 09:52 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (111.25 KB, patch)
2018-04-02 10:09 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (111.43 KB, patch)
2018-04-02 10:47 PDT, 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 2018-04-02 09:49:26 PDT
[DFG] Remove duplicate 32bit code more
Comment 1 Yusuke Suzuki 2018-04-02 09:52:48 PDT
Created attachment 336990 [details]
Patch
Comment 2 EWS Watchlist 2018-04-02 09:55:35 PDT
Attachment 336990 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGCompareSlowPathGenerator.h:43:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGCompareSlowPathGenerator.h:44:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 2 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Yusuke Suzuki 2018-04-02 10:09:19 PDT
Created attachment 336993 [details]
Patch
Comment 4 EWS Watchlist 2018-04-02 10:13:14 PDT
Attachment 336993 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGCompareSlowPathGenerator.h:43:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGCompareSlowPathGenerator.h:44:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 2 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Yusuke Suzuki 2018-04-02 10:47:20 PDT
Created attachment 336998 [details]
Patch
Comment 6 EWS Watchlist 2018-04-02 10:48:59 PDT
Attachment 336998 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/dfg/DFGCompareSlowPathGenerator.h:43:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
ERROR: Source/JavaScriptCore/dfg/DFGCompareSlowPathGenerator.h:44:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 2 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Yusuke Suzuki 2018-04-07 07:09:30 PDT
Ping?
Comment 8 Mark Lam 2018-04-09 21:20:14 PDT
Comment on attachment 336998 [details]
Patch

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

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:12920
> +    unblessedBooleanResult(resultGPR, node, UseChildrenCalledExplicitly);

This is not equivalent to the original.  From my reading of the code, this merely performs a bool to JSBoolean conversion.  The original code which calls jsValueResult() (see DFGSpeculativeJIT.h:855-867) which adds JIT asserts, do some tracking for register spilling, and capture GenerationInfo.  There appear to be a lot of work which are missing here.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:438
> +    JITCompiler::Jump twoCellsCase = m_jit.branchTest64(JITCompiler::Zero, resultGPR, GPRInfo::tagMaskRegister);

I don't see how this can work for 32-bit targets.  The tagMaskRegister only exits for x86_64 and ARM64.  What am I missing?
Comment 9 Mark Lam 2018-04-10 22:15:58 PDT
(In reply to Mark Lam from comment #8)
> Comment on attachment 336998 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=336998&action=review
> 
> > Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:12920
> > +    unblessedBooleanResult(resultGPR, node, UseChildrenCalledExplicitly);
> 
> This is not equivalent to the original.  From my reading of the code, this
> merely performs a bool to JSBoolean conversion.  The original code which
> calls jsValueResult() (see DFGSpeculativeJIT.h:855-867) which adds JIT
> asserts, do some tracking for register spilling, and capture GenerationInfo.
> There appear to be a lot of work which are missing here.

I misread the code.  I thought unblessedBooleanResult() only did blessBoolean() part for 64-bit, and not the blessedBooleanResult() part.  It actually does both.

> > Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp:438
> > +    JITCompiler::Jump twoCellsCase = m_jit.branchTest64(JITCompiler::Zero, resultGPR, GPRInfo::tagMaskRegister);
> 
> I don't see how this can work for 32-bit targets.  The tagMaskRegister only
> exits for x86_64 and ARM64.  What am I missing?

I misread this part too.  I thought that there's only one consolidated version of nonSpeculativeNonPeepholeStrictEq().  That's not the case: this is just the 64-bit version.  Hence, there's no issue here.

Sorry for the noise.
Comment 10 Mark Lam 2018-04-10 23:26:52 PDT
Comment on attachment 336998 [details]
Patch

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

r=me.  Thanks for the hard work.  This is a big patch.

> Source/JavaScriptCore/jit/RegisterSet.h:210
> +    void setAny(JSValueRegs reg) { set(reg); }

nit: lets call the argument "regs" instead of "reg".  I think this is the convention used everywhere else.
Comment 11 Yusuke Suzuki 2018-04-11 00:17:13 PDT
Comment on attachment 336998 [details]
Patch

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

Thank you for your review!

>> Source/JavaScriptCore/jit/RegisterSet.h:210
>> +    void setAny(JSValueRegs reg) { set(reg); }
> 
> nit: lets call the argument "regs" instead of "reg".  I think this is the convention used everywhere else.

Fixed!
Comment 12 Yusuke Suzuki 2018-04-11 00:45:03 PDT
Committed r230517: <https://trac.webkit.org/changeset/230517>
Comment 13 Radar WebKit Bug Importer 2018-04-11 00:46:19 PDT
<rdar://problem/39340504>
Comment 14 Yusuke Suzuki 2018-04-11 02:37:22 PDT
Committed r230520: <https://trac.webkit.org/changeset/230520>