Bug 195049 - Fix warnings on ARM and MIPS
Summary: Fix warnings on ARM and MIPS
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
: 188598 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-02-26 07:49 PST by Dominik Inführ
Modified: 2019-02-27 05:37 PST (History)
6 users (show)

See Also:


Attachments
Patch (7.03 KB, patch)
2019-02-26 07:51 PST, Dominik Inführ
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Inführ 2019-02-26 07:49:15 PST
Fix warnings on ARM and MIPS
Comment 1 Dominik Inführ 2019-02-26 07:51:12 PST
Created attachment 362986 [details]
Patch
Comment 2 Mark Lam 2019-02-26 12:32:51 PST
Comment on attachment 362986 [details]
Patch

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

r=me with fix.

> Source/JavaScriptCore/tools/JSDollarVM.cpp:1464
> +            candidateCodeBlock = static_cast<CodeBlock*>(value.asCell());

Let's use bitwise_cast here too.
Comment 3 Saam Barati 2019-02-26 14:06:42 PST
Comment on attachment 362986 [details]
Patch

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

>> Source/JavaScriptCore/tools/JSDollarVM.cpp:1464
>> +            candidateCodeBlock = static_cast<CodeBlock*>(value.asCell());
> 
> Let's use bitwise_cast here too.

Why?
My preference of casting is:
1. static_cast
2. bitwise_cast
3. reinterpret_cast
Comment 4 Mark Lam 2019-02-26 14:13:33 PST
Comment on attachment 362986 [details]
Patch

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

>>> Source/JavaScriptCore/tools/JSDollarVM.cpp:1464
>>> +            candidateCodeBlock = static_cast<CodeBlock*>(value.asCell());
>> 
>> Let's use bitwise_cast here too.
> 
> Why?
> My preference of casting is:
> 1. static_cast
> 2. bitwise_cast
> 3. reinterpret_cast

I just wasn't thinking correctly.  I guess static_cast does a compile time type check, and hence, is preferable to bitwise_cast which only does a size check.  I withdraw my comment.
Comment 5 WebKit Commit Bot 2019-02-26 14:40:08 PST
Comment on attachment 362986 [details]
Patch

Clearing flags on attachment: 362986

Committed r242109: <https://trac.webkit.org/changeset/242109>
Comment 6 WebKit Commit Bot 2019-02-26 14:40:10 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-02-26 14:46:31 PST
<rdar://problem/48415918>
Comment 8 Guillaume Emont 2019-02-27 05:37:35 PST
*** Bug 188598 has been marked as a duplicate of this bug. ***