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
* 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
@@ -126,14 +126,14 @@ address os::fetch_frame_from_context(const void* ucVoid,
126
126
address epc;
127
127
const ucontext_t * uc = (const ucontext_t *)ucVoid;
128
128
129
- if (uc != NULL ) {
129
+ if (uc != nullptr ) {
130
130
epc = os::Posix::ucontext_get_pc (uc);
131
131
if (ret_sp) *ret_sp = os::Linux::ucontext_get_sp (uc);
132
132
if (ret_fp) *ret_fp = os::Linux::ucontext_get_fp (uc);
133
133
} else {
134
- epc = NULL ;
135
- if (ret_sp) *ret_sp = (intptr_t *)NULL ;
136
- if (ret_fp) *ret_fp = (intptr_t *)NULL ;
134
+ epc = nullptr ;
135
+ if (ret_sp) *ret_sp = (intptr_t *)nullptr ;
136
+ if (ret_fp) *ret_fp = (intptr_t *)nullptr ;
137
137
}
138
138
139
139
return epc;
@@ -209,20 +209,20 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
209
209
210
210
/*
211
211
NOTE: does not seem to work on linux.
212
- if (info == NULL || info->si_code <= 0 || info->si_code == SI_NOINFO) {
212
+ if (info == nullptr || info->si_code <= 0 || info->si_code == SI_NOINFO) {
213
213
// can't decode this kind of signal
214
- info = NULL ;
214
+ info = nullptr ;
215
215
} else {
216
216
assert(sig == info->si_signo, "bad siginfo");
217
217
}
218
218
*/
219
219
// decide if this trap can be handled by a stub
220
- address stub = NULL ;
220
+ address stub = nullptr ;
221
221
222
- address pc = NULL ;
222
+ address pc = nullptr ;
223
223
224
224
// %note os_trap_1
225
- if (info != NULL && uc != NULL && thread != NULL ) {
225
+ if (info != nullptr && uc != nullptr && thread != nullptr ) {
226
226
pc = (address) os::Posix::ucontext_get_pc (uc);
227
227
228
228
if (sig == SIGSEGV && info->si_addr == 0 && info->si_code == SI_KERNEL) {
@@ -260,9 +260,9 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
260
260
// here if the underlying file has been truncated.
261
261
// Do not crash the VM in such a case.
262
262
CodeBlob* cb = CodeCache::find_blob (pc);
263
- CompiledMethod* nm = (cb != NULL ) ? cb->as_compiled_method_or_null () : NULL ;
263
+ CompiledMethod* nm = (cb != nullptr ) ? cb->as_compiled_method_or_null () : nullptr ;
264
264
bool is_unsafe_arraycopy = thread->doing_unsafe_access () && UnsafeCopyMemory::contains_pc (pc);
265
- if ((nm != NULL && nm->has_unsafe_access ()) || is_unsafe_arraycopy) {
265
+ if ((nm != nullptr && nm->has_unsafe_access ()) || is_unsafe_arraycopy) {
266
266
address next_pc = Assembler::locate_next_instruction (pc);
267
267
if (is_unsafe_arraycopy) {
268
268
next_pc = UnsafeCopyMemory::page_error_continue_pc (pc);
@@ -346,7 +346,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
346
346
// the si_code for this condition may change in the future.
347
347
// Furthermore, a false-positive should be harmless.
348
348
if (UnguardOnExecutionViolation > 0 &&
349
- stub == NULL &&
349
+ stub == nullptr &&
350
350
(sig == SIGSEGV || sig == SIGBUS) &&
351
351
uc->uc_mcontext .gregs [REG_TRAPNO] == trap_page_fault) {
352
352
int page_size = os::vm_page_size ();
@@ -409,9 +409,9 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
409
409
}
410
410
#endif // !AMD64
411
411
412
- if (stub != NULL ) {
412
+ if (stub != nullptr ) {
413
413
// save all thread context in case we need to restore it
414
- if (thread != NULL ) thread->set_saved_exception_pc (pc);
414
+ if (thread != nullptr ) thread->set_saved_exception_pc (pc);
415
415
416
416
os::Posix::ucontext_set_pc (uc, stub);
417
417
return true ;
@@ -466,9 +466,9 @@ juint os::cpu_microcode_revision() {
466
466
size_t len = sizeof (data);
467
467
while (!feof (fp)) {
468
468
if (fgets (data, len, fp)) {
469
- if (strstr (data, " microcode" ) != NULL ) {
469
+ if (strstr (data, " microcode" ) != nullptr ) {
470
470
char * rev = strchr (data, ' :' );
471
- if (rev != NULL ) sscanf (rev + 1 , " %x" , &result);
471
+ if (rev != nullptr ) sscanf (rev + 1 , " %x" , &result);
472
472
break ;
473
473
}
474
474
}
@@ -507,7 +507,7 @@ size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
507
507
// helper functions for fatal error handler
508
508
509
509
void os::print_context (outputStream *st, const void *context) {
510
- if (context == NULL ) return ;
510
+ if (context == nullptr ) return ;
511
511
512
512
const ucontext_t *uc = (const ucontext_t *)context;
513
513
@@ -559,7 +559,7 @@ void os::print_context(outputStream *st, const void *context) {
559
559
}
560
560
561
561
void os::print_tos_pc (outputStream *st, const void *context) {
562
- if (context == NULL ) return ;
562
+ if (context == nullptr ) return ;
563
563
564
564
const ucontext_t * uc = (const ucontext_t *)context;
565
565
@@ -576,7 +576,7 @@ void os::print_tos_pc(outputStream *st, const void *context) {
576
576
}
577
577
578
578
void os::print_register_info (outputStream *st, const void *context) {
579
- if (context == NULL ) return ;
579
+ if (context == nullptr ) return ;
580
580
581
581
const ucontext_t *uc = (const ucontext_t *)context;
582
582
1 commit comments
openjdk-notifier[bot] commentedon Feb 2, 2023
Review
Issues