Skip to content

Commit ab27aca

Browse files
author
Kim Barrett
committedJul 15, 2024
8336297: C2: Fix -Wzero-as-null-pointer-constant warnings in derived Node ctors
Reviewed-by: kvn, jwaters
1 parent 9dfcd75 commit ab27aca

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed
 

‎src/hotspot/share/opto/graphKit.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ Node* GraphKit::load_array_length(Node* array) {
12091209
Node *alen;
12101210
if (alloc == nullptr) {
12111211
Node *r_adr = basic_plus_adr(array, arrayOopDesc::length_offset_in_bytes());
1212-
alen = _gvn.transform( new LoadRangeNode(0, immutable_memory(), r_adr, TypeInt::POS));
1212+
alen = _gvn.transform( new LoadRangeNode(nullptr, immutable_memory(), r_adr, TypeInt::POS));
12131213
} else {
12141214
alen = array_ideal_length(alloc, _gvn.type(array)->is_oopptr(), false);
12151215
}
@@ -2385,7 +2385,7 @@ Node* GraphKit::precision_rounding(Node* n) {
23852385
if (Matcher::strict_fp_requires_explicit_rounding) {
23862386
#ifdef IA32
23872387
if (UseSSE == 0) {
2388-
return _gvn.transform(new RoundFloatNode(0, n));
2388+
return _gvn.transform(new RoundFloatNode(nullptr, n));
23892389
}
23902390
#else
23912391
Unimplemented();
@@ -2399,7 +2399,7 @@ Node* GraphKit::dprecision_rounding(Node *n) {
23992399
if (Matcher::strict_fp_requires_explicit_rounding) {
24002400
#ifdef IA32
24012401
if (UseSSE < 2) {
2402-
return _gvn.transform(new RoundDoubleNode(0, n));
2402+
return _gvn.transform(new RoundDoubleNode(nullptr, n));
24032403
}
24042404
#else
24052405
Unimplemented();
@@ -3489,7 +3489,7 @@ FastLockNode* GraphKit::shared_lock(Node* obj) {
34893489
box = _gvn.transform(box);
34903490
Node* mem = reset_memory();
34913491

3492-
FastLockNode * flock = _gvn.transform(new FastLockNode(0, obj, box) )->as_FastLock();
3492+
FastLockNode * flock = _gvn.transform(new FastLockNode(nullptr, obj, box) )->as_FastLock();
34933493

34943494
// Add monitor to debug info for the slow path. If we block inside the
34953495
// slow path and de-opt, we need the monitor hanging around

‎src/hotspot/share/opto/library_call.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -2138,12 +2138,12 @@ bool LibraryCallKit::inline_number_methods(vmIntrinsics::ID id) {
21382138
case vmIntrinsics::_numberOfTrailingZeros_l: n = new CountTrailingZerosLNode(arg); break;
21392139
case vmIntrinsics::_bitCount_i: n = new PopCountINode( arg); break;
21402140
case vmIntrinsics::_bitCount_l: n = new PopCountLNode( arg); break;
2141-
case vmIntrinsics::_reverseBytes_c: n = new ReverseBytesUSNode(0, arg); break;
2142-
case vmIntrinsics::_reverseBytes_s: n = new ReverseBytesSNode( 0, arg); break;
2143-
case vmIntrinsics::_reverseBytes_i: n = new ReverseBytesINode( 0, arg); break;
2144-
case vmIntrinsics::_reverseBytes_l: n = new ReverseBytesLNode( 0, arg); break;
2145-
case vmIntrinsics::_reverse_i: n = new ReverseINode(0, arg); break;
2146-
case vmIntrinsics::_reverse_l: n = new ReverseLNode(0, arg); break;
2141+
case vmIntrinsics::_reverseBytes_c: n = new ReverseBytesUSNode(nullptr, arg); break;
2142+
case vmIntrinsics::_reverseBytes_s: n = new ReverseBytesSNode( nullptr, arg); break;
2143+
case vmIntrinsics::_reverseBytes_i: n = new ReverseBytesINode( nullptr, arg); break;
2144+
case vmIntrinsics::_reverseBytes_l: n = new ReverseBytesLNode( nullptr, arg); break;
2145+
case vmIntrinsics::_reverse_i: n = new ReverseINode(nullptr, arg); break;
2146+
case vmIntrinsics::_reverse_l: n = new ReverseLNode(nullptr, arg); break;
21472147
default: fatal_unexpected_iid(id); break;
21482148
}
21492149
set_result(_gvn.transform(n));

‎src/hotspot/share/opto/loopnode.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2591,7 +2591,7 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {
25912591
Node* stride_m = phase->intcon(stride_con - (stride_con > 0 ? 1 : -1));
25922592
Node *range = phase->transform(new SubINode(in(Limit), in(Init)));
25932593
Node *bias = phase->transform(new AddINode(range, stride_m));
2594-
Node *trip = phase->transform(new DivINode(0, bias, in(Stride)));
2594+
Node *trip = phase->transform(new DivINode(nullptr, bias, in(Stride)));
25952595
Node *span = phase->transform(new MulINode(trip, in(Stride)));
25962596
return new AddINode(span, in(Init)); // exact limit
25972597
}
@@ -2620,7 +2620,7 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {
26202620
Node* neg_stride = phase->longcon(-stride_con);
26212621
span = phase->transform(new AndLNode(bias, neg_stride));
26222622
} else {
2623-
Node *trip = phase->transform(new DivLNode(0, bias, stride));
2623+
Node *trip = phase->transform(new DivLNode(nullptr, bias, stride));
26242624
span = phase->transform(new MulLNode(trip, stride));
26252625
}
26262626
// Convert back to int

‎src/hotspot/share/opto/parse1.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void Parse::load_interpreter_state(Node* osr_buf) {
251251

252252
// Build a bogus FastLockNode (no code will be generated) and push the
253253
// monitor into our debug info.
254-
const FastLockNode *flock = _gvn.transform(new FastLockNode( 0, lock_object, box ))->as_FastLock();
254+
const FastLockNode *flock = _gvn.transform(new FastLockNode( nullptr, lock_object, box ))->as_FastLock();
255255
map()->push_monitor(flock);
256256

257257
// If the lock is our method synchronization lock, tuck it away in

‎src/hotspot/share/opto/parse2.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,7 @@ void Parse::do_one_bytecode() {
22332233
case Bytecodes::_fdiv:
22342234
b = pop();
22352235
a = pop();
2236-
c = _gvn.transform( new DivFNode(0,a,b) );
2236+
c = _gvn.transform( new DivFNode(nullptr,a,b) );
22372237
d = precision_rounding(c);
22382238
push( d );
22392239
break;
@@ -2243,7 +2243,7 @@ void Parse::do_one_bytecode() {
22432243
// Generate a ModF node.
22442244
b = pop();
22452245
a = pop();
2246-
c = _gvn.transform( new ModFNode(0,a,b) );
2246+
c = _gvn.transform( new ModFNode(nullptr,a,b) );
22472247
d = precision_rounding(c);
22482248
push( d );
22492249
}
@@ -2294,7 +2294,7 @@ void Parse::do_one_bytecode() {
22942294
a = pop_pair();
22952295
b = _gvn.transform( new ConvD2FNode(a));
22962296
// This breaks _227_mtrt (speed & correctness) and _222_mpegaudio (speed)
2297-
//b = _gvn.transform(new RoundFloatNode(0, b) );
2297+
//b = _gvn.transform(new RoundFloatNode(nullptr, b) );
22982298
push( b );
22992299
break;
23002300

@@ -2360,7 +2360,7 @@ void Parse::do_one_bytecode() {
23602360
case Bytecodes::_ddiv:
23612361
b = pop_pair();
23622362
a = pop_pair();
2363-
c = _gvn.transform( new DivDNode(0,a,b) );
2363+
c = _gvn.transform( new DivDNode(nullptr,a,b) );
23642364
d = dprecision_rounding(c);
23652365
push_pair( d );
23662366
break;
@@ -2378,7 +2378,7 @@ void Parse::do_one_bytecode() {
23782378
a = pop_pair();
23792379
// a % b
23802380

2381-
c = _gvn.transform( new ModDNode(0,a,b) );
2381+
c = _gvn.transform( new ModDNode(nullptr,a,b) );
23822382
d = dprecision_rounding(c);
23832383
push_pair( d );
23842384
}

0 commit comments

Comments
 (0)