From 4f16161607edbf69f423ced1d3c24f7af058d46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Sj=C3=B6len?= Date: Wed, 31 May 2023 09:19:47 +0000 Subject: [PATCH] 8309044: Replace NULL with nullptr, final sweep of hotspot code Reviewed-by: stefank, dholmes, kvn, amitkumar --- .../aarch64/jvmciCodeInstaller_aarch64.cpp | 4 +-- src/hotspot/cpu/ppc/macroAssembler_ppc.hpp | 2 +- src/hotspot/cpu/ppc/stubGenerator_ppc.cpp | 2 +- src/hotspot/cpu/ppc/templateTable_ppc_64.cpp | 2 +- src/hotspot/cpu/riscv/codeBuffer_riscv.cpp | 2 +- .../gc/shared/barrierSetAssembler_riscv.cpp | 2 +- src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 4 +-- .../x86/gc/shared/barrierSetAssembler_x86.cpp | 2 +- src/hotspot/cpu/x86/interp_masm_x86.cpp | 2 +- .../cpu/x86/jvmciCodeInstaller_x86.cpp | 2 +- src/hotspot/share/adlc/output_c.cpp | 10 +++---- src/hotspot/share/cds/filemap.cpp | 2 +- src/hotspot/share/classfile/stringTable.hpp | 2 +- src/hotspot/share/code/compiledIC.hpp | 4 +-- src/hotspot/share/compiler/compileBroker.cpp | 2 +- src/hotspot/share/gc/x/xBarrier.cpp | 2 +- src/hotspot/share/gc/x/xBarrierSet.inline.hpp | 2 +- src/hotspot/share/gc/x/xPageTable.inline.hpp | 2 +- src/hotspot/share/gc/z/zHeap.cpp | 4 +-- .../share/interpreter/linkResolver.cpp | 2 +- src/hotspot/share/jfr/dcmd/jfrDcmds.hpp | 4 +-- .../checkpoint/types/jfrThreadState.cpp | 2 +- .../jfr/recorder/repository/jfrRepository.cpp | 2 +- .../jfr/recorder/stringpool/jfrStringPool.cpp | 2 +- src/hotspot/share/jvmci/jvmciEnv.cpp | 2 +- src/hotspot/share/logging/logAsyncWriter.cpp | 2 +- .../share/logging/logConfiguration.cpp | 2 +- .../share/logging/logConfiguration.hpp | 2 +- .../share/logging/logMessageBuffer.hpp | 2 +- src/hotspot/share/logging/logStream.hpp | 2 +- src/hotspot/share/memory/metaspace.cpp | 2 +- .../share/memory/metaspace/metachunk.cpp | 2 +- .../share/memory/metaspace/metaspaceArena.cpp | 2 +- src/hotspot/share/memory/universe.cpp | 2 +- src/hotspot/share/memory/virtualspace.cpp | 2 +- src/hotspot/share/oops/cpCache.cpp | 6 ++--- src/hotspot/share/opto/runtime.cpp | 2 +- src/hotspot/share/prims/jvmtiAgent.cpp | 2 +- src/hotspot/share/prims/jvmtiThreadState.cpp | 2 +- src/hotspot/share/prims/whitebox.cpp | 4 +-- src/hotspot/share/runtime/fieldDescriptor.cpp | 4 +-- src/hotspot/share/runtime/globals.hpp | 26 +++++++++---------- src/hotspot/share/runtime/handles.hpp | 4 +-- src/hotspot/share/runtime/jniHandles.cpp | 2 +- .../share/runtime/jniHandles.inline.hpp | 2 +- src/hotspot/share/runtime/objectMonitor.cpp | 6 ++--- src/hotspot/share/runtime/os.cpp | 2 +- src/hotspot/share/runtime/safepoint.cpp | 2 +- src/hotspot/share/runtime/thread.cpp | 2 +- src/hotspot/share/runtime/thread.hpp | 2 +- src/hotspot/share/runtime/threadSMR.cpp | 6 ++--- src/hotspot/share/runtime/vmOperations.cpp | 2 +- src/hotspot/share/services/threadService.cpp | 2 +- .../utilities/concurrentHashTable.inline.hpp | 2 +- src/hotspot/share/utilities/copy.cpp | 4 +-- src/hotspot/share/utilities/elfFile.cpp | 2 +- .../share/utilities/elfFuncDescTable.hpp | 2 +- src/hotspot/share/utilities/exceptions.cpp | 4 +-- .../share/utilities/globalDefinitions_gcc.hpp | 2 +- src/hotspot/share/utilities/linkedlist.hpp | 4 +-- src/hotspot/share/utilities/lockFreeStack.hpp | 4 +-- .../share/utilities/nonblockingQueue.hpp | 8 +++--- .../utilities/nonblockingQueue.inline.hpp | 18 ++++++------- src/hotspot/share/utilities/ostream.cpp | 6 ++--- src/hotspot/share/utilities/unsigned5.hpp | 2 +- src/hotspot/share/utilities/utf8.hpp | 2 +- src/hotspot/share/utilities/vmError.hpp | 2 +- 67 files changed, 114 insertions(+), 114 deletions(-) diff --git a/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp b/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp index 16741299f8a..82f5f994c52 100644 --- a/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp @@ -122,7 +122,7 @@ void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong forei } void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &cbuf, methodHandle& method, jint pc_offset, JVMCI_TRAPS) { - NativeCall* call = NULL; + NativeCall* call = nullptr; switch (_next_call_type) { case INLINE_INVOKE: return; @@ -155,7 +155,7 @@ void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &cbuf, methodHandle& metho if (Continuations::enabled()) { // Check for proper post_call_nop NativePostCallNop* nop = nativePostCallNop_at(call->next_instruction_address()); - if (nop == NULL) { + if (nop == nullptr) { JVMCI_ERROR("missing post call nop at offset %d", pc_offset); } else { _instructions->relocate(call->next_instruction_address(), relocInfo::post_call_nop_type); diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp index cedc764fdbd..d8bc8018a58 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp @@ -732,7 +732,7 @@ class MacroAssembler: public Assembler { // Load/Store klass oop from klass field. Compress. void load_klass(Register dst, Register src); - void load_klass_check_null(Register dst, Register src, Label* is_null = NULL); + void load_klass_check_null(Register dst, Register src, Label* is_null = nullptr); void store_klass(Register dst_oop, Register klass, Register tmp = R0); void store_klass_gap(Register dst_oop, Register val = noreg); // Will store 0 if val not specified. diff --git a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp index ad81348e7fa..2e9e18bd8db 100644 --- a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp @@ -4697,7 +4697,7 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_call_stub_entry = generate_call_stub(StubRoutines::_call_stub_return_address); StubRoutines::_catch_exception_entry = generate_catch_exception(); - if (UnsafeCopyMemory::_table == NULL) { + if (UnsafeCopyMemory::_table == nullptr) { UnsafeCopyMemory::create_table(8); } diff --git a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp index 1ceed5f6e12..006896c9f9b 100644 --- a/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp @@ -2294,7 +2294,7 @@ void TemplateTable::load_invokedynamic_entry(Register method) { __ load_resolved_indy_entry(cache, index); __ ld_ptr(method, array_base_offset + in_bytes(ResolvedIndyEntry::method_offset()), cache); - // The invokedynamic is unresolved iff method is NULL + // The invokedynamic is unresolved iff method is null __ cmpdi(CCR0, method, 0); __ bne(CCR0, resolved); diff --git a/src/hotspot/cpu/riscv/codeBuffer_riscv.cpp b/src/hotspot/cpu/riscv/codeBuffer_riscv.cpp index 348d38bc068..d62d595e4bc 100644 --- a/src/hotspot/cpu/riscv/codeBuffer_riscv.cpp +++ b/src/hotspot/cpu/riscv/codeBuffer_riscv.cpp @@ -71,7 +71,7 @@ static bool emit_shared_trampolines(CodeBuffer* cb, CodeBuffer::SharedTrampoline assert(requests->number_of_entries() >= 1, "at least one"); const int total_requested_size = MacroAssembler::max_trampoline_stub_size() * requests->number_of_entries(); - if (cb->stubs()->maybe_expand_to_ensure_remaining(total_requested_size) && cb->blob() == NULL) { + if (cb->stubs()->maybe_expand_to_ensure_remaining(total_requested_size) && cb->blob() == nullptr) { return false; } diff --git a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp index b6e52b69248..ed045c37a6f 100644 --- a/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp @@ -371,5 +371,5 @@ void BarrierSetAssembler::check_oop(MacroAssembler* masm, Register obj, Register // Make sure klass is 'reasonable', which is not zero. __ load_klass(obj, obj, tmp1); // get klass - __ beqz(obj, error); // if klass is NULL it is broken + __ beqz(obj, error); // if klass is null it is broken } diff --git a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp index f1c8173b634..0112de0584c 100644 --- a/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp @@ -4011,7 +4011,7 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_forward_exception_entry = generate_forward_exception(); - if (UnsafeCopyMemory::_table == NULL) { + if (UnsafeCopyMemory::_table == nullptr) { UnsafeCopyMemory::create_table(8); } @@ -4069,7 +4069,7 @@ class StubGenerator: public StubCodeGenerator { generate_arraycopy_stubs(); BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); - if (bs_nm != NULL) { + if (bs_nm != nullptr) { StubRoutines::riscv::_method_entry_barrier = generate_method_entry_barrier(); } diff --git a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp index ea10ec432e6..6a7ac54f473 100644 --- a/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp @@ -486,5 +486,5 @@ void BarrierSetAssembler::check_oop(MacroAssembler* masm, Register obj, Register // make sure klass is 'reasonable', which is not zero. __ load_klass(obj, obj, tmp1); // get klass __ testptr(obj, obj); - __ jcc(Assembler::zero, error); // if klass is NULL it is broken + __ jcc(Assembler::zero, error); // if klass is null it is broken } diff --git a/src/hotspot/cpu/x86/interp_masm_x86.cpp b/src/hotspot/cpu/x86/interp_masm_x86.cpp index 76fd10a5c9e..fc5056d2d93 100644 --- a/src/hotspot/cpu/x86/interp_masm_x86.cpp +++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp @@ -300,7 +300,7 @@ void InterpreterMacroAssembler::call_VM_base(Register oop_result, cmpptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); jcc(Assembler::equal, L); stop("InterpreterMacroAssembler::call_VM_base:" - " last_sp != nullptr"); + " last_sp isn't null"); bind(L); } #endif /* ASSERT */ diff --git a/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp b/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp index eadd9ebda59..1404617e8e7 100644 --- a/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp +++ b/src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp @@ -188,7 +188,7 @@ void CodeInstaller::pd_relocate_JavaMethod(CodeBuffer &, methodHandle& method, j if (Continuations::enabled()) { // Check for proper post_call_nop NativePostCallNop* nop = nativePostCallNop_at(call->next_instruction_address()); - if (nop == NULL) { + if (nop == nullptr) { JVMCI_ERROR("missing post call nop at offset %d", pc_offset); } else { _instructions->relocate(call->next_instruction_address(), relocInfo::post_call_nop_type); diff --git a/src/hotspot/share/adlc/output_c.cpp b/src/hotspot/share/adlc/output_c.cpp index fd68e6c016b..b0c4e7eff6b 100644 --- a/src/hotspot/share/adlc/output_c.cpp +++ b/src/hotspot/share/adlc/output_c.cpp @@ -276,7 +276,7 @@ static int pipeline_res_stages_initializer( int commentlen = 0; int max_stage = 0; i = 0; - for (pipeline->_reslist.reset(); (resource = pipeline->_reslist.iter()) != NULL;) { + for (pipeline->_reslist.reset(); (resource = pipeline->_reslist.iter()) != nullptr;) { if (pipeline->_resdict[resource]->is_resource()->is_discrete()) { if (res_stages[i] == 0) { if (max_stage < 9) { @@ -302,7 +302,7 @@ static int pipeline_res_stages_initializer( templen = 0; i = 0; - for (pipeline->_reslist.reset(); (resource = pipeline->_reslist.iter()) != NULL;) { + for (pipeline->_reslist.reset(); (resource = pipeline->_reslist.iter()) != nullptr;) { if (pipeline->_resdict[resource]->is_resource()->is_discrete()) { const char* const resname = res_stages[i] == 0 ? "undefined" : pipeline->_stages.name(res_stages[i] - 1); @@ -365,7 +365,7 @@ static int pipeline_res_cycles_initializer( const char* resource; i = 0; - for (pipeline->_reslist.reset(); (resource = pipeline->_reslist.iter()) != NULL;) { + for (pipeline->_reslist.reset(); (resource = pipeline->_reslist.iter()) != nullptr;) { if (pipeline->_resdict[resource]->is_resource()->is_discrete()) { if (max_cycles < res_cycles[i]) { max_cycles = res_cycles[i]; @@ -390,7 +390,7 @@ static int pipeline_res_cycles_initializer( templen = 0; i = 0; - for (pipeline->_reslist.reset(); (resource = pipeline->_reslist.iter()) != NULL;) { + for (pipeline->_reslist.reset(); (resource = pipeline->_reslist.iter()) != nullptr;) { if (pipeline->_resdict[resource]->is_resource()->is_discrete()) { templen += snprintf_checked(&resource_cycles[templen], resource_cycles_size - templen, " %*d%c // %s\n", cyclelen, res_cycles[i], (i < pipeline->_rescount-1) ? ',' : ' ', resource); @@ -1006,7 +1006,7 @@ void ArchDesc::build_pipe_classes(FILE *fp_cpp) { // Don't add compound resources to the list of resource names const char* resource; i = 0; - for (_pipeline->_reslist.reset(); (resource = _pipeline->_reslist.iter()) != NULL;) { + for (_pipeline->_reslist.reset(); (resource = _pipeline->_reslist.iter()) != nullptr;) { if (_pipeline->_resdict[resource]->is_resource()->is_discrete()) { fprintf(fp_cpp, " \"%s\"%c", resource, i < _pipeline->_rescount - 1 ? ',' : ' '); i++; diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index 0d61f51d539..b8fe625d12a 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -360,7 +360,7 @@ void SharedClassPathEntry::set_name(const char* name, TRAPS) { } void SharedClassPathEntry::copy_from(SharedClassPathEntry* ent, ClassLoaderData* loader_data, TRAPS) { - assert(ent != NULL, "sanity"); + assert(ent != nullptr, "sanity"); _type = ent->_type; _is_module_path = ent->_is_module_path; _timestamp = ent->_timestamp; diff --git a/src/hotspot/share/classfile/stringTable.hpp b/src/hotspot/share/classfile/stringTable.hpp index 9549a8ce009..1b41c12ffed 100644 --- a/src/hotspot/share/classfile/stringTable.hpp +++ b/src/hotspot/share/classfile/stringTable.hpp @@ -147,7 +147,7 @@ private: static oop lookup_shared(const jchar* name, int len) NOT_CDS_JAVA_HEAP_RETURN_(nullptr); static size_t shared_entry_count() NOT_CDS_JAVA_HEAP_RETURN_(0); static void allocate_shared_strings_array(TRAPS) NOT_CDS_JAVA_HEAP_RETURN; - static oop init_shared_table(const DumpedInternedStrings* dumped_interned_strings) NOT_CDS_JAVA_HEAP_RETURN_(NULL); + static oop init_shared_table(const DumpedInternedStrings* dumped_interned_strings) NOT_CDS_JAVA_HEAP_RETURN_(nullptr); static void set_shared_strings_array_index(int root_index) NOT_CDS_JAVA_HEAP_RETURN; static void serialize_shared_table_header(SerializeClosure* soc) NOT_CDS_JAVA_HEAP_RETURN; diff --git a/src/hotspot/share/code/compiledIC.hpp b/src/hotspot/share/code/compiledIC.hpp index 22400da6469..17586fc57a0 100644 --- a/src/hotspot/share/code/compiledIC.hpp +++ b/src/hotspot/share/code/compiledIC.hpp @@ -90,7 +90,7 @@ class CompiledICInfo : public StackObj { Metadata* cached_metadata() const { assert(!_is_icholder, ""); return (Metadata*)_cached_value; } CompiledICHolder* claim_cached_icholder() { assert(_is_icholder, ""); - assert(_cached_value != nullptr, "must be non-nullptr"); + assert(_cached_value != nullptr, "must be non-null"); _release_icholder = false; CompiledICHolder* icholder = (CompiledICHolder*)_cached_value; icholder->claim(); @@ -339,7 +339,7 @@ class CompiledStaticCall : public ResourceObj { public: // Code - // Returns NULL if CodeBuffer::expand fails + // Returns null if CodeBuffer::expand fails static address emit_to_interp_stub(CodeBuffer &cbuf, address mark = nullptr); static int to_interp_stub_size(); static int to_trampoline_stub_size(); diff --git a/src/hotspot/share/compiler/compileBroker.cpp b/src/hotspot/share/compiler/compileBroker.cpp index 9c9483353a4..de8cce86578 100644 --- a/src/hotspot/share/compiler/compileBroker.cpp +++ b/src/hotspot/share/compiler/compileBroker.cpp @@ -385,7 +385,7 @@ CompileTask* CompileQueue::get(CompilerThread* thread) { methodHandle save_hot_method; MonitorLocker locker(MethodCompileQueue_lock); - // If _first is nullptr we have no more compile jobs. There are two reasons for + // If _first is null we have no more compile jobs. There are two reasons for // having no compile jobs: First, we compiled everything we wanted. Second, // we ran out of code cache so compilation has been disabled. In the latter // case we perform code cache sweeps to free memory such that we can re-enable diff --git a/src/hotspot/share/gc/x/xBarrier.cpp b/src/hotspot/share/gc/x/xBarrier.cpp index b565df34827..726950092b2 100644 --- a/src/hotspot/share/gc/x/xBarrier.cpp +++ b/src/hotspot/share/gc/x/xBarrier.cpp @@ -239,7 +239,7 @@ oop XBarrier::load_barrier_on_phantom_oop_field_preloaded(volatile narrowOop* p, oop XBarrier::weak_load_barrier_on_oop_field_preloaded(volatile narrowOop* p, oop o) { ShouldNotReachHere(); - return NULL; + return nullptr; } oop XBarrier::weak_load_barrier_on_weak_oop_field_preloaded(volatile narrowOop* p, oop o) { diff --git a/src/hotspot/share/gc/x/xBarrierSet.inline.hpp b/src/hotspot/share/gc/x/xBarrierSet.inline.hpp index 5f034b8328b..3d92c38647d 100644 --- a/src/hotspot/share/gc/x/xBarrierSet.inline.hpp +++ b/src/hotspot/share/gc/x/xBarrierSet.inline.hpp @@ -184,7 +184,7 @@ inline bool XBarrierSet::AccessBarrier::oop_arraycopy_i if (!HasDecorator::value) { // No check cast, bulk barrier and bulk copy XBarrier::load_barrier_on_oop_array(src, length); - return Raw::oop_arraycopy_in_heap(nullptr, 0, src, NULL, 0, dst, length); + return Raw::oop_arraycopy_in_heap(nullptr, 0, src, nullptr, 0, dst, length); } // Check cast and copy each elements diff --git a/src/hotspot/share/gc/x/xPageTable.inline.hpp b/src/hotspot/share/gc/x/xPageTable.inline.hpp index 49fe8ecfddc..65ad223e334 100644 --- a/src/hotspot/share/gc/x/xPageTable.inline.hpp +++ b/src/hotspot/share/gc/x/xPageTable.inline.hpp @@ -40,7 +40,7 @@ inline XPageTableIterator::XPageTableIterator(const XPageTable* page_table) : inline bool XPageTableIterator::next(XPage** page) { for (XPage* entry; _iter.next(&entry);) { - if (entry != NULL && entry != _prev) { + if (entry != nullptr && entry != _prev) { // Next page found *page = _prev = entry; return true; diff --git a/src/hotspot/share/gc/z/zHeap.cpp b/src/hotspot/share/gc/z/zHeap.cpp index 35e6b27bd59..8ddea996e4b 100644 --- a/src/hotspot/share/gc/z/zHeap.cpp +++ b/src/hotspot/share/gc/z/zHeap.cpp @@ -380,7 +380,7 @@ bool ZHeap::print_location(outputStream* st, zaddress addr) const { st->print(PTR_FORMAT " is a zaddress: ", untype(addr)); if (addr == zaddress::null) { - st->print_raw_cr("NULL"); + st->print_raw_cr("null"); return true; } @@ -435,7 +435,7 @@ bool ZHeap::print_location(outputStream* st, zpointer ptr) const { const zaddress addr = ZPointer::uncolor(ptr); if (addr == zaddress::null) { - st->print_raw_cr("NULL"); + st->print_raw_cr("null"); return true; } diff --git a/src/hotspot/share/interpreter/linkResolver.cpp b/src/hotspot/share/interpreter/linkResolver.cpp index 67ffe9e48ea..533f6d62a8e 100644 --- a/src/hotspot/share/interpreter/linkResolver.cpp +++ b/src/hotspot/share/interpreter/linkResolver.cpp @@ -813,7 +813,7 @@ static void trace_method_resolution(const char* prefix, } st->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ", prefix, - (klass == nullptr ? "" : klass->internal_name()), + (klass == nullptr ? "" : klass->internal_name()), resolved_klass->internal_name(), Method::name_and_sig_as_C_string(resolved_klass, method->name(), diff --git a/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp b/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp index e99dc99c8d1..ad58c1c16c3 100644 --- a/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp +++ b/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp @@ -159,7 +159,7 @@ class JfrViewFlightRecordingDCmd : public JfrDCmd { return "Medium"; } static const JavaPermission permission() { - JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL}; + JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", nullptr}; return p; } virtual const char* javaClass() const { @@ -184,7 +184,7 @@ class JfrQueryFlightRecordingDCmd : public JfrDCmd { return "Medium"; } static const JavaPermission permission() { - JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", NULL}; + JavaPermission p = {"java.lang.management.ManagementPermission", "monitor", nullptr}; return p; } virtual const char* javaClass() const { diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp index 08fe29e905e..9e0ee0ad9af 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp @@ -122,7 +122,7 @@ const char* get_java_thread_name(const JavaThread* jt, int& length, oop vthread) name_str = java_lang_String::as_utf8_string(name, length); } } - assert(name_str != nullptr, "unexpected nullptr thread name"); + assert(name_str != nullptr, "unexpected null thread name"); return name_str; } diff --git a/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp b/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp index 76ae5bdba66..3bd1157ac35 100644 --- a/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp +++ b/src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp @@ -144,7 +144,7 @@ void JfrRepository::set_chunk_path(jstring path, JavaThread* jt) { ResourceMark rm(jt); const char* const canonical_chunk_path = JfrJavaSupport::c_str(path, jt); if (nullptr == canonical_chunk_path && !_chunkwriter->is_valid()) { - // new output is nullptr and current output is null + // new output is null and current output is null return; } instance().set_chunk_path(canonical_chunk_path); diff --git a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp index 6863b71f954..715f996c748 100644 --- a/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp +++ b/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp @@ -116,7 +116,7 @@ BufferPtr JfrStringPool::flush(BufferPtr old, size_t used, size_t requested, Thr migrate_outstanding_writes(old, new_buffer, used, requested); } release(old, thread); - return new_buffer; // might be nullptr + return new_buffer; // might be null } static const size_t lease_retry = 10; diff --git a/src/hotspot/share/jvmci/jvmciEnv.cpp b/src/hotspot/share/jvmci/jvmciEnv.cpp index b3888caf7f2..430b7a59262 100644 --- a/src/hotspot/share/jvmci/jvmciEnv.cpp +++ b/src/hotspot/share/jvmci/jvmciEnv.cpp @@ -363,7 +363,7 @@ bool JVMCIEnv::pending_exception_as_string(const char** to_string, const char** if (!is_hotspot()) { JNIAccessMark jni(this, THREAD); jthrowable ex = jni()->ExceptionOccurred(); - if (ex != NULL) { + if (ex != nullptr) { jni()->ExceptionClear(); jobjectArray pair = (jobjectArray) jni()->CallStaticObjectMethod( JNIJVMCI::HotSpotJVMCIRuntime::clazz(), diff --git a/src/hotspot/share/logging/logAsyncWriter.cpp b/src/hotspot/share/logging/logAsyncWriter.cpp index 7b992fa1d6f..25292503f3d 100644 --- a/src/hotspot/share/logging/logAsyncWriter.cpp +++ b/src/hotspot/share/logging/logAsyncWriter.cpp @@ -192,7 +192,7 @@ void AsyncLogWriter::initialize() { AsyncLogWriter* self = new AsyncLogWriter(); if (self->_initialized) { Atomic::release_store_fence(&AsyncLogWriter::_instance, self); - // All readers of _instance after the fence see non-nullptr. + // All readers of _instance after the fence see non-null. // We use LogOutputList's RCU counters to ensure all synchronous logsites have completed. // After that, we start AsyncLog Thread and it exclusively takes over all logging I/O. for (LogTagSet* ts = LogTagSet::first(); ts != nullptr; ts = ts->next()) { diff --git a/src/hotspot/share/logging/logConfiguration.cpp b/src/hotspot/share/logging/logConfiguration.cpp index 82372963024..ea8aaa1d733 100644 --- a/src/hotspot/share/logging/logConfiguration.cpp +++ b/src/hotspot/share/logging/logConfiguration.cpp @@ -478,7 +478,7 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr, const char* decoratorstr, const char* output_options, outputStream* errstream) { - assert(errstream != nullptr, "errstream can not be nullptr"); + assert(errstream != nullptr, "errstream can not be null"); if (outputstr == nullptr || strlen(outputstr) == 0) { outputstr = "stdout"; } diff --git a/src/hotspot/share/logging/logConfiguration.hpp b/src/hotspot/share/logging/logConfiguration.hpp index 4584ed18c09..f8f848cabea 100644 --- a/src/hotspot/share/logging/logConfiguration.hpp +++ b/src/hotspot/share/logging/logConfiguration.hpp @@ -61,7 +61,7 @@ class LogConfiguration : public AllStatic { static size_t _n_listener_callbacks; static bool _async_mode; - // Create a new output. Returns nullptr if failed. + // Create a new output. Returns null if failed. static LogOutput* new_output(const char* name, const char* options, outputStream* errstream); // Add an output to the list of configured outputs. Returns the assigned index. diff --git a/src/hotspot/share/logging/logMessageBuffer.hpp b/src/hotspot/share/logging/logMessageBuffer.hpp index 4008b5e5700..b1b8fe8cd2e 100644 --- a/src/hotspot/share/logging/logMessageBuffer.hpp +++ b/src/hotspot/share/logging/logMessageBuffer.hpp @@ -109,7 +109,7 @@ class LogMessageBuffer : public StackObj { // It is, however, possible to specify a prefix per LogMessageBuffer, // using set_prefix(). Lines added to the LogMessageBuffer after a prefix // function has been set will be prefixed automatically. - // Setting this to nullptr will disable prefixing. + // Setting this to null will disable prefixing. void set_prefix(size_t (*prefix_fn)(char*, size_t)) { _prefix_fn = prefix_fn; } diff --git a/src/hotspot/share/logging/logStream.hpp b/src/hotspot/share/logging/logStream.hpp index 3dffb8d1516..d02961cd8c8 100644 --- a/src/hotspot/share/logging/logStream.hpp +++ b/src/hotspot/share/logging/logStream.hpp @@ -100,7 +100,7 @@ public: LogStream(const LogTargetImpl& type_carrier) : LogStreamImpl(LogTargetHandle(level, LogTagSetMapping::tagset())) {} - // Constructor to support creation from typed (likely nullptr) pointer. Mostly used by the logging framework. + // Constructor to support creation from typed (likely null) pointer. Mostly used by the logging framework. // // LogStream stream(log.debug()); // or diff --git a/src/hotspot/share/memory/metaspace.cpp b/src/hotspot/share/memory/metaspace.cpp index db9579e4652..10524082f19 100644 --- a/src/hotspot/share/memory/metaspace.cpp +++ b/src/hotspot/share/memory/metaspace.cpp @@ -875,7 +875,7 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size, assert(word_size <= Metaspace::max_allocation_word_size(), "allocation size too large (" SIZE_FORMAT ")", word_size); - assert(loader_data != nullptr, "Should never pass around a nullptr loader_data. " + assert(loader_data != nullptr, "Should never pass around a null loader_data. " "ClassLoaderData::the_null_class_loader_data() should have been used."); // Deal with concurrent unloading failed allocation starvation diff --git a/src/hotspot/share/memory/metaspace/metachunk.cpp b/src/hotspot/share/memory/metaspace/metachunk.cpp index d3a0d559f38..bc514c856e7 100644 --- a/src/hotspot/share/memory/metaspace/metachunk.cpp +++ b/src/hotspot/share/memory/metaspace/metachunk.cpp @@ -277,7 +277,7 @@ void Metachunk::verify() const { word_size(), committed_words()); // Test base pointer - assert(base() != nullptr, "Base pointer nullptr"); + assert(base() != nullptr, "Base pointer null"); assert(vsnode() != nullptr, "No space"); vsnode()->check_pointer(base()); diff --git a/src/hotspot/share/memory/metaspace/metaspaceArena.cpp b/src/hotspot/share/memory/metaspace/metaspaceArena.cpp index b8739ca4f0f..ce7445260b8 100644 --- a/src/hotspot/share/memory/metaspace/metaspaceArena.cpp +++ b/src/hotspot/share/memory/metaspace/metaspaceArena.cpp @@ -343,7 +343,7 @@ MetaWord* MetaspaceArena::allocate_inner(size_t requested_word_size) { SOMETIMES(verify_locked();) if (p == nullptr) { - UL(info, "allocation failed, returned nullptr."); + UL(info, "allocation failed, returned null."); } else { UL2(trace, "after allocation: %u chunk(s), current:" METACHUNK_FULL_FORMAT, _chunks.count(), METACHUNK_FULL_FORMAT_ARGS(current_chunk())); diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp index ad87e988f3e..58c1792633e 100644 --- a/src/hotspot/share/memory/universe.cpp +++ b/src/hotspot/share/memory/universe.cpp @@ -466,7 +466,7 @@ void Universe::initialize_basic_type_mirrors(TRAPS) { for (int i = T_BOOLEAN; i < T_VOID+1; i++) { if (!is_reference_type((BasicType)i)) { oop m = _basic_type_mirrors[i].resolve(); - assert(m != nullptr, "archived mirrors should not be nullptr"); + assert(m != nullptr, "archived mirrors should not be null"); } } } else diff --git a/src/hotspot/share/memory/virtualspace.cpp b/src/hotspot/share/memory/virtualspace.cpp index de585cd0e11..4ce12b888a0 100644 --- a/src/hotspot/share/memory/virtualspace.cpp +++ b/src/hotspot/share/memory/virtualspace.cpp @@ -595,7 +595,7 @@ void ReservedHeapSpace::initialize_compressed_heap(const size_t size, size_t ali // Last, desperate try without any placement. if (_base == nullptr) { - log_trace(gc, heap, coops)("Trying to allocate at address nullptr heap of size " SIZE_FORMAT_X, size + noaccess_prefix); + log_trace(gc, heap, coops)("Trying to allocate at address null heap of size " SIZE_FORMAT_X, size + noaccess_prefix); initialize(size + noaccess_prefix, alignment, page_size, nullptr, false); } } diff --git a/src/hotspot/share/oops/cpCache.cpp b/src/hotspot/share/oops/cpCache.cpp index e62838c815e..23b3ee0d49c 100644 --- a/src/hotspot/share/oops/cpCache.cpp +++ b/src/hotspot/share/oops/cpCache.cpp @@ -885,7 +885,7 @@ oop ConstantPoolCache::set_dynamic_call(const CallInfo &call_info, int index) { const Handle appendix = call_info.resolved_appendix(); const bool has_appendix = appendix.not_null(); - LogStream* log_stream = NULL; + LogStream* log_stream = nullptr; LogStreamHandle(Debug, methodhandles, indy) lsh_indy; if (lsh_indy.is_enabled()) { ResourceMark rm; @@ -903,7 +903,7 @@ oop ConstantPoolCache::set_dynamic_call(const CallInfo &call_info, int index) { const int appendix_index = resolved_indy_entry_at(index)->resolved_references_index(); objArrayOop resolved_references = constant_pool()->resolved_references(); assert(appendix_index >= 0 && appendix_index < resolved_references->length(), "oob"); - assert(resolved_references->obj_at(appendix_index) == NULL, "init just once"); + assert(resolved_references->obj_at(appendix_index) == nullptr, "init just once"); resolved_references->obj_at_put(appendix_index, appendix()); } @@ -911,7 +911,7 @@ oop ConstantPoolCache::set_dynamic_call(const CallInfo &call_info, int index) { assert(resolved_indy_entries() != nullptr, "Invokedynamic array is empty, cannot fill with resolved information"); resolved_indy_entry_at(index)->fill_in(adapter, adapter->size_of_parameters(), as_TosState(adapter->result_type()), has_appendix); - if (log_stream != NULL) { + if (log_stream != nullptr) { resolved_indy_entry_at(index)->print_on(log_stream); } return appendix(); diff --git a/src/hotspot/share/opto/runtime.cpp b/src/hotspot/share/opto/runtime.cpp index 6cc044962c2..c332f4d2905 100644 --- a/src/hotspot/share/opto/runtime.cpp +++ b/src/hotspot/share/opto/runtime.cpp @@ -488,7 +488,7 @@ const TypeFunc *OptoRuntime::notify_jvmti_vthread_Type() { // no result type needed fields = TypeTuple::fields(1); - fields[TypeFunc::Parms+0] = NULL; // void + fields[TypeFunc::Parms+0] = nullptr; // void const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); return TypeFunc::make(domain,range); diff --git a/src/hotspot/share/prims/jvmtiAgent.cpp b/src/hotspot/share/prims/jvmtiAgent.cpp index 36cbb049732..21dff2ca192 100644 --- a/src/hotspot/share/prims/jvmtiAgent.cpp +++ b/src/hotspot/share/prims/jvmtiAgent.cpp @@ -372,7 +372,7 @@ static bool invoke_JVM_OnLoad(JvmtiAgent* agent) { ThreadToNativeFromVM ttn(thread); HandleMark hm(thread); extern struct JavaVM_ main_vm; - const jint err = (*on_load_entry)(&main_vm, const_cast(agent->options()), NULL); + const jint err = (*on_load_entry)(&main_vm, const_cast(agent->options()), nullptr); if (err != JNI_OK) { vm_exit_during_initialization("-Xrun library failed to init", agent->name()); } diff --git a/src/hotspot/share/prims/jvmtiThreadState.cpp b/src/hotspot/share/prims/jvmtiThreadState.cpp index 23ee85abcd0..432bbba71af 100644 --- a/src/hotspot/share/prims/jvmtiThreadState.cpp +++ b/src/hotspot/share/prims/jvmtiThreadState.cpp @@ -245,7 +245,7 @@ JvmtiVTMSTransitionDisabler::print_info() { #endif // disable VTMS transitions for one virtual thread -// no-op if thread is non-NULL and not a virtual thread +// no-op if thread is non-null and not a virtual thread JvmtiVTMSTransitionDisabler::JvmtiVTMSTransitionDisabler(jthread thread) : _is_SR(false), _thread(thread) { diff --git a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp index 7d5b59b6e74..a1a0237765c 100644 --- a/src/hotspot/share/prims/whitebox.cpp +++ b/src/hotspot/share/prims/whitebox.cpp @@ -1882,7 +1882,7 @@ WB_END WB_ENTRY(jint, WB_getIndyInfoLength(JNIEnv* env, jobject wb, jclass klass)) InstanceKlass* ik = InstanceKlass::cast(java_lang_Class::as_Klass(JNIHandles::resolve(klass))); ConstantPool* cp = ik->constants(); - if (cp->cache() == NULL) { + if (cp->cache() == nullptr) { return -1; } return cp->resolved_indy_entries_length(); @@ -1891,7 +1891,7 @@ WB_END WB_ENTRY(jint, WB_getIndyCPIndex(JNIEnv* env, jobject wb, jclass klass, jint index)) InstanceKlass* ik = InstanceKlass::cast(java_lang_Class::as_Klass(JNIHandles::resolve(klass))); ConstantPool* cp = ik->constants(); - if (cp->cache() == NULL) { + if (cp->cache() == nullptr) { return -1; } return cp->resolved_indy_entry_at(index)->constant_pool_index(); diff --git a/src/hotspot/share/runtime/fieldDescriptor.cpp b/src/hotspot/share/runtime/fieldDescriptor.cpp index c2e063e8759..d326b79acfd 100644 --- a/src/hotspot/share/runtime/fieldDescriptor.cpp +++ b/src/hotspot/share/runtime/fieldDescriptor.cpp @@ -161,14 +161,14 @@ void fieldDescriptor::print_on_for(outputStream* st, oop obj) { if (obj->obj_field(offset()) != nullptr) { obj->obj_field(offset())->print_value_on(st); } else { - st->print("nullptr"); + st->print("null"); } break; case T_OBJECT: if (obj->obj_field(offset()) != nullptr) { obj->obj_field(offset())->print_value_on(st); } else { - st->print("nullptr"); + st->print("null"); } break; default: diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 1eb94377e62..5d48e41d1a6 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -547,7 +547,7 @@ const int ObjectAlignmentInBytes = 8; "Dump heap to file when java.lang.OutOfMemoryError is thrown " \ "from JVM") \ \ - product(ccstr, HeapDumpPath, nullptr, MANAGEABLE, \ + product(ccstr, HeapDumpPath, nullptr, MANAGEABLE, \ "When HeapDumpOnOutOfMemoryError is on, the path (filename or " \ "directory) of the dump file (defaults to java_pid.hprof " \ "in the working directory)") \ @@ -601,7 +601,7 @@ const int ObjectAlignmentInBytes = 8; product(bool, PrintAssembly, false, DIAGNOSTIC, \ "Print assembly code (using external disassembler.so)") \ \ - product(ccstr, PrintAssemblyOptions, nullptr, DIAGNOSTIC, \ + product(ccstr, PrintAssemblyOptions, nullptr, DIAGNOSTIC, \ "Print options string passed to disassembler.so") \ \ notproduct(bool, PrintNMethodStatistics, false, \ @@ -629,7 +629,7 @@ const int ObjectAlignmentInBytes = 8; "Exercise compiled exception handlers") \ \ develop(bool, InterceptOSException, false, \ - "Start debugger when an implicit OS (e.g. nullptr) " \ + "Start debugger when an implicit OS (e.g. null pointer) " \ "exception happens") \ \ product(bool, PrintCodeCache, false, \ @@ -835,7 +835,7 @@ const int ObjectAlignmentInBytes = 8; develop(bool, StressRewriter, false, \ "Stress linktime bytecode rewriting") \ \ - product(ccstr, TraceJVMTI, nullptr, \ + product(ccstr, TraceJVMTI, nullptr, \ "Trace flags for JVMTI functions and events") \ \ product(bool, StressLdcRewrite, false, DIAGNOSTIC, \ @@ -1025,11 +1025,11 @@ const int ObjectAlignmentInBytes = 8; product(bool, LogVMOutput, false, DIAGNOSTIC, \ "Save VM output to LogFile") \ \ - product(ccstr, LogFile, nullptr, DIAGNOSTIC, \ + product(ccstr, LogFile, nullptr, DIAGNOSTIC, \ "If LogVMOutput or LogCompilation is on, save VM output to " \ "this file [default: ./hotspot_pid%p.log] (%p replaced with pid)")\ \ - product(ccstr, ErrorFile, nullptr, \ + product(ccstr, ErrorFile, nullptr, \ "If an error occurs, save the error data to this file " \ "[default: ./hs_err_pid%p.log] (%p replaced with pid)") \ \ @@ -1066,11 +1066,11 @@ const int ObjectAlignmentInBytes = 8; notproduct(bool, PrintSymbolTableSizeHistogram, false, \ "print histogram of the symbol table") \ \ - product(ccstr, AbortVMOnException, nullptr, DIAGNOSTIC, \ + product(ccstr, AbortVMOnException, nullptr, DIAGNOSTIC, \ "Call fatal if this exception is thrown. Example: " \ "java -XX:AbortVMOnException=java.lang.NullPointerException Foo") \ \ - product(ccstr, AbortVMOnExceptionMessage, nullptr, DIAGNOSTIC, \ + product(ccstr, AbortVMOnExceptionMessage, nullptr, DIAGNOSTIC, \ "Call fatal if the exception pointed by AbortVMOnException " \ "has this message") \ \ @@ -1382,7 +1382,7 @@ const int ObjectAlignmentInBytes = 8; product(double, InlineFrequencyRatio, 0.25, DIAGNOSTIC, \ "Ratio of call site execution to caller method invocation") \ \ - product(double, MinInlineFrequencyRatio, 0.0085, DIAGNOSTIC, \ + product(double, MinInlineFrequencyRatio, 0.0085, DIAGNOSTIC, \ "Minimum ratio of call site execution to caller method" \ "invocation to be considered for inlining") \ \ @@ -1727,7 +1727,7 @@ const int ObjectAlignmentInBytes = 8; product(bool, PerfDataSaveToFile, false, \ "Save PerfData memory to hsperfdata_ file on exit") \ \ - product(ccstr, PerfDataSaveFile, nullptr, \ + product(ccstr, PerfDataSaveFile, nullptr, \ "Save PerfData memory to the specified absolute pathname. " \ "The string %p in the file name (if present) " \ "will be replaced by pid") \ @@ -1914,7 +1914,7 @@ const int ObjectAlignmentInBytes = 8; range(0, max_intx) \ constraint(InitArrayShortSizeConstraintFunc, AfterErgo) \ \ - product(ccstr, AllocateHeapAt, nullptr, \ + product(ccstr, AllocateHeapAt, nullptr, \ "Path to the directory where a temporary file will be created " \ "to use as the backing store for Java Heap.") \ \ @@ -1949,10 +1949,10 @@ const int ObjectAlignmentInBytes = 8; JFR_ONLY(product(bool, FlightRecorder, false, \ "(Deprecated) Enable Flight Recorder")) \ \ - JFR_ONLY(product(ccstr, FlightRecorderOptions, nullptr, \ + JFR_ONLY(product(ccstr, FlightRecorderOptions, nullptr, \ "Flight Recorder options")) \ \ - JFR_ONLY(product(ccstr, StartFlightRecording, nullptr, \ + JFR_ONLY(product(ccstr, StartFlightRecording, nullptr, \ "Start flight recording with options")) \ \ product(bool, UseFastUnorderedTimeStamps, false, EXPERIMENTAL, \ diff --git a/src/hotspot/share/runtime/handles.hpp b/src/hotspot/share/runtime/handles.hpp index 5cab1a25340..b57be73d6b3 100644 --- a/src/hotspot/share/runtime/handles.hpp +++ b/src/hotspot/share/runtime/handles.hpp @@ -68,7 +68,7 @@ class Handle { protected: oop obj() const { return _handle == nullptr ? (oop)nullptr : *_handle; } - oop non_null_obj() const { assert(_handle != nullptr, "resolving nullptr handle"); return *_handle; } + oop non_null_obj() const { assert(_handle != nullptr, "resolving null handle"); return *_handle; } public: // Constructors @@ -144,7 +144,7 @@ DEF_HANDLE(typeArray , is_typeArray_noinline ) Thread* _thread; \ protected: \ type* obj() const { return _value; } \ - type* non_null_obj() const { assert(_value != nullptr, "resolving nullptr _value"); return _value; } \ + type* non_null_obj() const { assert(_value != nullptr, "resolving null _value"); return _value; } \ \ public: \ /* Constructors */ \ diff --git a/src/hotspot/share/runtime/jniHandles.cpp b/src/hotspot/share/runtime/jniHandles.cpp index bf7f0bc300d..feceec366a5 100644 --- a/src/hotspot/share/runtime/jniHandles.cpp +++ b/src/hotspot/share/runtime/jniHandles.cpp @@ -378,7 +378,7 @@ void JNIHandleBlock::release_block(JNIHandleBlock* block, JavaThread* thread) { while (block != nullptr) { JNIHandleBlock* next = block->_next; Atomic::dec(&_blocks_allocated); - assert(block->pop_frame_link() == nullptr, "pop_frame_link should be nullptr"); + assert(block->pop_frame_link() == nullptr, "pop_frame_link should be null"); delete block; block = next; } diff --git a/src/hotspot/share/runtime/jniHandles.inline.hpp b/src/hotspot/share/runtime/jniHandles.inline.hpp index 052ab138fef..3a80d7f66f2 100644 --- a/src/hotspot/share/runtime/jniHandles.inline.hpp +++ b/src/hotspot/share/runtime/jniHandles.inline.hpp @@ -113,7 +113,7 @@ inline bool JNIHandles::is_same_object(jobject handle1, jobject handle2) { inline oop JNIHandles::resolve_non_null(jobject handle) { assert(handle != nullptr, "JNI handle should not be null"); oop result = resolve_impl(handle); - assert(result != nullptr, "nullptr read from jni handle"); + assert(result != nullptr, "null read from jni handle"); return result; } diff --git a/src/hotspot/share/runtime/objectMonitor.cpp b/src/hotspot/share/runtime/objectMonitor.cpp index 525dd4b754b..9ed77a01bb6 100644 --- a/src/hotspot/share/runtime/objectMonitor.cpp +++ b/src/hotspot/share/runtime/objectMonitor.cpp @@ -536,7 +536,7 @@ bool ObjectMonitor::deflate_monitor() { } else { // Attempt async deflation protocol. - // Set a nullptr owner to DEFLATER_MARKER to force any contending thread + // Set a null owner to DEFLATER_MARKER to force any contending thread // through the slow path. This is just the first part of the async // deflation dance. if (try_set_owner_from(nullptr, DEFLATER_MARKER) != nullptr) { @@ -561,7 +561,7 @@ bool ObjectMonitor::deflate_monitor() { // to retry. This is the second part of the async deflation dance. if (Atomic::cmpxchg(&_contentions, 0, INT_MIN) != 0) { // Contentions was no longer 0 so we lost the race since the - // ObjectMonitor is now busy. Restore owner to nullptr if it is + // ObjectMonitor is now busy. Restore owner to null if it is // still DEFLATER_MARKER: if (try_set_owner_from(DEFLATER_MARKER, nullptr) != DEFLATER_MARKER) { // Deferred decrement for the JT EnterI() that cancelled the async deflation. @@ -666,7 +666,7 @@ const char* ObjectMonitor::is_busy_to_string(stringStream* ss) { if (!owner_is_DEFLATER_MARKER()) { ss->print("owner=" INTPTR_FORMAT, p2i(owner_raw())); } else { - // We report nullptr instead of DEFLATER_MARKER here because is_busy() + // We report null instead of DEFLATER_MARKER here because is_busy() // ignores DEFLATER_MARKER values. ss->print("owner=" INTPTR_FORMAT, NULL_WORD); } diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index 66b7e7a12e6..595aa00b6dd 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -1128,7 +1128,7 @@ void os::print_location(outputStream* st, intptr_t x, bool verbose) { address addr = (address)x; // Handle null first, so later checks don't need to protect against it. if (addr == nullptr) { - st->print_cr("0x0 is nullptr"); + st->print_cr("0x0 is null"); return; } diff --git a/src/hotspot/share/runtime/safepoint.cpp b/src/hotspot/share/runtime/safepoint.cpp index cfd1f3bbb1a..1d0997914c5 100644 --- a/src/hotspot/share/runtime/safepoint.cpp +++ b/src/hotspot/share/runtime/safepoint.cpp @@ -232,7 +232,7 @@ int SafepointSynchronize::synchronize_threads(jlong safepoint_limit_time, int no ThreadSafepointState **p_prev = &tss_head; for (; JavaThread *cur = jtiwh.next(); ) { ThreadSafepointState *cur_tss = cur->safepoint_state(); - assert(cur_tss->get_next() == nullptr, "Must be nullptr"); + assert(cur_tss->get_next() == nullptr, "Must be null"); if (thread_not_running(cur_tss)) { --still_running; } else { diff --git a/src/hotspot/share/runtime/thread.cpp b/src/hotspot/share/runtime/thread.cpp index 2fe528560c4..fd213086ccb 100644 --- a/src/hotspot/share/runtime/thread.cpp +++ b/src/hotspot/share/runtime/thread.cpp @@ -266,7 +266,7 @@ Thread::~Thread() { delete handle_area(); delete metadata_handles(); - // osthread() can be nullptr, if creation of thread failed. + // osthread() can be null, if creation of thread failed. if (osthread() != nullptr) os::free_thread(osthread()); // Clear Thread::current if thread is deleting itself and it has not diff --git a/src/hotspot/share/runtime/thread.hpp b/src/hotspot/share/runtime/thread.hpp index e813bc04c2a..80114ddf7ed 100644 --- a/src/hotspot/share/runtime/thread.hpp +++ b/src/hotspot/share/runtime/thread.hpp @@ -340,7 +340,7 @@ class Thread: public ThreadShadow { // and logging. virtual const char* type_name() const { return "Thread"; } - // Returns the current thread (ASSERTS if nullptr) + // Returns the current thread (ASSERTS if null) static inline Thread* current(); // Returns the current thread, or null if not attached static inline Thread* current_or_null(); diff --git a/src/hotspot/share/runtime/threadSMR.cpp b/src/hotspot/share/runtime/threadSMR.cpp index cffec545a66..d3676c44423 100644 --- a/src/hotspot/share/runtime/threadSMR.cpp +++ b/src/hotspot/share/runtime/threadSMR.cpp @@ -620,7 +620,7 @@ void SafeThreadsListPtr::verify_hazard_ptr_scanned() { // Shared singleton data for all ThreadsList(0) instances. // Used by _bootstrap_list to avoid static init time heap allocation. -// No real entries, just the final nullptr terminator. +// No real entries, just the final null terminator. static JavaThread* const empty_threads_list_data[1] = {}; // Result has 'entries + 1' elements, with the last being the null terminator. @@ -842,11 +842,11 @@ bool ThreadsListHandle::cv_internal_thread_to_JavaThread(jobject jthread, FastThreadsListHandle::FastThreadsListHandle(oop thread_oop, JavaThread* java_thread) : _protected_java_thread(nullptr) { assert(thread_oop != nullptr, "must be"); if (java_thread != nullptr) { - // We captured a non-nullptr JavaThread* before the _tlh was created + // We captured a non-null JavaThread* before the _tlh was created // so that covers the early life stage of the target JavaThread. _protected_java_thread = java_lang_Thread::thread(thread_oop); assert(_protected_java_thread == nullptr || _tlh.includes(_protected_java_thread), "must be"); - // If we captured a non-nullptr JavaThread* after the _tlh was created + // If we captured a non-null JavaThread* after the _tlh was created // then that covers the end life stage of the target JavaThread and we // we know that _tlh protects the JavaThread*. The underlying atomic // load is sufficient (no acquire necessary here). diff --git a/src/hotspot/share/runtime/vmOperations.cpp b/src/hotspot/share/runtime/vmOperations.cpp index a04ba757500..fefb96acc7a 100644 --- a/src/hotspot/share/runtime/vmOperations.cpp +++ b/src/hotspot/share/runtime/vmOperations.cpp @@ -332,7 +332,7 @@ void VM_ThreadDump::doit() { if (jt == nullptr || /* thread not alive */ jt->is_exiting() || jt->is_hidden_from_external_view()) { - // add a nullptr snapshot if skipped + // add a null snapshot if skipped _result->add_thread_snapshot(); continue; } diff --git a/src/hotspot/share/services/threadService.cpp b/src/hotspot/share/services/threadService.cpp index f61a34648d7..bae98f0aadf 100644 --- a/src/hotspot/share/services/threadService.cpp +++ b/src/hotspot/share/services/threadService.cpp @@ -1074,7 +1074,7 @@ void DeadlockCycle::print_on_with(ThreadsList * t_list, outputStream* st) const "Must be an AbstractOwnableSynchronizer"); oop ownerObj = java_util_concurrent_locks_AbstractOwnableSynchronizer::get_owner_threadObj(waitingToLockBlocker); currentThread = java_lang_Thread::thread(ownerObj); - assert(currentThread != nullptr, "AbstractOwnableSynchronizer owning thread is unexpectedly nullptr"); + assert(currentThread != nullptr, "AbstractOwnableSynchronizer owning thread is unexpectedly null"); } st->print_cr("%s \"%s\"", owner_desc, currentThread->name()); } diff --git a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp index b6a7eb09759..0d62a9f162e 100644 --- a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp +++ b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp @@ -1292,7 +1292,7 @@ inline bool ConcurrentHashTable:: if (!try_resize_lock(thread)) { return false; } - assert(_new_table == nullptr || _new_table == POISON_PTR, "Must be nullptr"); + assert(_new_table == nullptr || _new_table == POISON_PTR, "Must be null"); for (size_t bucket_it = 0; bucket_it < _table->_size; bucket_it++) { Bucket* bucket = _table->get_bucket(bucket_it); assert(!bucket->have_redirect() && !bucket->is_locked(), "Table must be uncontended"); diff --git a/src/hotspot/share/utilities/copy.cpp b/src/hotspot/share/utilities/copy.cpp index cc6e8189449..ef9840af6d4 100644 --- a/src/hotspot/share/utilities/copy.cpp +++ b/src/hotspot/share/utilities/copy.cpp @@ -68,8 +68,8 @@ public: */ template static void conjoint_swap_if_needed(const void* src, void* dst, size_t byte_count, size_t elem_size) { - assert(src != nullptr, "address must not be nullptr"); - assert(dst != nullptr, "address must not be nullptr"); + assert(src != nullptr, "address must not be null"); + assert(dst != nullptr, "address must not be null"); assert(elem_size == 2 || elem_size == 4 || elem_size == 8, "incorrect element size: " SIZE_FORMAT, elem_size); assert(is_aligned(byte_count, elem_size), diff --git a/src/hotspot/share/utilities/elfFile.cpp b/src/hotspot/share/utilities/elfFile.cpp index 487a19afe3b..2e26feec9a6 100644 --- a/src/hotspot/share/utilities/elfFile.cpp +++ b/src/hotspot/share/utilities/elfFile.cpp @@ -1824,7 +1824,7 @@ bool DwarfFile::MarkedDwarfFileReader::read_sleb128(int64_t* result, const int8_ return read_leb128((uint64_t*)result, check_size, true); } -// If result is a nullptr, we do not care about the content of the string being read. +// If result is a null, we do not care about the content of the string being read. bool DwarfFile::MarkedDwarfFileReader::read_string(char* result, const size_t result_len) { char first_char; if (!read_non_null_char(&first_char)) { diff --git a/src/hotspot/share/utilities/elfFuncDescTable.hpp b/src/hotspot/share/utilities/elfFuncDescTable.hpp index 77af92d1818..dbfd2a9ee4e 100644 --- a/src/hotspot/share/utilities/elfFuncDescTable.hpp +++ b/src/hotspot/share/utilities/elfFuncDescTable.hpp @@ -132,7 +132,7 @@ public: ElfFuncDescTable(FILE* file, Elf_Shdr shdr, int index); ~ElfFuncDescTable(); - // return the function address for the function descriptor at 'index' or nullptr on error + // return the function address for the function descriptor at 'index' or null on error address lookup(Elf_Word index); int get_index() const { return _index; }; diff --git a/src/hotspot/share/utilities/exceptions.cpp b/src/hotspot/share/utilities/exceptions.cpp index bd39c582ca2..fe4d849ffeb 100644 --- a/src/hotspot/share/utilities/exceptions.cpp +++ b/src/hotspot/share/utilities/exceptions.cpp @@ -135,14 +135,14 @@ bool Exceptions::special_exception(JavaThread* thread, const char* file, int lin // This method should only be called from generated code, // therefore the exception oop should be in the oopmap. void Exceptions::_throw_oop(JavaThread* thread, const char* file, int line, oop exception) { - assert(exception != nullptr, "exception should not be nullptr"); + assert(exception != nullptr, "exception should not be null"); Handle h_exception(thread, exception); _throw(thread, file, line, h_exception); } void Exceptions::_throw(JavaThread* thread, const char* file, int line, Handle h_exception, const char* message) { ResourceMark rm(thread); - assert(h_exception() != nullptr, "exception should not be nullptr"); + assert(h_exception() != nullptr, "exception should not be null"); // tracing (do this up front - so it works during boot strapping) // Note, the print_value_string() argument is not called unless logging is enabled! diff --git a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp index 11ffe72bd56..0d7b1164a6d 100644 --- a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp +++ b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp @@ -132,7 +132,7 @@ inline int g_isfinite(jdouble f) { return isfinite(f); } #endif // _LP64 // gcc warns about applying offsetof() to non-POD object or calculating -// offset directly when base address is NULL. The -Wno-invalid-offsetof +// offset directly when base address is null. The -Wno-invalid-offsetof // option could be used to suppress this warning, but we instead just // avoid the use of offsetof(). // diff --git a/src/hotspot/share/utilities/linkedlist.hpp b/src/hotspot/share/utilities/linkedlist.hpp index eeb8c6df44f..5b8e258d539 100644 --- a/src/hotspot/share/utilities/linkedlist.hpp +++ b/src/hotspot/share/utilities/linkedlist.hpp @@ -171,7 +171,7 @@ template * node) { - assert(node != nullptr, "nullptr pointer"); + assert(node != nullptr, "null pointer"); node->set_next(this->head()); this->set_head(node); } @@ -385,7 +385,7 @@ template * node) { - assert(node != nullptr, "nullptr pointer"); + assert(node != nullptr, "null pointer"); LinkedListNode* tmp = this->head(); LinkedListNode* prev = nullptr; diff --git a/src/hotspot/share/utilities/lockFreeStack.hpp b/src/hotspot/share/utilities/lockFreeStack.hpp index 2ff86eca7af..af4aaeab291 100644 --- a/src/hotspot/share/utilities/lockFreeStack.hpp +++ b/src/hotspot/share/utilities/lockFreeStack.hpp @@ -76,7 +76,7 @@ public: ~LockFreeStack() { assert(empty(), "stack not empty"); } // Atomically removes the top object from this stack and returns a - // pointer to that object, or nullptr if this stack is empty. Acts as a + // pointer to that object, or null if this stack is empty. Acts as a // full memory barrier. Subject to ABA behavior; callers must ensure // usage is safe. T* pop() { @@ -97,7 +97,7 @@ public: return result; } - // Atomically exchange the list of elements with nullptr, returning the old + // Atomically exchange the list of elements with null, returning the old // list of elements. Acts as a full memory barrier. // postcondition: empty() T* pop_all() { diff --git a/src/hotspot/share/utilities/nonblockingQueue.hpp b/src/hotspot/share/utilities/nonblockingQueue.hpp index 7ba4c80cfd6..0c62f077190 100644 --- a/src/hotspot/share/utilities/nonblockingQueue.hpp +++ b/src/hotspot/share/utilities/nonblockingQueue.hpp @@ -45,7 +45,7 @@ // // A queue may temporarily appear to be empty even though elements have been // added and not removed. For example, after running the following program, -// the value of r may be nullptr. +// the value of r may be null. // // thread1: q.push(a); r = q.pop(); // thread2: q.push(b); @@ -105,15 +105,15 @@ public: // Thread-safe attempt to remove and return the first object in the queue. // Returns true if successful. If successful then *node_ptr is the former - // first object, or nullptr if the queue was empty. If unsuccessful, because + // first object, or null if the queue was empty. If unsuccessful, because // of contention with a concurrent modification, then returns false with // the value of *node_ptr unspecified. Subject to ABA behavior; callers // must ensure usage is safe. inline bool try_pop(T** node_ptr); - // Thread-safe remove and return the first object in the queue, or nullptr + // Thread-safe remove and return the first object in the queue, or null // if the queue was empty. This just iterates on try_pop() until it - // succeeds, returning the (possibly nullptr) element obtained from that. + // succeeds, returning the (possibly null) element obtained from that. // Subject to ABA behavior; callers must ensure usage is safe. inline T* pop(); diff --git a/src/hotspot/share/utilities/nonblockingQueue.inline.hpp b/src/hotspot/share/utilities/nonblockingQueue.inline.hpp index f4e86c6fe65..174aacdeb71 100644 --- a/src/hotspot/share/utilities/nonblockingQueue.inline.hpp +++ b/src/hotspot/share/utilities/nonblockingQueue.inline.hpp @@ -85,7 +85,7 @@ size_t NonblockingQueue::length() const { // An append operation atomically exchanges the new tail with the queue tail. // It then sets the "next" value of the old tail to the head of the list being -// appended. If the old tail is nullptr then the queue was empty, then the +// appended. If the old tail is null then the queue was empty, then the // head of the list being appended is instead stored in the queue head. // // This means there is a period between the exchange and the old tail update @@ -107,8 +107,8 @@ void NonblockingQueue::append(T& first, T& last) { set_next(last, end_marker()); T* old_tail = Atomic::xchg(&_tail, &last); if (old_tail == nullptr) { - // If old_tail is nullptr then the queue was empty, and _head must also be - // nullptr. The correctness of this assertion depends on try_pop clearing + // If old_tail is null then the queue was empty, and _head must also be + // null. The correctness of this assertion depends on try_pop clearing // first _head then _tail when taking the last entry. assert(Atomic::load(&_head) == nullptr, "invariant"); // Fall through to common update of _head. @@ -126,7 +126,7 @@ void NonblockingQueue::append(T& first, T& last) { return; } else { // A concurrent try_pop has claimed old_tail, so it is no longer in the - // list. The queue was logically empty. _head is either nullptr or + // list. The queue was logically empty. _head is either null or // old_tail, depending on how far try_pop operations have progressed. DEBUG_ONLY(T* old_head = Atomic::load(&_head);) assert((old_head == nullptr) || (old_head == old_tail), "invariant"); @@ -152,7 +152,7 @@ bool NonblockingQueue::try_pop(T** node_ptr) { // [Clause 1] // There are several cases for next_node. // (1) next_node is the extension of the queue's list. - // (2) next_node is nullptr, because a competing try_pop took old_head. + // (2) next_node is null, because a competing try_pop took old_head. // (3) next_node is the extension of some unrelated list, because a // competing try_pop took old_head and put it in some other list. // @@ -171,7 +171,7 @@ bool NonblockingQueue::try_pop(T** node_ptr) { // The cmpxchg to advance the list succeeded, but a concurrent try_pop // has already claimed old_head (see [Clause 2] - old_head was the last // entry in the list) by nulling old_head's next field. The advance set - // _head to nullptr, "helping" the competing try_pop. _head will remain + // _head to null, "helping" the competing try_pop. _head will remain // nullptr until a subsequent push/append. This is a lost race, and we // report it as such for consistency, though we could report the queue // was empty. We don't attempt to further help [Clause 2] by also @@ -191,7 +191,7 @@ bool NonblockingQueue::try_pop(T** node_ptr) { } else if (is_end(Atomic::cmpxchg(next_ptr(*old_head), next_node, (T*)nullptr))) { // [Clause 2] // Old_head was the last entry and we've claimed it by setting its next - // value to nullptr. However, this leaves the queue in disarray. Fix up + // value to null. However, this leaves the queue in disarray. Fix up // the queue, possibly in conjunction with other concurrent operations. // Any further try_pops will consider the queue empty until a // push/append completes by installing a new head. @@ -200,12 +200,12 @@ bool NonblockingQueue::try_pop(T** node_ptr) { // dealing with _head first gives a stronger invariant in append, and is // also consistent with [Clause 1b]. - // Attempt to change the queue head from old_head to nullptr. Failure of + // Attempt to change the queue head from old_head to null. Failure of // the cmpxchg indicates a concurrent operation updated _head first. That // could be either a push/append or a try_pop in [Clause 1b]. Atomic::cmpxchg(&_head, old_head, (T*)nullptr); - // Attempt to change the queue tail from old_head to nullptr. Failure of + // Attempt to change the queue tail from old_head to null. Failure of // the cmpxchg indicates that a concurrent push/append updated _tail first. // That operation will eventually recognize the old tail (our old_head) is // no longer in the list and update _head from the list being appended. diff --git a/src/hotspot/share/utilities/ostream.cpp b/src/hotspot/share/utilities/ostream.cpp index 57dd447893c..fcb5aa5731c 100644 --- a/src/hotspot/share/utilities/ostream.cpp +++ b/src/hotspot/share/utilities/ostream.cpp @@ -706,7 +706,7 @@ void defaultStream::init_log() { _outer_xmlStream = new(mtInternal) xmlStream(file); start_log(); } else { - // and leave xtty as nullptr + // and leave xtty as null LogVMOutput = false; DisplayVMOutput = true; LogCompilation = false; @@ -762,13 +762,13 @@ void defaultStream::start_log() { // System properties don't generally contain newlines, so don't bother with unparsing. outputStream *text = xs->text(); for (SystemProperty* p = Arguments::system_properties(); p != nullptr; p = p->next()) { - assert(p->key() != nullptr, "p->key() is nullptr"); + assert(p->key() != nullptr, "p->key() is null"); if (p->readable()) { // Print in two stages to avoid problems with long // keys/values. text->print_raw(p->key()); text->put('='); - assert(p->value() != nullptr, "p->value() is nullptr"); + assert(p->value() != nullptr, "p->value() is null"); text->print_raw_cr(p->value()); } } diff --git a/src/hotspot/share/utilities/unsigned5.hpp b/src/hotspot/share/utilities/unsigned5.hpp index 01b55ed8ade..7f74d6e8498 100644 --- a/src/hotspot/share/utilities/unsigned5.hpp +++ b/src/hotspot/share/utilities/unsigned5.hpp @@ -324,7 +324,7 @@ class UNSIGNED5 : AllStatic { public: Writer(const ARR& array) : _array(const_cast(array)), _limit_ptr(nullptr), _position(0) { - // Note: if _limit_ptr is nullptr, the ARR& is never reassigned, + // Note: if _limit_ptr is null, the ARR& is never reassigned, // because has_limit is false. So the const_cast here is safe. assert(!has_limit(), "this writer cannot be growable"); } diff --git a/src/hotspot/share/utilities/utf8.hpp b/src/hotspot/share/utilities/utf8.hpp index 95e1886e0da..80346f7da7d 100644 --- a/src/hotspot/share/utilities/utf8.hpp +++ b/src/hotspot/share/utilities/utf8.hpp @@ -73,7 +73,7 @@ class UTF8 : AllStatic { // Utility methods - // Returns nullptr if 'c' it not found. This only works as long + // Returns null if 'c' it not found. This only works as long // as 'c' is an ASCII character static const jbyte* strrchr(const jbyte* base, int length, jbyte c) { assert(length >= 0, "sanity check"); diff --git a/src/hotspot/share/utilities/vmError.hpp b/src/hotspot/share/utilities/vmError.hpp index d4129c10342..5a0625c920b 100644 --- a/src/hotspot/share/utilities/vmError.hpp +++ b/src/hotspot/share/utilities/vmError.hpp @@ -42,7 +42,7 @@ class VMError : public AllStatic { static const char* _message; static char _detail_msg[1024]; - static Thread* _thread; // nullptr if it's native thread + static Thread* _thread; // null if it's native thread // additional info for crashes static address _pc; // faulting PC