Skip to content

Commit b3ecd55

Browse files
committed
8324679: Replace NULL with nullptr in HotSpot .ad files
Reviewed-by: kvn
1 parent 192349e commit b3ecd55

File tree

10 files changed

+332
-332
lines changed

10 files changed

+332
-332
lines changed

src/hotspot/cpu/aarch64/aarch64.ad

+34-34
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ source %{
12371237

12381238
// r27 is not allocatable when compressed oops is on and heapbase is not
12391239
// zero, compressed klass pointers doesn't use r27 after JDK-8234794
1240-
if (UseCompressedOops && (CompressedOops::ptrs_base() != NULL)) {
1240+
if (UseCompressedOops && (CompressedOops::ptrs_base() != nullptr)) {
12411241
_NO_SPECIAL_REG32_mask.Remove(OptoReg::as_OptoReg(r27->as_VMReg()));
12421242
_NO_SPECIAL_REG_mask.Remove(OptoReg::as_OptoReg(r27->as_VMReg()));
12431243
_NO_SPECIAL_PTR_REG_mask.Remove(OptoReg::as_OptoReg(r27->as_VMReg()));
@@ -1581,7 +1581,7 @@ bool needs_releasing_store(const Node *n)
15811581
{
15821582
// assert n->is_Store();
15831583
StoreNode *st = n->as_Store();
1584-
return st->trailing_membar() != NULL;
1584+
return st->trailing_membar() != nullptr;
15851585
}
15861586

15871587
// predicate controlling translation of CAS
@@ -1593,9 +1593,9 @@ bool needs_acquiring_load_exclusive(const Node *n)
15931593
assert(is_CAS(n->Opcode(), true), "expecting a compare and swap");
15941594
LoadStoreNode* ldst = n->as_LoadStore();
15951595
if (is_CAS(n->Opcode(), false)) {
1596-
assert(ldst->trailing_membar() != NULL, "expected trailing membar");
1596+
assert(ldst->trailing_membar() != nullptr, "expected trailing membar");
15971597
} else {
1598-
return ldst->trailing_membar() != NULL;
1598+
return ldst->trailing_membar() != nullptr;
15991599
}
16001600

16011601
// so we can just return true here
@@ -1734,7 +1734,7 @@ void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
17341734
st->print("mov rscratch1, #%d\n\t", framesize - 2 * wordSize);
17351735
st->print("sub sp, sp, rscratch1");
17361736
}
1737-
if (C->stub_function() == NULL && BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) {
1737+
if (C->stub_function() == nullptr && BarrierSet::barrier_set()->barrier_set_nmethod() != nullptr) {
17381738
st->print("\n\t");
17391739
st->print("ldr rscratch1, [guard]\n\t");
17401740
st->print("dmb ishld\n\t");
@@ -1783,9 +1783,9 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
17831783

17841784
__ build_frame(framesize);
17851785

1786-
if (C->stub_function() == NULL) {
1786+
if (C->stub_function() == nullptr) {
17871787
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1788-
if (BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) {
1788+
if (BarrierSet::barrier_set()->barrier_set_nmethod() != nullptr) {
17891789
// Dummy labels for just measuring the code size
17901790
Label dummy_slow_path;
17911791
Label dummy_continuation;
@@ -2153,12 +2153,12 @@ void MachSpillCopyNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
21532153
if (!ra_)
21542154
st->print("N%d = SpillCopy(N%d)", _idx, in(1)->_idx);
21552155
else
2156-
implementation(NULL, ra_, false, st);
2156+
implementation(nullptr, ra_, false, st);
21572157
}
21582158
#endif
21592159

21602160
void MachSpillCopyNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
2161-
implementation(&cbuf, ra_, false, NULL);
2161+
implementation(&cbuf, ra_, false, nullptr);
21622162
}
21632163

21642164
uint MachSpillCopyNode::size(PhaseRegAlloc *ra_) const {
@@ -2249,7 +2249,7 @@ int HandlerImpl::emit_exception_handler(CodeBuffer& cbuf)
22492249
// That's why we must use the macroassembler to generate a handler.
22502250
C2_MacroAssembler _masm(&cbuf);
22512251
address base = __ start_a_stub(size_exception_handler());
2252-
if (base == NULL) {
2252+
if (base == nullptr) {
22532253
ciEnv::current()->record_failure("CodeCache is full");
22542254
return 0; // CodeBuffer::expand failed
22552255
}
@@ -2267,7 +2267,7 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf)
22672267
// That's why we must use the macroassembler to generate a handler.
22682268
C2_MacroAssembler _masm(&cbuf);
22692269
address base = __ start_a_stub(size_deopt_handler());
2270-
if (base == NULL) {
2270+
if (base == nullptr) {
22712271
ciEnv::current()->record_failure("CodeCache is full");
22722272
return 0; // CodeBuffer::expand failed
22732273
}
@@ -2410,7 +2410,7 @@ MachOper* Matcher::pd_specialize_generic_vector_operand(MachOper* generic_opnd,
24102410
case Op_VecX: return new vecXOper();
24112411
}
24122412
ShouldNotReachHere();
2413-
return NULL;
2413+
return nullptr;
24142414
}
24152415

24162416
bool Matcher::is_reg2reg_move(MachNode* m) {
@@ -2583,7 +2583,7 @@ Assembler::Condition to_assembler_cond(BoolTest::mask cond) {
25832583

25842584
// Binary src (Replicate con)
25852585
bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
2586-
if (n == NULL || m == NULL) {
2586+
if (n == nullptr || m == nullptr) {
25872587
return false;
25882588
}
25892589

@@ -2624,7 +2624,7 @@ bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
26242624
// (XorV src (Replicate m1))
26252625
// (XorVMask src (MaskAll m1))
26262626
bool is_vector_bitwise_not_pattern(Node* n, Node* m) {
2627-
if (n != NULL && m != NULL) {
2627+
if (n != nullptr && m != nullptr) {
26282628
return (n->Opcode() == Op_XorV || n->Opcode() == Op_XorVMask) &&
26292629
VectorNode::is_all_ones_vector(m);
26302630
}
@@ -3430,7 +3430,7 @@ encode %{
34303430
C2_MacroAssembler _masm(&cbuf);
34313431
Register dst_reg = as_Register($dst$$reg);
34323432
address con = (address)$src$$constant;
3433-
if (con == NULL || con == (address)1) {
3433+
if (con == nullptr || con == (address)1) {
34343434
ShouldNotReachHere();
34353435
} else {
34363436
relocInfo::relocType rtype = $src->constant_reloc();
@@ -3473,7 +3473,7 @@ encode %{
34733473
C2_MacroAssembler _masm(&cbuf);
34743474
Register dst_reg = as_Register($dst$$reg);
34753475
address con = (address)$src$$constant;
3476-
if (con == NULL) {
3476+
if (con == nullptr) {
34773477
ShouldNotReachHere();
34783478
} else {
34793479
relocInfo::relocType rtype = $src->constant_reloc();
@@ -3492,7 +3492,7 @@ encode %{
34923492
C2_MacroAssembler _masm(&cbuf);
34933493
Register dst_reg = as_Register($dst$$reg);
34943494
address con = (address)$src$$constant;
3495-
if (con == NULL) {
3495+
if (con == nullptr) {
34963496
ShouldNotReachHere();
34973497
} else {
34983498
relocInfo::relocType rtype = $src->constant_reloc();
@@ -3675,7 +3675,7 @@ encode %{
36753675
Label miss;
36763676
C2_MacroAssembler _masm(&cbuf);
36773677
__ check_klass_subtype_slow_path(sub_reg, super_reg, temp_reg, result_reg,
3678-
NULL, &miss,
3678+
nullptr, &miss,
36793679
/*set_cond_codes:*/ true);
36803680
if ($primary) {
36813681
__ mov(result_reg, zr);
@@ -3691,7 +3691,7 @@ encode %{
36913691
if (!_method) {
36923692
// A call to a runtime wrapper, e.g. new, new_typeArray_Java, uncommon_trap.
36933693
call = __ trampoline_call(Address(addr, relocInfo::runtime_call_type));
3694-
if (call == NULL) {
3694+
if (call == nullptr) {
36953695
ciEnv::current()->record_failure("CodeCache is full");
36963696
return;
36973697
}
@@ -3705,7 +3705,7 @@ encode %{
37053705
RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index)
37063706
: static_call_Relocation::spec(method_index);
37073707
call = __ trampoline_call(Address(addr, rspec));
3708-
if (call == NULL) {
3708+
if (call == nullptr) {
37093709
ciEnv::current()->record_failure("CodeCache is full");
37103710
return;
37113711
}
@@ -3716,7 +3716,7 @@ encode %{
37163716
} else {
37173717
// Emit stub for static call
37183718
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf, call);
3719-
if (stub == NULL) {
3719+
if (stub == nullptr) {
37203720
ciEnv::current()->record_failure("CodeCache is full");
37213721
return;
37223722
}
@@ -3735,7 +3735,7 @@ encode %{
37353735
C2_MacroAssembler _masm(&cbuf);
37363736
int method_index = resolved_method_index(cbuf);
37373737
address call = __ ic_call((address)$meth$$method, method_index);
3738-
if (call == NULL) {
3738+
if (call == nullptr) {
37393739
ciEnv::current()->record_failure("CodeCache is full");
37403740
return;
37413741
}
@@ -3764,7 +3764,7 @@ encode %{
37643764
CodeBlob *cb = CodeCache::find_blob(entry);
37653765
if (cb) {
37663766
address call = __ trampoline_call(Address(entry, relocInfo::runtime_call_type));
3767-
if (call == NULL) {
3767+
if (call == nullptr) {
37683768
ciEnv::current()->record_failure("CodeCache is full");
37693769
return;
37703770
}
@@ -4663,7 +4663,7 @@ operand immP()
46634663
interface(CONST_INTER);
46644664
%}
46654665

4666-
// NULL Pointer Immediate
4666+
// Null Pointer Immediate
46674667
operand immP0()
46684668
%{
46694669
predicate(n->get_ptr() == 0);
@@ -4795,7 +4795,7 @@ operand immN()
47954795
interface(CONST_INTER);
47964796
%}
47974797

4798-
// Narrow NULL Pointer Immediate
4798+
// Narrow Null Pointer Immediate
47994799
operand immN0()
48004800
%{
48014801
predicate(n->get_narrowcon() == 0);
@@ -7219,7 +7219,7 @@ instruct loadConP0(iRegPNoSp dst, immP0 con)
72197219
match(Set dst con);
72207220

72217221
ins_cost(INSN_COST);
7222-
format %{ "mov $dst, $con\t# NULL ptr" %}
7222+
format %{ "mov $dst, $con\t# null pointer" %}
72237223

72247224
ins_encode(aarch64_enc_mov_p0(dst, con));
72257225

@@ -7233,7 +7233,7 @@ instruct loadConP1(iRegPNoSp dst, immP_1 con)
72337233
match(Set dst con);
72347234

72357235
ins_cost(INSN_COST);
7236-
format %{ "mov $dst, $con\t# NULL ptr" %}
7236+
format %{ "mov $dst, $con\t# null pointer" %}
72377237

72387238
ins_encode(aarch64_enc_mov_p1(dst, con));
72397239

@@ -7275,7 +7275,7 @@ instruct loadConN0(iRegNNoSp dst, immN0 con)
72757275
match(Set dst con);
72767276

72777277
ins_cost(INSN_COST);
7278-
format %{ "mov $dst, $con\t# compressed NULL ptr" %}
7278+
format %{ "mov $dst, $con\t# compressed null pointer" %}
72797279

72807280
ins_encode(aarch64_enc_mov_n0(dst, con));
72817281

@@ -15257,7 +15257,7 @@ instruct clearArray_reg_reg(iRegL_R11 cnt, iRegP_R10 base, Universe dummy, rFlag
1525715257

1525815258
ins_encode %{
1525915259
address tpc = __ zero_words($base$$Register, $cnt$$Register);
15260-
if (tpc == NULL) {
15260+
if (tpc == nullptr) {
1526115261
ciEnv::current()->record_failure("CodeCache is full");
1526215262
return;
1526315263
}
@@ -15278,7 +15278,7 @@ instruct clearArray_imm_reg(immL cnt, iRegP_R10 base, iRegL_R11 temp, Universe d
1527815278

1527915279
ins_encode %{
1528015280
address tpc = __ zero_words($base$$Register, (uint64_t)$cnt$$constant);
15281-
if (tpc == NULL) {
15281+
if (tpc == nullptr) {
1528215282
ciEnv::current()->record_failure("CodeCache is full");
1528315283
return;
1528415284
}
@@ -17143,7 +17143,7 @@ instruct array_equalsB(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result,
1714317143
address tpc = __ arrays_equals($ary1$$Register, $ary2$$Register,
1714417144
$tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
1714517145
$result$$Register, $tmp$$Register, 1);
17146-
if (tpc == NULL) {
17146+
if (tpc == nullptr) {
1714717147
ciEnv::current()->record_failure("CodeCache is full");
1714817148
return;
1714917149
}
@@ -17168,7 +17168,7 @@ instruct array_equalsC(iRegP_R1 ary1, iRegP_R2 ary2, iRegI_R0 result,
1716817168
address tpc = __ arrays_equals($ary1$$Register, $ary2$$Register,
1716917169
$tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
1717017170
$result$$Register, $tmp$$Register, 2);
17171-
if (tpc == NULL) {
17171+
if (tpc == nullptr) {
1717217172
ciEnv::current()->record_failure("CodeCache is full");
1717317173
return;
1717417174
}
@@ -17183,7 +17183,7 @@ instruct count_positives(iRegP_R1 ary1, iRegI_R2 len, iRegI_R0 result, rFlagsReg
1718317183
format %{ "count positives byte[] $ary1,$len -> $result" %}
1718417184
ins_encode %{
1718517185
address tpc = __ count_positives($ary1$$Register, $len$$Register, $result$$Register);
17186-
if (tpc == NULL) {
17186+
if (tpc == nullptr) {
1718717187
ciEnv::current()->record_failure("CodeCache is full");
1718817188
return;
1718917189
}
@@ -17226,7 +17226,7 @@ instruct string_inflate(Universe dummy, iRegP_R0 src, iRegP_R1 dst, iRegI_R2 len
1722617226
address tpc = __ byte_array_inflate($src$$Register, $dst$$Register, $len$$Register,
1722717227
$vtmp0$$FloatRegister, $vtmp1$$FloatRegister,
1722817228
$vtmp2$$FloatRegister, $tmp$$Register);
17229-
if (tpc == NULL) {
17229+
if (tpc == nullptr) {
1723017230
ciEnv::current()->record_failure("CodeCache is full");
1723117231
return;
1723217232
}

0 commit comments

Comments
 (0)