8300651: Replace NULL with nullptr in share/runtime/

Reviewed-by: rehn, dholmes
This commit is contained in:
Johan Sjölen 2023-01-25 10:30:02 +00:00
parent 3c61d5aa48
commit 71107f4648
112 changed files with 2058 additions and 2058 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -107,7 +107,7 @@ int compare_methods(Method** a, Method** b) {
void collect_profiled_methods(Method* m) {
Thread* thread = Thread::current();
methodHandle mh(thread, m);
if ((m->method_data() != NULL) &&
if ((m->method_data() != nullptr) &&
(PrintMethodData || CompilerOracle::should_print(mh))) {
collected_profiled_methods->push(m);
}
@ -132,7 +132,7 @@ void print_method_profiling_data() {
tty->print_cr(" mdo size: %d bytes", m->method_data()->size_in_bytes());
tty->cr();
// Dump data on parameters if any
if (m->method_data() != NULL && m->method_data()->parameters_type_data() != NULL) {
if (m->method_data() != nullptr && m->method_data()->parameters_type_data() != nullptr) {
tty->fill_to(2);
m->method_data()->parameters_type_data()->print_data_on(tty);
}
@ -295,7 +295,7 @@ void print_statistics() {
// CodeHeap State Analytics.
if (PrintCodeHeapAnalytics) {
CompileBroker::print_heapinfo(NULL, "all", 4096); // details
CompileBroker::print_heapinfo(nullptr, "all", 4096); // details
}
if (PrintCodeCache2) {
@ -360,7 +360,7 @@ void print_statistics() {
// CodeHeap State Analytics.
if (PrintCodeHeapAnalytics) {
CompileBroker::print_heapinfo(NULL, "all", 4096); // details
CompileBroker::print_heapinfo(nullptr, "all", 4096); // details
}
#ifdef COMPILER2
@ -491,7 +491,7 @@ void before_exit(JavaThread* thread, bool halt) {
#if INCLUDE_CDS
if (DynamicArchive::should_dump_at_vm_exit()) {
assert(ArchiveClassesAtExit != NULL, "Must be already set");
assert(ArchiveClassesAtExit != nullptr, "Must be already set");
ExceptionMark em(thread);
DynamicArchive::dump(ArchiveClassesAtExit, thread);
if (thread->has_pending_exception()) {
@ -527,8 +527,8 @@ void before_exit(JavaThread* thread, bool halt) {
void vm_exit(int code) {
Thread* thread =
ThreadLocalStorage::is_initialized() ? Thread::current_or_null() : NULL;
if (thread == NULL) {
ThreadLocalStorage::is_initialized() ? Thread::current_or_null() : nullptr;
if (thread == nullptr) {
// very early initialization failure -- just exit
vm_direct_exit(code);
}
@ -538,7 +538,7 @@ void vm_exit(int code) {
// XML termination logging safe is tied to the termination of the
// VMThread, and it doesn't terminate on this exit path. See 8222534.
if (VMThread::vm_thread() != NULL) {
if (VMThread::vm_thread() != nullptr) {
if (thread->is_Java_thread()) {
// We must be "in_vm" for the code below to work correctly.
// Historically there must have been some exit path for which
@ -589,7 +589,7 @@ void vm_direct_exit(int code, const char* message) {
void vm_perform_shutdown_actions() {
if (is_init_completed()) {
Thread* thread = Thread::current_or_null();
if (thread != NULL && thread->is_Java_thread()) {
if (thread != nullptr && thread->is_Java_thread()) {
// We are leaving the VM, set state to native (in case any OS exit
// handlers call back to the VM)
JavaThread* jt = JavaThread::cast(thread);
@ -622,10 +622,10 @@ void vm_abort(bool dump_core) {
}
void vm_notify_during_cds_dumping(const char* error, const char* message) {
if (error != NULL) {
if (error != nullptr) {
tty->print_cr("Error occurred during CDS dumping");
tty->print("%s", error);
if (message != NULL) {
if (message != nullptr) {
tty->print_cr(": %s", message);
}
else {
@ -642,10 +642,10 @@ void vm_exit_during_cds_dumping(const char* error, const char* message) {
}
void vm_notify_during_shutdown(const char* error, const char* message) {
if (error != NULL) {
if (error != nullptr) {
tty->print_cr("Error occurred during initialization of VM");
tty->print("%s", error);
if (message != NULL) {
if (message != nullptr) {
tty->print_cr(": %s", message);
}
else {
@ -658,7 +658,7 @@ void vm_notify_during_shutdown(const char* error, const char* message) {
}
void vm_exit_during_initialization() {
vm_notify_during_shutdown(NULL, NULL);
vm_notify_during_shutdown(nullptr, nullptr);
// Failure during initialization, we don't want to dump core
vm_abort(false);
@ -669,13 +669,13 @@ void vm_exit_during_initialization(Handle exception) {
// If there are exceptions on this thread it must be cleared
// first and here. Any future calls to EXCEPTION_MARK requires
// that no pending exceptions exist.
JavaThread* THREAD = JavaThread::current(); // can't be NULL
JavaThread* THREAD = JavaThread::current(); // can't be null
if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION;
}
java_lang_Throwable::print_stack_trace(exception, tty);
tty->cr();
vm_notify_during_shutdown(NULL, NULL);
vm_notify_during_shutdown(nullptr, nullptr);
// Failure during initialization, we don't want to dump core
vm_abort(false);