[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR: 8298241: Replace C-style casts with JavaThread::cast [v2]
From:       Doug Simon <dnsimon () openjdk ! org>
Date:       2022-12-19 8:56:55
Message-ID: TmX_7s4peISIMYQFly_4wQaMwY8aQZ46jrnGPfoea8E=.76ee21d8-9b95-426d-8acc-629f4085ebb3 () github ! com
[Download RAW message or body]

On Thu, 15 Dec 2022 21:20:31 GMT, David Holmes <dholmes@openjdk.org> wrote:

> > This is a simple cleanup RFE to get rid of old-style C casts in relation to \
> > JavaThread. 
> > In many cases involving NULL/nullptr the cast could just be dropped. Sometimes a \
> > static cast is needed to disambiguate overloads. 
> > A couple of reinterpret_cast are needed when doing int/ptr conversion.
> > 
> > static_cast is used for void* conversion.
> > 
> > The other changes should be self explanatory.
> > 
> > The changes in
> > 
> > src/hotspot/os_cpu/bsd_aarch64/javaThread_bsd_aarch64.cpp
> > src/hotspot/os_cpu/windows_aarch64/javaThread_windows_aarch64.cpp
> > 
> > are a bit more extensive. That code was using an alias for `this` which is \
> > completely unnecessary (and the alias creation was using the cast). This could be \
> > factored out if thought necessary. 
> > I grep'd as best I could for the old C-style casts but can't be certain I got \
> > them all. 
> > Testing: 
> > - all builds in our tiers1-5
> > - local linux x64 product, slowdebug and fastdebug
> > - GHA
> > - Sanity testing tiers 1-3
> > Thanks.
> 
> David Holmes has updated the pull request incrementally with one additional commit \
> since the last revision: 
> Fixed commented examle.

Ok, thanks. That's a shame. It seems like being able to run style checkers and other \
linters would be useful in cases like this.

-------------

PR: https://git.openjdk.org/jdk/pull/11682


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic