1
1
/*
2
- * Copyright (c) 2008, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2008, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -133,7 +133,7 @@ intptr_t* os::Linux::ucontext_get_fp(const ucontext_t* uc) {
133
133
134
134
bool is_safe_for_fp (address pc) {
135
135
#ifdef __thumb__
136
- if (CodeCache::find_blob (pc) != NULL ) {
136
+ if (CodeCache::find_blob (pc) != nullptr ) {
137
137
return true ;
138
138
}
139
139
// For thumb C frames, given an fp we have no idea how to access the frame contents.
@@ -155,13 +155,13 @@ address os::fetch_frame_from_context(const void* ucVoid,
155
155
address epc;
156
156
const ucontext_t * uc = (const ucontext_t *)ucVoid;
157
157
158
- if (uc != NULL ) {
158
+ if (uc != nullptr ) {
159
159
epc = os::Posix::ucontext_get_pc (uc);
160
160
if (ret_sp) *ret_sp = os::Linux::ucontext_get_sp (uc);
161
161
if (ret_fp) {
162
162
intptr_t * fp = os::Linux::ucontext_get_fp (uc);
163
163
#ifndef __thumb__
164
- if (CodeCache::find_blob (epc) == NULL ) {
164
+ if (CodeCache::find_blob (epc) == nullptr ) {
165
165
// It's a C frame. We need to adjust the fp.
166
166
fp += C_frame_offset;
167
167
}
@@ -172,14 +172,14 @@ address os::fetch_frame_from_context(const void* ucVoid,
172
172
// potentially necessary.
173
173
if (!is_safe_for_fp (epc)) {
174
174
// FP unreliable
175
- fp = (intptr_t *)NULL ;
175
+ fp = (intptr_t *)nullptr ;
176
176
}
177
177
*ret_fp = fp;
178
178
}
179
179
} else {
180
- epc = NULL ;
181
- if (ret_sp) *ret_sp = (intptr_t *)NULL ;
182
- if (ret_fp) *ret_fp = (intptr_t *)NULL ;
180
+ epc = nullptr ;
181
+ if (ret_sp) *ret_sp = (intptr_t *)nullptr ;
182
+ if (ret_fp) *ret_fp = (intptr_t *)nullptr ;
183
183
}
184
184
185
185
return epc;
@@ -199,7 +199,7 @@ frame os::get_sender_for_C_frame(frame* fr) {
199
199
#else
200
200
address pc = fr->sender_pc ();
201
201
if (! is_safe_for_fp (pc)) {
202
- return frame (fr->sender_sp (), (intptr_t *)NULL , pc);
202
+ return frame (fr->sender_sp (), (intptr_t *)nullptr , pc);
203
203
} else {
204
204
return frame (fr->sender_sp (), fr->link () + C_frame_offset, pc);
205
205
}
@@ -243,10 +243,10 @@ extern "C" address check_vfp3_32_fault_instr;
243
243
extern " C" address check_simd_fault_instr;
244
244
extern " C" address check_mp_ext_fault_instr;
245
245
246
- address check_vfp_fault_instr = NULL ;
247
- address check_vfp3_32_fault_instr = NULL ;
248
- address check_simd_fault_instr = NULL ;
249
- address check_mp_ext_fault_instr = NULL ;
246
+ address check_vfp_fault_instr = nullptr ;
247
+ address check_vfp3_32_fault_instr = nullptr ;
248
+ address check_simd_fault_instr = nullptr ;
249
+ address check_mp_ext_fault_instr = nullptr ;
250
250
251
251
252
252
bool PosixSignals::pd_hotspot_signal_handler (int sig, siginfo_t * info,
@@ -264,11 +264,11 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
264
264
return true ;
265
265
}
266
266
267
- address stub = NULL ;
268
- address pc = NULL ;
267
+ address stub = nullptr ;
268
+ address pc = nullptr ;
269
269
bool unsafe_access = false ;
270
270
271
- if (info != NULL && uc != NULL && thread != NULL ) {
271
+ if (info != nullptr && uc != nullptr && thread != nullptr ) {
272
272
pc = (address) os::Posix::ucontext_get_pc (uc);
273
273
274
274
// Handle ALL stack overflow variations here
@@ -324,15 +324,15 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
324
324
// here if the underlying file has been truncated.
325
325
// Do not crash the VM in such a case.
326
326
CodeBlob* cb = CodeCache::find_blob (pc);
327
- CompiledMethod* nm = (cb != NULL ) ? cb->as_compiled_method_or_null () : NULL ;
328
- if ((nm != NULL && nm->has_unsafe_access ()) || (thread->doing_unsafe_access () && UnsafeCopyMemory::contains_pc (pc))) {
327
+ CompiledMethod* nm = (cb != nullptr ) ? cb->as_compiled_method_or_null () : nullptr ;
328
+ if ((nm != nullptr && nm->has_unsafe_access ()) || (thread->doing_unsafe_access () && UnsafeCopyMemory::contains_pc (pc))) {
329
329
unsafe_access = true ;
330
330
}
331
331
} else if (sig == SIGSEGV &&
332
332
MacroAssembler::uses_implicit_null_check (info->si_addr )) {
333
333
// Determination of interpreter/vtable stub/compiled code null exception
334
334
CodeBlob* cb = CodeCache::find_blob (pc);
335
- if (cb != NULL ) {
335
+ if (cb != nullptr ) {
336
336
stub = SharedRuntime::continuation_for_implicit_exception (thread, pc, SharedRuntime::IMPLICIT_NULL);
337
337
}
338
338
} else if (sig == SIGILL && *(int *)pc == NativeInstruction::not_entrant_illegal_instruction) {
@@ -355,7 +355,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
355
355
}
356
356
}
357
357
358
- if (unsafe_access && stub == NULL ) {
358
+ if (unsafe_access && stub == nullptr ) {
359
359
// it can be an unsafe access and we haven't found
360
360
// any other suitable exception reason,
361
361
// so assume it is an unsafe access.
@@ -372,7 +372,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
372
372
stub = SharedRuntime::handle_unsafe_access (thread, next_pc);
373
373
}
374
374
375
- if (stub != NULL ) {
375
+ if (stub != nullptr ) {
376
376
#ifdef __thumb__
377
377
if (uc->uc_mcontext .arm_cpsr & PSR_T_BIT) {
378
378
intptr_t p = (intptr_t )pc | 0x1 ;
@@ -390,7 +390,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
390
390
#endif
391
391
392
392
// save all thread context in case we need to restore it
393
- if (thread != NULL ) thread->set_saved_exception_pc (pc);
393
+ if (thread != nullptr ) thread->set_saved_exception_pc (pc);
394
394
395
395
os::Posix::ucontext_set_pc (uc, stub);
396
396
return true ;
@@ -442,7 +442,7 @@ size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
442
442
// helper functions for fatal error handler
443
443
444
444
void os::print_context (outputStream *st, const void *context) {
445
- if (context == NULL ) return ;
445
+ if (context == nullptr ) return ;
446
446
447
447
const ucontext_t *uc = (const ucontext_t *)context;
448
448
@@ -471,7 +471,7 @@ void os::print_context(outputStream *st, const void *context) {
471
471
}
472
472
473
473
void os::print_tos_pc (outputStream *st, const void *context) {
474
- if (context == NULL ) return ;
474
+ if (context == nullptr ) return ;
475
475
476
476
const ucontext_t * uc = (const ucontext_t *)context;
477
477
@@ -488,7 +488,7 @@ void os::print_tos_pc(outputStream *st, const void *context) {
488
488
}
489
489
490
490
void os::print_register_info (outputStream *st, const void *context) {
491
- if (context == NULL ) return ;
491
+ if (context == nullptr ) return ;
492
492
493
493
const ucontext_t *uc = (const ucontext_t *)context;
494
494
@@ -514,7 +514,7 @@ int64_t ARMAtomicFuncs::cmpxchg_long_bootstrap(int64_t compare_value, int64_t ex
514
514
// try to use the stub:
515
515
cmpxchg_long_func_t func = CAST_TO_FN_PTR (cmpxchg_long_func_t , StubRoutines::atomic_cmpxchg_long_entry ());
516
516
517
- if (func != NULL ) {
517
+ if (func != nullptr ) {
518
518
_cmpxchg_long_func = func;
519
519
return (*func)(compare_value, exchange_value, dest);
520
520
}
@@ -530,7 +530,7 @@ int64_t ARMAtomicFuncs::load_long_bootstrap(const volatile int64_t* src) {
530
530
// try to use the stub:
531
531
load_long_func_t func = CAST_TO_FN_PTR (load_long_func_t , StubRoutines::atomic_load_long_entry ());
532
532
533
- if (func != NULL ) {
533
+ if (func != nullptr ) {
534
534
_load_long_func = func;
535
535
return (*func)(src);
536
536
}
@@ -544,7 +544,7 @@ void ARMAtomicFuncs::store_long_bootstrap(int64_t val, volatile int64_t* dest) {
544
544
// try to use the stub:
545
545
store_long_func_t func = CAST_TO_FN_PTR (store_long_func_t , StubRoutines::atomic_store_long_entry ());
546
546
547
- if (func != NULL ) {
547
+ if (func != nullptr ) {
548
548
_store_long_func = func;
549
549
return (*func)(val, dest);
550
550
}
@@ -556,7 +556,7 @@ void ARMAtomicFuncs::store_long_bootstrap(int64_t val, volatile int64_t* dest) {
556
556
int32_t ARMAtomicFuncs::add_bootstrap (int32_t add_value, volatile int32_t *dest) {
557
557
atomic_add_func_t func = CAST_TO_FN_PTR (atomic_add_func_t ,
558
558
StubRoutines::atomic_add_entry ());
559
- if (func != NULL ) {
559
+ if (func != nullptr ) {
560
560
_add_func = func;
561
561
return (*func)(add_value, dest);
562
562
}
@@ -569,7 +569,7 @@ int32_t ARMAtomicFuncs::add_bootstrap(int32_t add_value, volatile int32_t *dest)
569
569
int32_t ARMAtomicFuncs::xchg_bootstrap (int32_t exchange_value, volatile int32_t *dest) {
570
570
atomic_xchg_func_t func = CAST_TO_FN_PTR (atomic_xchg_func_t ,
571
571
StubRoutines::atomic_xchg_entry ());
572
- if (func != NULL ) {
572
+ if (func != nullptr ) {
573
573
_xchg_func = func;
574
574
return (*func)(exchange_value, dest);
575
575
}
@@ -583,7 +583,7 @@ int32_t ARMAtomicFuncs::cmpxchg_bootstrap(int32_t compare_value, int32_t exchang
583
583
// try to use the stub:
584
584
cmpxchg_func_t func = CAST_TO_FN_PTR (cmpxchg_func_t , StubRoutines::atomic_cmpxchg_entry ());
585
585
586
- if (func != NULL ) {
586
+ if (func != nullptr ) {
587
587
_cmpxchg_func = func;
588
588
return (*func)(compare_value, exchange_value, dest);
589
589
}
0 commit comments