Bug 187292 - FunctionTraits: Make cCallArity() constant on 32-bits.
Summary: FunctionTraits: Make cCallArity() constant on 32-bits.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-03 08:10 PDT by Guillaume Emont
Modified: 2018-07-04 05:56 PDT (History)
10 users (show)

See Also:


Attachments
Patch (2.00 KB, patch)
2018-07-03 08:24 PDT, Guillaume Emont
no flags Details | Formatted Diff | Diff
Patch (2.02 KB, patch)
2018-07-03 10:17 PDT, Guillaume Emont
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews205 for win-future (12.79 MB, application/zip)
2018-07-03 12:13 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews122 for ios-simulator-wk2 (5.39 MB, application/zip)
2018-07-03 12:16 PDT, Build Bot
no flags Details
Patch (1.56 KB, patch)
2018-07-04 05:21 PDT, Guillaume Emont
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 Build Bot 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 Build Bot 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 Build Bot 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 Build Bot 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>