Bug 187292

Summary: FunctionTraits: Make cCallArity() constant on 32-bits.
Product: WebKit Reporter: Guillaume Emont <guijemont>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, commit-queue, dbates, ews-watchlist, guijemont, keith_miller, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ews205 for win-future
none
Archive of layout-test-results from ews122 for ios-simulator-wk2
none
Patch none

Description Guillaume Emont 2018-07-03 08:10:04 PDT
On X86, in CCallHelpers.h we have a static_assert that uses cCallArity(), so it needs to be constant to avoid a compilation error.
Comment 1 Guillaume Emont 2018-07-03 08:24:06 PDT
Created attachment 344189 [details]
Patch

Patch fixing the issue using std::enable_if_t function parameters instead of a runtime if.
Comment 2 Guillaume Emont 2018-07-03 10:17:45 PDT
Created attachment 344194 [details]
Patch

New version with a message on static_assert to make clang happy.
Comment 3 EWS Watchlist 2018-07-03 12:13:15 PDT
Comment on attachment 344194 [details]
Patch

Attachment 344194 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8426224

New failing tests:
http/tests/security/canvas-remote-read-remote-video-blocked-no-crossorigin.html
Comment 4 EWS Watchlist 2018-07-03 12:13:27 PDT
Created attachment 344203 [details]
Archive of layout-test-results from ews205 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews205  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 5 EWS Watchlist 2018-07-03 12:16:06 PDT
Comment on attachment 344194 [details]
Patch

Attachment 344194 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/8425977

New failing tests:
animations/needs-layout.html
Comment 6 EWS Watchlist 2018-07-03 12:16:08 PDT
Created attachment 344204 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.4
Comment 7 Guillaume Emont 2018-07-04 02:52:13 PDT
EWS failures look like they are unrelated to the change.
Comment 8 Yusuke Suzuki 2018-07-04 03:52:22 PDT
Comment on attachment 344194 [details]
Patch

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

> Source/WTF/wtf/FunctionTraits.h:-45
> -    ASSERT(sizeof(T) <= 4);

I think just changing this to `static_assert(sizeof(T) == 8 || sizeof(T) <= 4, "")` is enough since we have relaxed constexpr.
Comment 9 Guillaume Emont 2018-07-04 04:13:02 PDT
(In reply to Yusuke Suzuki from comment #8)
> Comment on attachment 344194 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=344194&action=review
> 
> > Source/WTF/wtf/FunctionTraits.h:-45
> > -    ASSERT(sizeof(T) <= 4);
> 
> I think just changing this to `static_assert(sizeof(T) == 8 || sizeof(T) <=
> 4, "")` is enough since we have relaxed constexpr.

Indeed it is much simpler. I am sorry I did not know about relaxed constexpr. New patch upcoming.
Comment 10 Guillaume Emont 2018-07-04 05:21:41 PDT
Created attachment 344281 [details]
Patch

New simpler version taking advantage of relaxed constexpr.
Comment 11 Yusuke Suzuki 2018-07-04 05:27:31 PDT
Comment on attachment 344281 [details]
Patch

r=me
Comment 12 WebKit Commit Bot 2018-07-04 05:54:54 PDT
Comment on attachment 344281 [details]
Patch

Clearing flags on attachment: 344281

Committed r233504: <https://trac.webkit.org/changeset/233504>
Comment 13 WebKit Commit Bot 2018-07-04 05:54:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 14 Radar WebKit Bug Importer 2018-07-04 05:56:39 PDT
<rdar://problem/41817774>