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

Johan Sjölen jsjolen at openjdk.org
Tue Apr 11 09:42:07 UTC 2023


On Thu, 30 Mar 2023 03:38:55 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixes
>
> 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" ?

Agreed.

> 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" ?

Agreed.

> src/hotspot/cpu/riscv/interpreterRT_riscv.cpp line 230:
> 
>> 228:   virtual void pass_object() {
>> 229:     intptr_t* addr = single_slot_addr();
>> 230:     intptr_t value = *addr == 0 ? nullptr : (intptr_t)addr;
> 
> PS: I got compile errors when doing a native build with GCC-11.3.0:
> 
> 474 /home/fyang/openjdk-jdk/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp: In member function 'virtual void SlowSignatureHandler::pass_object()':
> 475 /home/fyang/openjdk-jdk/src/hotspot/cpu/riscv/interpreterRT_riscv.cpp:230:33: error: operands to '?:' have different types 'std::nullptr_t' and 'intptr_t' {aka 'long int'}
> 476   230 |     intptr_t value = *addr == 0 ? nullptr : (intptr_t)addr;
> 477       |                      ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> I think we should change the "nullptr" here into "(intptr_t)nullptr".

Yeah, that's correct. Fixed!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12324#discussion_r1162556256
PR Review Comment: https://git.openjdk.org/jdk/pull/12324#discussion_r1162556345
PR Review Comment: https://git.openjdk.org/jdk/pull/12324#discussion_r1162557096


More information about the shenandoah-dev mailing list