1
1
/*
2
- * Copyright (c) 2003, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2003, 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
@@ -158,7 +158,7 @@ static bool is_decipherable_compiled_frame(JavaThread* thread, frame* fr, Compil
158
158
PcDesc* pc_desc = nm->pc_desc_at (fr->pc ());
159
159
160
160
// Did we find a useful PcDesc?
161
- if (pc_desc != NULL &&
161
+ if (pc_desc != nullptr &&
162
162
pc_desc->scope_decode_offset () != DebugInformationRecorder::serialized_null) {
163
163
return true ;
164
164
}
@@ -172,7 +172,7 @@ static bool is_decipherable_compiled_frame(JavaThread* thread, frame* fr, Compil
172
172
PcDesc* pc_desc = nm->pc_desc_near (fr->pc () + 1 );
173
173
174
174
// Now do we have a useful PcDesc?
175
- if (pc_desc == NULL ||
175
+ if (pc_desc == nullptr ||
176
176
pc_desc->scope_decode_offset () == DebugInformationRecorder::serialized_null) {
177
177
// No debug information is available for this PC.
178
178
//
@@ -207,7 +207,7 @@ static bool is_decipherable_compiled_frame(JavaThread* thread, frame* fr, Compil
207
207
208
208
// Determine if 'fr' is a walkable interpreted frame. Returns false
209
209
// if it is not. *method_p, and *bci_p are not set when false is
210
- // returned. *method_p is non-NULL if frame was executing a Java
210
+ // returned. *method_p is non-null if frame was executing a Java
211
211
// method. *bci_p is != -1 if a valid BCI in the Java method could
212
212
// be found.
213
213
// Note: this method returns true when a valid Java method is found
@@ -273,13 +273,13 @@ static bool is_decipherable_interpreted_frame(JavaThread* thread,
273
273
// Check the return value of find_initial_Java_frame and the value of
274
274
// 'method_p' to decide on how use the results returned by this method.
275
275
//
276
- // If 'method_p' is not NULL , an initial Java frame has been found and
276
+ // If 'method_p' is not null , an initial Java frame has been found and
277
277
// the stack can be walked starting from that initial frame. In this case,
278
278
// 'method_p' points to the Method that the initial frame belongs to and
279
279
// the initial Java frame is returned in initial_frame_p.
280
280
//
281
281
// find_initial_Java_frame() returns true if a Method has been found (i.e.,
282
- // 'method_p' is not NULL ) and the initial frame that belongs to that Method
282
+ // 'method_p' is not null ) and the initial frame that belongs to that Method
283
283
// is decipherable.
284
284
//
285
285
// A frame is considered to be decipherable:
@@ -292,7 +292,7 @@ static bool is_decipherable_interpreted_frame(JavaThread* thread,
292
292
// Note that find_initial_Java_frame() can return false even if an initial
293
293
// Java method was found (e.g., there is no PCDesc available for the method).
294
294
//
295
- // If 'method_p' is NULL , it was not possible to find a Java frame when
295
+ // If 'method_p' is null , it was not possible to find a Java frame when
296
296
// walking the stack starting from 'fr'. In this case find_initial_Java_frame
297
297
// returns false.
298
298
@@ -305,10 +305,10 @@ static bool find_initial_Java_frame(JavaThread* thread,
305
305
// It is possible that for a frame containing a compiled method
306
306
// we can capture the method but no bci. If we get no
307
307
// bci the frame isn't walkable but the method is usable.
308
- // Therefore we init the returned Method* to NULL so the
308
+ // Therefore we init the returned Method* to null so the
309
309
// caller can make the distinction.
310
310
311
- *method_p = NULL ;
311
+ *method_p = nullptr ;
312
312
313
313
// On the initial call to this method the frame we get may not be
314
314
// recognizable to us. This should only happen if we are in a JRT_LEAF
@@ -333,11 +333,11 @@ static bool find_initial_Java_frame(JavaThread* thread,
333
333
}
334
334
335
335
if (candidate.is_entry_frame ()) {
336
- // jcw is NULL if the java call wrapper could not be found
336
+ // jcw is null if the java call wrapper could not be found
337
337
JavaCallWrapper* jcw = candidate.entry_frame_call_wrapper_if_safe (thread);
338
338
// If initial frame is frame from StubGenerator and there is no
339
339
// previous anchor, there are no java frames associated with a method
340
- if (jcw == NULL || jcw->is_first_frame ()) {
340
+ if (jcw == nullptr || jcw->is_first_frame ()) {
341
341
return false ;
342
342
}
343
343
}
@@ -363,7 +363,7 @@ static bool find_initial_Java_frame(JavaThread* thread,
363
363
// it see if we can find such a frame because only frames with codeBlobs
364
364
// are possible Java frames.
365
365
366
- if (fr->cb () == NULL ) {
366
+ if (fr->cb () == nullptr ) {
367
367
368
368
// See if we can find a useful frame
369
369
int loop_count;
@@ -376,9 +376,9 @@ static bool find_initial_Java_frame(JavaThread* thread,
376
376
for (loop_count = 0 ; loop_max == 0 || loop_count < loop_max; loop_count++) {
377
377
if (!candidate.safe_for_sender (thread)) return false ;
378
378
candidate = candidate.sender (&map);
379
- if (candidate.cb () != NULL ) break ;
379
+ if (candidate.cb () != nullptr ) break ;
380
380
}
381
- if (candidate.cb () == NULL ) return false ;
381
+ if (candidate.cb () == nullptr ) return false ;
382
382
}
383
383
384
384
// We have a frame known to be in the codeCache
@@ -393,11 +393,11 @@ static bool find_initial_Java_frame(JavaThread* thread,
393
393
for (loop_count = 0 ; loop_max == 0 || loop_count < loop_max; loop_count++) {
394
394
395
395
if (candidate.is_entry_frame ()) {
396
- // jcw is NULL if the java call wrapper couldn't be found
396
+ // jcw is null if the java call wrapper couldn't be found
397
397
JavaCallWrapper *jcw = candidate.entry_frame_call_wrapper_if_safe (thread);
398
398
// If initial frame is frame from StubGenerator and there is no
399
399
// previous anchor, there are no java frames associated with a method
400
- if (jcw == NULL || jcw->is_first_frame ()) {
400
+ if (jcw == nullptr || jcw->is_first_frame ()) {
401
401
return false ;
402
402
}
403
403
}
@@ -443,7 +443,7 @@ static bool find_initial_Java_frame(JavaThread* thread,
443
443
// is_decipherable_compiled_frame may modify candidate's pc
444
444
*initial_frame_p = candidate;
445
445
446
- assert (nm->pc_desc_at (candidate.pc ()) != NULL , " debug information must be available if the frame is decipherable" );
446
+ assert (nm->pc_desc_at (candidate.pc ()) != nullptr , " debug information must be available if the frame is decipherable" );
447
447
448
448
return true ;
449
449
}
@@ -457,7 +457,7 @@ static bool find_initial_Java_frame(JavaThread* thread,
457
457
// since once we find a frame in the code cache they
458
458
// all should be there.
459
459
460
- if (candidate.cb () == NULL ) return false ;
460
+ if (candidate.cb () == nullptr ) return false ;
461
461
462
462
}
463
463
@@ -478,13 +478,13 @@ static void forte_fill_call_trace_given_top(JavaThread* thd,
478
478
int count;
479
479
480
480
count = 0 ;
481
- assert (trace->frames != NULL , " trace->frames must be non-NULL " );
481
+ assert (trace->frames != nullptr , " trace->frames must be non-null " );
482
482
483
483
// Walk the stack starting from 'top_frame' and search for an initial Java frame.
484
484
find_initial_Java_frame (thd, &top_frame, &initial_Java_frame, &method, &bci);
485
485
486
486
// Check if a Java Method has been found.
487
- if (method == NULL ) return ;
487
+ if (method == nullptr ) return ;
488
488
489
489
if (!Method::is_valid_method (method)) {
490
490
trace->num_frames = ticks_GC_active; // -2
@@ -579,7 +579,7 @@ void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) {
579
579
Thread* raw_thread = Thread::current_or_null_safe ();
580
580
JavaThread* thread;
581
581
582
- if (trace->env_id == NULL || raw_thread == NULL || !raw_thread->is_Java_thread () ||
582
+ if (trace->env_id == nullptr || raw_thread == nullptr || !raw_thread->is_Java_thread () ||
583
583
(thread = JavaThread::cast (raw_thread))->is_exiting ()) {
584
584
// bad env_id, thread has exited or thread is exiting
585
585
trace->num_frames = ticks_thread_exit; // -8
@@ -710,8 +710,8 @@ void Forte::register_stub(const char* name, address start, address end) {
710
710
assert (pointer_delta (end, start, sizeof (jbyte)) < INT_MAX,
711
711
" Code size exceeds maximum range" );
712
712
713
- collector_func_load ((char *)name, NULL , NULL , start,
714
- pointer_delta (end, start, sizeof (jbyte)), 0 , NULL );
713
+ collector_func_load ((char *)name, nullptr , nullptr , start,
714
+ pointer_delta (end, start, sizeof (jbyte)), 0 , nullptr );
715
715
#endif // !_WINDOWS
716
716
}
717
717
0 commit comments