Bug 195049

Summary: Fix warnings on ARM and MIPS
Product: WebKit Reporter: Dominik Inführ <dominik.infuehr>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, guijemont, keith_miller, mark.lam, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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. ***