8301512: Replace NULL with nullptr in os_cpu/windows_aarch64

Reviewed-by: kbarrett
This commit is contained in:
Johan Sjölen 2023-02-02 09:28:19 +00:00
parent 8cc399b672
commit ad79e49141
3 changed files with 18 additions and 18 deletions

View File

@ -29,7 +29,7 @@
frame JavaThread::pd_last_frame() {
assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
vmassert(_anchor.last_Java_pc() != NULL, "not walkable");
vmassert(_anchor.last_Java_pc() != nullptr, "not walkable");
frame f = frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
f.set_sp_is_trusted();
return f;
@ -61,15 +61,15 @@ bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava)
// if we were running Java code when SIGPROF came in.
if (isInJava) {
frame ret_frame = os::fetch_frame_from_context(ucontext);
if (ret_frame.pc() == NULL || ret_frame.sp() == NULL ) {
if (ret_frame.pc() == nullptr || ret_frame.sp() == nullptr ) {
// CONTEXT wasn't useful
return false;
}
if (!ret_frame.safe_for_sender(this)) {
#if COMPILER2_OR_JVMCI
// C2 and JVMCI use ebp as a general register see if NULL fp helps
frame ret_frame2(ret_frame.sp(), NULL, ret_frame.pc());
// C2 and JVMCI use ebp as a general register see if null fp helps
frame ret_frame2(ret_frame.sp(), nullptr, ret_frame.pc());
if (!ret_frame2.safe_for_sender(this)) {
// nothing else to try if the frame isn't good
return false;

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Microsoft Corporation. All rights reserved.
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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,
address epc;
CONTEXT* uc = (CONTEXT*)ucVoid;
if (uc != NULL) {
if (uc != nullptr) {
epc = (address)uc->Pc;
if (ret_sp) *ret_sp = (intptr_t*)uc->Sp;
if (ret_fp) *ret_fp = (intptr_t*)uc->Fp;
} else {
// construct empty ExtendedPC for return value checking
epc = NULL;
if (ret_sp) *ret_sp = (intptr_t *)NULL;
if (ret_fp) *ret_fp = (intptr_t *)NULL;
epc = nullptr;
if (ret_sp) *ret_sp = (intptr_t *)nullptr;
if (ret_fp) *ret_fp = (intptr_t *)nullptr;
}
return epc;
}
@ -117,7 +117,7 @@ bool os::win32::get_frame_at_stack_banging_point(JavaThread* thread,
// more complex code with compiled code
assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above");
CodeBlob* cb = CodeCache::find_blob(pc);
if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) {
if (cb == nullptr || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) {
// Not sure where the pc points to, fallback to default
// stack overflow handling
return false;
@ -161,7 +161,7 @@ frame os::current_frame() {
// helper functions for fatal error handler
void os::print_context(outputStream *st, const void *context) {
if (context == NULL) return;
if (context == nullptr) return;
const CONTEXT* uc = (const CONTEXT*)context;
@ -207,7 +207,7 @@ void os::print_context(outputStream *st, const void *context) {
}
void os::print_tos_pc(outputStream *st, const void *context) {
if (context == NULL) return;
if (context == nullptr) return;
const CONTEXT* uc = (const CONTEXT*)context;
@ -225,7 +225,7 @@ void os::print_tos_pc(outputStream *st, const void *context) {
}
void os::print_register_info(outputStream *st, const void *context) {
if (context == NULL) return;
if (context == nullptr) return;
const CONTEXT* uc = (const CONTEXT*)context;

View File

@ -53,11 +53,11 @@ void VM_Version::get_os_cpu_info() {
}
{
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = NULL;
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = nullptr;
DWORD returnLength = 0;
// See https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getlogicalprocessorinformation
GetLogicalProcessorInformation(NULL, &returnLength);
GetLogicalProcessorInformation(nullptr, &returnLength);
assert(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected return from GetLogicalProcessorInformation");
buffer = (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION)os::malloc(returnLength, mtInternal);
@ -81,9 +81,9 @@ void VM_Version::get_os_cpu_info() {
{
char* buf = ::getenv("PROCESSOR_IDENTIFIER");
if (buf && strstr(buf, "Ampere(TM)") != NULL) {
if (buf && strstr(buf, "Ampere(TM)") != nullptr) {
_cpu = CPU_AMCC;
} else if (buf && strstr(buf, "Cavium Inc.") != NULL) {
} else if (buf && strstr(buf, "Cavium Inc.") != nullptr) {
_cpu = CPU_CAVIUM;
} else {
log_info(os)("VM_Version: unknown CPU model");
@ -100,7 +100,7 @@ void VM_Version::get_os_cpu_info() {
}
void VM_Version::get_compatible_board(char *buf, int buflen) {
assert(buf != NULL, "invalid argument");
assert(buf != nullptr, "invalid argument");
assert(buflen >= 1, "invalid argument");
*buf = '\0';
}