RFR: JDK-8301508: Replace NULL with nullptr in os_cpu/linux_s390

Johan Sjölen jsjolen at openjdk.org
Tue Jan 31 12:01:50 UTC 2023


On Tue, 31 Jan 2023 11:42:19 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

> Hi, this PR changes all occurrences of NULL to nullptr for the subdirectory os_cpu/linux_s390. Unfortunately the script that does the change isn't perfect, and so we
> need to comb through these manually to make sure nothing has gone wrong. I also review these changes but things slip past my eyes sometimes.
> 
> Here are some typical things to look out for:
> 
> 1. No changes but copyright header changed (probably because I reverted some changes but forgot the copyright).
> 2. Macros having their NULL changed to nullptr, these are added to the script when I find them. They should be NULL.
> 3. nullptr in comments and logs. We try to use lower case "null" in these cases as it reads better. An exception is made when code expressions are in a comment.
> 
> An example of this:
> 
> ```c++
> // This function returns null
> void* ret_null();
> // This function returns true if *x == nullptr
> bool is_nullptr(void** x);
> 
> 
> Note how `nullptr` participates in a code expression here, we really are talking about the specific value `nullptr`.
> 
> Thanks!

Some fixes, otherwise trivial.

src/hotspot/os_cpu/linux_s390/javaThread_linux_s390.cpp line 73:

> 71:       // The found frame does not have a valid frame pointer.
> 72:       // Bail out because this will create big trouble later on, either
> 73:       //  - when using istate, calculated as (NULL - z_ijava_state_size (= 0x70 (dbg) or 0x68 (rel)) or

nullptr

src/hotspot/os_cpu/linux_s390/javaThread_linux_s390.cpp line 97:

> 95:       //  - ret_frame is constructed with _fp == null (for whatever reason)
> 96:       //  - ijava_state_unchecked() calculates it's result as
> 97:       //      istate = fp() - z_ijava_state_size() = null - 0x68 DEBUG_ONLY(-8)

nullptr

src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp line 195:

> 193:     assert(senderFrame.pc() != nullptr, "Sender pc should not be null");
> 194:     // Return sender of sender of current topframe which hopefully
> 195:     // both have pc != null.

nullptr

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

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


More information about the hotspot-runtime-dev mailing list