1
1
/*
2
- * Copyright (c) 1999, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1999, 2023 , Oracle and/or its affiliates. All rights reserved.
3
3
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
4
4
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
5
*
@@ -108,21 +108,21 @@ address os::fetch_frame_from_context(const void* ucVoid,
108
108
address epc;
109
109
const ucontext_t * uc = (const ucontext_t *)ucVoid;
110
110
111
- if (uc != NULL ) {
111
+ if (uc != nullptr ) {
112
112
epc = os::Posix::ucontext_get_pc (uc);
113
- if (ret_sp != NULL ) {
113
+ if (ret_sp != nullptr ) {
114
114
*ret_sp = os::Linux::ucontext_get_sp (uc);
115
115
}
116
- if (ret_fp != NULL ) {
116
+ if (ret_fp != nullptr ) {
117
117
*ret_fp = os::Linux::ucontext_get_fp (uc);
118
118
}
119
119
} else {
120
- epc = NULL ;
121
- if (ret_sp != NULL ) {
122
- *ret_sp = (intptr_t *)NULL ;
120
+ epc = nullptr ;
121
+ if (ret_sp != nullptr ) {
122
+ *ret_sp = (intptr_t *)nullptr ;
123
123
}
124
- if (ret_fp != NULL ) {
125
- *ret_fp = (intptr_t *)NULL ;
124
+ if (ret_fp != nullptr ) {
125
+ *ret_fp = (intptr_t *)nullptr ;
126
126
}
127
127
}
128
128
@@ -142,8 +142,8 @@ frame os::fetch_compiled_frame_from_context(const void* ucVoid) {
142
142
}
143
143
144
144
frame os::fetch_frame_from_context (const void * ucVoid) {
145
- intptr_t * frame_sp = NULL ;
146
- intptr_t * frame_fp = NULL ;
145
+ intptr_t * frame_sp = nullptr ;
146
+ intptr_t * frame_fp = nullptr ;
147
147
address epc = fetch_frame_from_context (ucVoid, &frame_sp, &frame_fp);
148
148
if (!is_readable_pointer (epc)) {
149
149
// Try to recover from calling into bad memory
@@ -162,7 +162,7 @@ frame os::get_sender_for_C_frame(frame* fr) {
162
162
163
163
NOINLINE frame os::current_frame () {
164
164
intptr_t **sender_sp = (intptr_t **)__builtin_frame_address (0 );
165
- if (sender_sp != NULL ) {
165
+ if (sender_sp != nullptr ) {
166
166
frame myframe ((intptr_t *)os::current_stack_pointer (),
167
167
sender_sp[frame::link_offset],
168
168
CAST_FROM_FN_PTR (address, os::current_frame));
@@ -183,12 +183,12 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
183
183
ucontext_t * uc, JavaThread* thread) {
184
184
185
185
// decide if this trap can be handled by a stub
186
- address stub = NULL ;
186
+ address stub = nullptr ;
187
187
188
- address pc = NULL ;
188
+ address pc = nullptr ;
189
189
190
190
// %note os_trap_1
191
- if (info != NULL && uc != NULL && thread != NULL ) {
191
+ if (info != nullptr && uc != nullptr && thread != nullptr ) {
192
192
pc = (address) os::Posix::ucontext_get_pc (uc);
193
193
194
194
address addr = (address) info->si_addr ;
@@ -226,9 +226,9 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
226
226
// here if the underlying file has been truncated.
227
227
// Do not crash the VM in such a case.
228
228
CodeBlob* cb = CodeCache::find_blob (pc);
229
- CompiledMethod* nm = (cb != NULL ) ? cb->as_compiled_method_or_null () : NULL ;
229
+ CompiledMethod* nm = (cb != nullptr ) ? cb->as_compiled_method_or_null () : nullptr ;
230
230
bool is_unsafe_arraycopy = (thread->doing_unsafe_access () && UnsafeCopyMemory::contains_pc (pc));
231
- if ((nm != NULL && nm->has_unsafe_access ()) || is_unsafe_arraycopy) {
231
+ if ((nm != nullptr && nm->has_unsafe_access ()) || is_unsafe_arraycopy) {
232
232
address next_pc = pc + NativeCall::instruction_size;
233
233
if (is_unsafe_arraycopy) {
234
234
next_pc = UnsafeCopyMemory::page_error_continue_pc (pc);
@@ -249,7 +249,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
249
249
// End life with a fatal error, message and detail message and the context.
250
250
// Note: no need to do any post-processing here (e.g. signal chaining)
251
251
va_list va_dummy;
252
- VMError::report_and_die (thread, uc, NULL , 0 , msg, detail_msg, va_dummy);
252
+ VMError::report_and_die (thread, uc, nullptr , 0 , msg, detail_msg, va_dummy);
253
253
va_end (va_dummy);
254
254
255
255
ShouldNotReachHere ();
@@ -287,9 +287,9 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
287
287
}
288
288
}
289
289
290
- if (stub != NULL ) {
290
+ if (stub != nullptr ) {
291
291
// save all thread context in case we need to restore it
292
- if (thread != NULL ) {
292
+ if (thread != nullptr ) {
293
293
thread->set_saved_exception_pc (pc);
294
294
}
295
295
@@ -340,7 +340,7 @@ static const char* reg_abi_names[] = {
340
340
};
341
341
342
342
void os::print_context (outputStream *st, const void *context) {
343
- if (context == NULL ) return ;
343
+ if (context == nullptr ) return ;
344
344
345
345
const ucontext_t *uc = (const ucontext_t *)context;
346
346
@@ -352,7 +352,7 @@ void os::print_context(outputStream *st, const void *context) {
352
352
}
353
353
354
354
void os::print_tos_pc (outputStream *st, const void *context) {
355
- if (context == NULL ) return ;
355
+ if (context == nullptr ) return ;
356
356
357
357
const ucontext_t * uc = (const ucontext_t *)context;
358
358
@@ -369,7 +369,7 @@ void os::print_tos_pc(outputStream *st, const void *context) {
369
369
}
370
370
371
371
void os::print_register_info (outputStream *st, const void *context) {
372
- if (context == NULL ) return ;
372
+ if (context == nullptr ) return ;
373
373
374
374
const ucontext_t *uc = (const ucontext_t *)context;
375
375
0 commit comments