mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8374444: Fix simple -Wzero-as-null-pointer-constant warnings
Reviewed-by: aboldtch
This commit is contained in:
parent
05d2f7f408
commit
efb79dc6b4
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, 2026, 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
|
||||
@ -124,7 +124,7 @@ CompressedOops::Mode AOTMappedHeapWriter::narrow_oop_mode() {
|
||||
|
||||
address AOTMappedHeapWriter::narrow_oop_base() {
|
||||
if (is_writing_deterministic_heap()) {
|
||||
return (address)0;
|
||||
return nullptr;
|
||||
} else {
|
||||
return CompressedOops::base();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2026, 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
|
||||
@ -1218,7 +1218,7 @@ C2V_VMENTRY_0(jint, installCode0, (JNIEnv *env, jobject,
|
||||
return result;
|
||||
C2V_END
|
||||
|
||||
C2V_VMENTRY_0(jobject, getInvalidationReasonDescription, (JNIEnv *env, jobject, jint invalidation_reason))
|
||||
C2V_VMENTRY_NULL(jobject, getInvalidationReasonDescription, (JNIEnv *env, jobject, jint invalidation_reason))
|
||||
HandleMark hm(THREAD);
|
||||
JNIHandleMark jni_hm(thread);
|
||||
nmethod::InvalidationReason reason = static_cast<nmethod::InvalidationReason>(invalidation_reason);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, Arm Limited. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -132,10 +132,10 @@ VStatus VLoop::check_preconditions_helper() {
|
||||
tty->print_cr(" Infrastructure for speculative runtime-checks:");
|
||||
if (_auto_vectorization_parse_predicate_proj != nullptr) {
|
||||
tty->print_cr(" auto_vectorization_parse_predicate_proj: speculate and trap");
|
||||
_auto_vectorization_parse_predicate_proj->dump_bfs(5,0,"");
|
||||
_auto_vectorization_parse_predicate_proj->dump_bfs(5, nullptr, "");
|
||||
} else if (_multiversioning_fast_proj != nullptr) {
|
||||
tty->print_cr(" multiversioning_fast_proj: speculate and multiversion");
|
||||
_multiversioning_fast_proj->dump_bfs(5,0,"");
|
||||
_multiversioning_fast_proj->dump_bfs(5, nullptr, "");
|
||||
} else {
|
||||
tty->print_cr(" Not found.");
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, 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
|
||||
@ -1736,8 +1736,8 @@ static void verify_frame_kind(frame& top, Continuation::preempt_kind preempt_kin
|
||||
m = top.interpreter_frame_method();
|
||||
assert(!m->is_native() || m->is_synchronized(), "invalid method %s", m->external_name());
|
||||
address bcp = top.interpreter_frame_bcp();
|
||||
assert(bcp != 0 || m->is_native(), "");
|
||||
at_sync_method = m->is_synchronized() && (bcp == 0 || bcp == m->code_base());
|
||||
assert(bcp != nullptr || m->is_native(), "");
|
||||
at_sync_method = m->is_synchronized() && (bcp == nullptr || bcp == m->code_base());
|
||||
// bcp is advanced on monitorenter before making the VM call, adjust for that.
|
||||
bool at_sync_bytecode = bcp > m->code_base() && Bytecode(m, bcp - 1).code() == Bytecodes::Code::_monitorenter;
|
||||
assert(at_sync_method || at_sync_bytecode, "");
|
||||
|
||||
@ -48,7 +48,7 @@ TEST_VM_F(NMTRegionsTreeTest, ReserveCommitTwice) {
|
||||
}
|
||||
{
|
||||
VMATree::SummaryDiff diff, not_used;
|
||||
rt.commit_region(0, 50, ncs, not_used);
|
||||
rt.commit_region(nullptr, 50, ncs, not_used);
|
||||
rt.reserve_mapping(0, 100, rd, diff);
|
||||
EXPECT_EQ(0, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve);
|
||||
EXPECT_EQ(-50, diff.tag[NMTUtil::tag_to_index(mtTest)].commit);
|
||||
@ -62,10 +62,10 @@ TEST_VM_F(NMTRegionsTreeTest, ReserveCommitTwice) {
|
||||
|
||||
{
|
||||
VMATree::SummaryDiff diff1, diff2;
|
||||
rt.commit_region(0, 50, ncs, diff1);
|
||||
rt.commit_region(nullptr, 50, ncs, diff1);
|
||||
EXPECT_EQ(0, diff1.tag[NMTUtil::tag_to_index(mtGC)].reserve);
|
||||
EXPECT_EQ(50, diff1.tag[NMTUtil::tag_to_index(mtGC)].commit);
|
||||
rt.commit_region(0, 50, ncs, diff2);
|
||||
rt.commit_region(nullptr, 50, ncs, diff2);
|
||||
EXPECT_EQ(0, diff2.tag[NMTUtil::tag_to_index(mtTest)].reserve);
|
||||
EXPECT_EQ(0, diff2.tag[NMTUtil::tag_to_index(mtTest)].commit);
|
||||
}
|
||||
@ -78,7 +78,7 @@ TEST_VM_F(NMTRegionsTreeTest, CommitUncommitRegion) {
|
||||
rt.reserve_mapping(0, 100, rd, not_used);
|
||||
{
|
||||
VMATree::SummaryDiff diff;
|
||||
rt.commit_region(0, 50, ncs, diff);
|
||||
rt.commit_region(nullptr, 50, ncs, diff);
|
||||
EXPECT_EQ(0, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve);
|
||||
EXPECT_EQ(50, diff.tag[NMTUtil::tag_to_index(mtTest)].commit);
|
||||
}
|
||||
@ -90,7 +90,7 @@ TEST_VM_F(NMTRegionsTreeTest, CommitUncommitRegion) {
|
||||
}
|
||||
{
|
||||
VMATree::SummaryDiff diff;
|
||||
rt.uncommit_region(0, 50, diff);
|
||||
rt.uncommit_region(nullptr, 50, diff);
|
||||
EXPECT_EQ(0, diff.tag[NMTUtil::tag_to_index(mtTest)].reserve);
|
||||
EXPECT_EQ(-50, diff.tag[NMTUtil::tag_to_index(mtTest)].commit);
|
||||
}
|
||||
@ -153,4 +153,4 @@ TEST_VM_F(NMTRegionsTreeTest, VisitCommittedRegions) {
|
||||
return true;
|
||||
});
|
||||
EXPECT_EQ(count, 4UL);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user