Skip to content

Commit ad79e49

Browse files
committedFeb 2, 2023
8301512: Replace NULL with nullptr in os_cpu/windows_aarch64
Reviewed-by: kbarrett
1 parent 8cc399b commit ad79e49

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed
 

‎src/hotspot/os_cpu/windows_aarch64/javaThread_windows_aarch64.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
frame JavaThread::pd_last_frame() {
3131
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
32-
vmassert(_anchor.last_Java_pc() != NULL, "not walkable");
32+
vmassert(_anchor.last_Java_pc() != nullptr, "not walkable");
3333
frame f = frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
3434
f.set_sp_is_trusted();
3535
return f;
@@ -61,15 +61,15 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
6161
// if we were running Java code when SIGPROF came in.
6262
if (isInJava) {
6363
frame ret_frame = os::fetch_frame_from_context(ucontext);
64-
if (ret_frame.pc() == NULL || ret_frame.sp() == NULL ) {
64+
if (ret_frame.pc() == nullptr || ret_frame.sp() == nullptr ) {
6565
// CONTEXT wasn't useful
6666
return false;
6767
}
6868

6969
if (!ret_frame.safe_for_sender(this)) {
7070
#if COMPILER2_OR_JVMCI
71-
// C2 and JVMCI use ebp as a general register see if NULL fp helps
72-
frame ret_frame2(ret_frame.sp(), NULL, ret_frame.pc());
71+
// C2 and JVMCI use ebp as a general register see if null fp helps
72+
frame ret_frame2(ret_frame.sp(), nullptr, ret_frame.pc());
7373
if (!ret_frame2.safe_for_sender(this)) {
7474
// nothing else to try if the frame isn't good
7575
return false;

‎src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020, Microsoft Corporation. All rights reserved.
3-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -79,15 +79,15 @@ address os::fetch_frame_from_context(const void* ucVoid,
7979
address epc;
8080
CONTEXT* uc = (CONTEXT*)ucVoid;
8181

82-
if (uc != NULL) {
82+
if (uc != nullptr) {
8383
epc = (address)uc->Pc;
8484
if (ret_sp) *ret_sp = (intptr_t*)uc->Sp;
8585
if (ret_fp) *ret_fp = (intptr_t*)uc->Fp;
8686
} else {
8787
// construct empty ExtendedPC for return value checking
88-
epc = NULL;
89-
if (ret_sp) *ret_sp = (intptr_t *)NULL;
90-
if (ret_fp) *ret_fp = (intptr_t *)NULL;
88+
epc = nullptr;
89+
if (ret_sp) *ret_sp = (intptr_t *)nullptr;
90+
if (ret_fp) *ret_fp = (intptr_t *)nullptr;
9191
}
9292
return epc;
9393
}
@@ -117,7 +117,7 @@ bool os::win32::get_frame_at_stack_banging_point(JavaThread* thread,
117117
// more complex code with compiled code
118118
assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above");
119119
CodeBlob* cb = CodeCache::find_blob(pc);
120-
if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) {
120+
if (cb == nullptr || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) {
121121
// Not sure where the pc points to, fallback to default
122122
// stack overflow handling
123123
return false;
@@ -161,7 +161,7 @@ frame os::current_frame() {
161161
// helper functions for fatal error handler
162162

163163
void os::print_context(outputStream *st, const void *context) {
164-
if (context == NULL) return;
164+
if (context == nullptr) return;
165165

166166
const CONTEXT* uc = (const CONTEXT*)context;
167167

@@ -207,7 +207,7 @@ void os::print_context(outputStream *st, const void *context) {
207207
}
208208

209209
void os::print_tos_pc(outputStream *st, const void *context) {
210-
if (context == NULL) return;
210+
if (context == nullptr) return;
211211

212212
const CONTEXT* uc = (const CONTEXT*)context;
213213

@@ -225,7 +225,7 @@ void os::print_tos_pc(outputStream *st, const void *context) {
225225
}
226226

227227
void os::print_register_info(outputStream *st, const void *context) {
228-
if (context == NULL) return;
228+
if (context == nullptr) return;
229229

230230
const CONTEXT* uc = (const CONTEXT*)context;
231231

‎src/hotspot/os_cpu/windows_aarch64/vm_version_windows_aarch64.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ void VM_Version::get_os_cpu_info() {
5353
}
5454

5555
{
56-
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = NULL;
56+
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = nullptr;
5757
DWORD returnLength = 0;
5858

5959
// See https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getlogicalprocessorinformation
60-
GetLogicalProcessorInformation(NULL, &returnLength);
60+
GetLogicalProcessorInformation(nullptr, &returnLength);
6161
assert(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected return from GetLogicalProcessorInformation");
6262

6363
buffer = (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION)os::malloc(returnLength, mtInternal);
@@ -81,9 +81,9 @@ void VM_Version::get_os_cpu_info() {
8181

8282
{
8383
char* buf = ::getenv("PROCESSOR_IDENTIFIER");
84-
if (buf && strstr(buf, "Ampere(TM)") != NULL) {
84+
if (buf && strstr(buf, "Ampere(TM)") != nullptr) {
8585
_cpu = CPU_AMCC;
86-
} else if (buf && strstr(buf, "Cavium Inc.") != NULL) {
86+
} else if (buf && strstr(buf, "Cavium Inc.") != nullptr) {
8787
_cpu = CPU_CAVIUM;
8888
} else {
8989
log_info(os)("VM_Version: unknown CPU model");
@@ -100,7 +100,7 @@ void VM_Version::get_os_cpu_info() {
100100
}
101101

102102
void VM_Version::get_compatible_board(char *buf, int buflen) {
103-
assert(buf != NULL, "invalid argument");
103+
assert(buf != nullptr, "invalid argument");
104104
assert(buflen >= 1, "invalid argument");
105105
*buf = '\0';
106106
}

0 commit comments

Comments
 (0)