diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index cd084135658..7b519804bfe 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -1300,7 +1300,7 @@ void LIRGenerator::do_isPrimitive(Intrinsic* x) { } __ move(new LIR_Address(rcvr.result(), java_lang_Class::klass_offset(), T_ADDRESS), temp, info); - __ cmp(lir_cond_notEqual, temp, LIR_OprFact::metadataConst(0)); + __ cmp(lir_cond_notEqual, temp, LIR_OprFact::metadataConst(nullptr)); __ cmove(lir_cond_notEqual, LIR_OprFact::intConst(0), LIR_OprFact::intConst(1), result, T_BOOLEAN); } @@ -1333,7 +1333,7 @@ void LIRGenerator::do_getModifiers(Intrinsic* x) { // Check if this is a Java mirror of primitive type, and select the appropriate klass. LIR_Opr klass = new_register(T_METADATA); - __ cmp(lir_cond_equal, recv_klass, LIR_OprFact::metadataConst(0)); + __ cmp(lir_cond_equal, recv_klass, LIR_OprFact::metadataConst(nullptr)); __ cmove(lir_cond_equal, prim_klass, recv_klass, klass, T_ADDRESS); // Get the answer. diff --git a/src/hotspot/share/ci/ciConstantPoolCache.cpp b/src/hotspot/share/ci/ciConstantPoolCache.cpp index 8dc9cfc75e1..e831516b0f7 100644 --- a/src/hotspot/share/ci/ciConstantPoolCache.cpp +++ b/src/hotspot/share/ci/ciConstantPoolCache.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -37,7 +37,7 @@ ciConstantPoolCache::ciConstantPoolCache(Arena* arena, int expected_size) { _elements = - new (arena) GrowableArray(arena, expected_size, 0, 0); + new (arena) GrowableArray(arena, expected_size, 0, nullptr); _keys = new (arena) GrowableArray(arena, expected_size, 0, 0); } diff --git a/src/hotspot/share/ci/ciStreams.cpp b/src/hotspot/share/ci/ciStreams.cpp index 8220910d74c..18d2a46a686 100644 --- a/src/hotspot/share/ci/ciStreams.cpp +++ b/src/hotspot/share/ci/ciStreams.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2024, 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 @@ -135,7 +135,7 @@ Bytecodes::Code ciBytecodeStream::next_wide_or_table(Bytecodes::Code bc) { // ------------------------------------------------------------------ // ciBytecodeStream::reset_to_bci void ciBytecodeStream::reset_to_bci( int bci ) { - _bc_start=_was_wide=0; + _bc_start = _was_wide = nullptr; _pc = _start+bci; } diff --git a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp index 4a54fd8d0a9..ea01dd75958 100644 --- a/src/hotspot/share/code/codeCache.cpp +++ b/src/hotspot/share/code/codeCache.cpp @@ -165,8 +165,8 @@ class CodeBlob_sizes { // Iterate over all CodeBlobs (cb) on the given CodeHeap #define FOR_ALL_BLOBS(cb, heap) for (CodeBlob* cb = first_blob(heap); cb != nullptr; cb = next_blob(heap, cb)) -address CodeCache::_low_bound = 0; -address CodeCache::_high_bound = 0; +address CodeCache::_low_bound = nullptr; +address CodeCache::_high_bound = nullptr; volatile int CodeCache::_number_of_nmethods_with_dependencies = 0; ExceptionCache* volatile CodeCache::_exception_cache_purge_list = nullptr; diff --git a/src/hotspot/share/code/dependencies.cpp b/src/hotspot/share/code/dependencies.cpp index 7d3b744313f..074846e2e79 100644 --- a/src/hotspot/share/code/dependencies.cpp +++ b/src/hotspot/share/code/dependencies.cpp @@ -72,7 +72,7 @@ void Dependencies::initialize(ciEnv* env) { #endif DEBUG_ONLY(_deps[end_marker] = nullptr); for (int i = (int)FIRST_TYPE; i < (int)TYPE_LIMIT; i++) { - _deps[i] = new(arena) GrowableArray(arena, 10, 0, 0); + _deps[i] = new(arena) GrowableArray(arena, 10, 0, nullptr); } _content_bytes = nullptr; _size_in_bytes = (size_t)-1; diff --git a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp index 54aeac6be04..0bab731ac56 100644 --- a/src/hotspot/share/code/nmethod.cpp +++ b/src/hotspot/share/code/nmethod.cpp @@ -3270,7 +3270,7 @@ void nmethod::print_recorded_oop(int log_n, int i) { if (value == Universe::non_oop_word()) { tty->print("non-oop word"); } else { - if (value == 0) { + if (value == nullptr) { tty->print("nullptr-oop"); } else { oop_at(i)->print_value_on(tty); diff --git a/src/hotspot/share/code/oopRecorder.cpp b/src/hotspot/share/code/oopRecorder.cpp index b8ecc1eccc0..fd13b105041 100644 --- a/src/hotspot/share/code/oopRecorder.cpp +++ b/src/hotspot/share/code/oopRecorder.cpp @@ -68,11 +68,11 @@ template void ValueRecorder::copy_values_to(nmethod* nm) { template void ValueRecorder::maybe_initialize() { if (_handles == nullptr) { if (_arena != nullptr) { - _handles = new(_arena) GrowableArray(_arena, 10, 0, 0); - _no_finds = new(_arena) GrowableArray( _arena, 10, 0, 0); + _handles = new(_arena) GrowableArray(_arena, 10, 0, T{}); + _no_finds = new(_arena) GrowableArray(_arena, 10, 0, 0); } else { - _handles = new GrowableArray(10, 0, 0); - _no_finds = new GrowableArray( 10, 0, 0); + _handles = new GrowableArray(10, 0, T{}); + _no_finds = new GrowableArray(10, 0, 0); } } }