RFR: JDK-8301496: Replace NULL with nullptr in cpu/riscv

Fei Yang fyang at openjdk.org
Thu Mar 30 03:43:45 UTC 2023


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

> Hi, this PR changes all occurrences of NULL to nullptr for the subdirectory cpu/riscv. 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!

LGTM. Two nits.

src/hotspot/cpu/riscv/interp_masm_riscv.cpp line 1616:

> 1614:    beqz(t0, L);
> 1615:    stop("InterpreterMacroAssembler::call_VM_leaf_base:"
> 1616:         " last_sp != null");

Maybe: " last_sp isn't null" ?

src/hotspot/cpu/riscv/interp_masm_riscv.cpp line 1643:

> 1641:     beqz(t0, L);
> 1642:     stop("InterpreterMacroAssembler::call_VM_base:"
> 1643:          " last_sp != null");

Similar here. Maybe: " last_sp isn't null" ?

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

Marked as reviewed by fyang (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/12324#pullrequestreview-1364274565
PR Review Comment: https://git.openjdk.org/jdk/pull/12324#discussion_r1152695397
PR Review Comment: https://git.openjdk.org/jdk/pull/12324#discussion_r1152695612


More information about the shenandoah-dev mailing list