8337243: Fix more -Wzero-as-null-pointer-constant warnings in compiler code

Reviewed-by: vlivanov, kvn
This commit is contained in:
Kim Barrett 2024-07-26 15:45:12 +00:00
parent 3abe8a6e5e
commit 4bcb8f04ed
7 changed files with 14 additions and 14 deletions

@ -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.

@ -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<void*>(arena, expected_size, 0, 0);
new (arena) GrowableArray<void*>(arena, expected_size, 0, nullptr);
_keys = new (arena) GrowableArray<int>(arena, expected_size, 0, 0);
}

@ -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;
}

@ -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;

@ -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<ciBaseObject*>(arena, 10, 0, 0);
_deps[i] = new(arena) GrowableArray<ciBaseObject*>(arena, 10, 0, nullptr);
}
_content_bytes = nullptr;
_size_in_bytes = (size_t)-1;

@ -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);

@ -68,11 +68,11 @@ template <class T> void ValueRecorder<T>::copy_values_to(nmethod* nm) {
template <class T> void ValueRecorder<T>::maybe_initialize() {
if (_handles == nullptr) {
if (_arena != nullptr) {
_handles = new(_arena) GrowableArray<T>(_arena, 10, 0, 0);
_no_finds = new(_arena) GrowableArray<int>( _arena, 10, 0, 0);
_handles = new(_arena) GrowableArray<T>(_arena, 10, 0, T{});
_no_finds = new(_arena) GrowableArray<int>(_arena, 10, 0, 0);
} else {
_handles = new GrowableArray<T>(10, 0, 0);
_no_finds = new GrowableArray<int>( 10, 0, 0);
_handles = new GrowableArray<T>(10, 0, T{});
_no_finds = new GrowableArray<int>(10, 0, 0);
}
}
}