1
1
/*
2
- * Copyright (c) 2011, 2022 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2011, 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
45
45
// Allocate them with new so they are never destroyed (otherwise, a
46
46
// forced exit could destroy these objects while they are still in
47
47
// use).
48
- ConstantOopWriteValue* CodeInstaller::_oop_null_scope_value = new (mtJVMCI) ConstantOopWriteValue(NULL );
48
+ ConstantOopWriteValue* CodeInstaller::_oop_null_scope_value = new (mtJVMCI) ConstantOopWriteValue(nullptr );
49
49
ConstantIntValue* CodeInstaller::_int_m1_scope_value = new (mtJVMCI) ConstantIntValue(-1 );
50
50
ConstantIntValue* CodeInstaller::_int_0_scope_value = new (mtJVMCI) ConstantIntValue((jint)0 );
51
51
ConstantIntValue* CodeInstaller::_int_1_scope_value = new (mtJVMCI) ConstantIntValue(1 );
@@ -252,7 +252,7 @@ OopMap* CodeInstaller::create_oop_map(HotSpotCompiledCodeStream* stream, u1 debu
252
252
assert (is_set (debug_info_flags, DI_HAS_REFERENCE_MAP), " must be" );
253
253
u2 max_register_size = stream->read_u2 (" maxRegisterSize" );
254
254
if (!_has_wide_vector && SharedRuntime::is_wide_vector (max_register_size)) {
255
- if (SharedRuntime::polling_page_vectors_safepoint_handler_blob () == NULL ) {
255
+ if (SharedRuntime::polling_page_vectors_safepoint_handler_blob () == nullptr ) {
256
256
JVMCI_ERROR_NULL (" JVMCI is producing code using vectors larger than the runtime supports%s" , stream->context ());
257
257
}
258
258
_has_wide_vector = true ;
@@ -377,15 +377,15 @@ Handle CodeInstaller::read_oop(HotSpotCompiledCodeStream* stream, u1 tag, JVMCI_
377
377
JVMCI_ERROR_ (Handle (), " unexpected oop tag: %d" , tag)
378
378
}
379
379
if (obj == nullptr ) {
380
- JVMCI_THROW_MSG_ (InternalError, " Constant was unexpectedly NULL " , Handle ());
380
+ JVMCI_THROW_MSG_ (InternalError, " Constant was unexpectedly null " , Handle ());
381
381
} else {
382
382
oopDesc::verify (obj);
383
383
}
384
384
return Handle (stream->thread (), obj);
385
385
}
386
386
387
387
ScopeValue* CodeInstaller::get_scope_value (HotSpotCompiledCodeStream* stream, u1 tag, BasicType type, ScopeValue* &second, JVMCI_TRAPS) {
388
- second = NULL ;
388
+ second = nullptr ;
389
389
switch (tag) {
390
390
case ILLEGAL: {
391
391
if (type != T_ILLEGAL) {
@@ -484,7 +484,7 @@ void CodeInstaller::record_object_value(ObjectValue* sv, HotSpotCompiledCodeStre
484
484
485
485
u2 length = stream->read_u2 (" values:length" );
486
486
for (jint i = 0 ; i < length; i++) {
487
- ScopeValue* cur_second = NULL ;
487
+ ScopeValue* cur_second = nullptr ;
488
488
BasicType type = (BasicType) stream->read_u1 (" basicType" );
489
489
ScopeValue* value;
490
490
u1 tag = stream->read_u1 (" tag" );
@@ -506,22 +506,22 @@ void CodeInstaller::record_object_value(ObjectValue* sv, HotSpotCompiledCodeStre
506
506
value = get_scope_value (stream, tag, type, cur_second, JVMCI_CHECK);
507
507
}
508
508
509
- if (isLongArray && cur_second == NULL ) {
509
+ if (isLongArray && cur_second == nullptr ) {
510
510
// we're trying to put ints into a long array... this isn't really valid, but it's used for some optimizations.
511
511
// add an int 0 constant
512
512
cur_second = _int_0_scope_value;
513
513
}
514
514
515
- if (isByteArray && cur_second != NULL && (type == T_DOUBLE || type == T_LONG)) {
515
+ if (isByteArray && cur_second != nullptr && (type == T_DOUBLE || type == T_LONG)) {
516
516
// we are trying to write a long in a byte Array. We will need to count the illegals to restore the type of
517
517
// the thing we put inside.
518
- cur_second = NULL ;
518
+ cur_second = nullptr ;
519
519
}
520
520
521
- if (cur_second != NULL ) {
521
+ if (cur_second != nullptr ) {
522
522
sv->field_values ()->append (cur_second);
523
523
}
524
- assert (value != NULL , " missing value" );
524
+ assert (value != nullptr , " missing value" );
525
525
sv->field_values ()->append (value);
526
526
}
527
527
}
@@ -573,9 +573,9 @@ GrowableArray<MonitorValue*>* CodeInstaller::read_monitor_values(HotSpotCompiled
573
573
GrowableArray<MonitorValue*>* monitors = new GrowableArray<MonitorValue*>(length);
574
574
for (int i = 0 ; i < length; i++) {
575
575
bool eliminated = stream->read_bool (" isEliminated" );
576
- ScopeValue* second = NULL ;
576
+ ScopeValue* second = nullptr ;
577
577
ScopeValue* owner_value = get_scope_value (stream, stream->read_u1 (" tag" ), T_OBJECT, second, JVMCI_CHECK_NULL);
578
- assert (second == NULL , " monitor cannot occupy two stack slots" );
578
+ assert (second == nullptr , " monitor cannot occupy two stack slots" );
579
579
580
580
ScopeValue* lock_data_value = get_scope_value (stream, stream->read_u1 (" tag" ), T_LONG, second, JVMCI_CHECK_NULL);
581
581
assert (second == lock_data_value, " monitor is LONG value that occupies two stack slots" );
@@ -589,9 +589,9 @@ GrowableArray<MonitorValue*>* CodeInstaller::read_monitor_values(HotSpotCompiled
589
589
590
590
void CodeInstaller::initialize_dependencies (HotSpotCompiledCodeStream* stream, u1 code_flags, OopRecorder* oop_recorder, JVMCI_TRAPS) {
591
591
JavaThread* thread = stream->thread ();
592
- CompilerThread* compilerThread = thread->is_Compiler_thread () ? CompilerThread::cast (thread) : NULL ;
592
+ CompilerThread* compilerThread = thread->is_Compiler_thread () ? CompilerThread::cast (thread) : nullptr ;
593
593
_oop_recorder = oop_recorder;
594
- _dependencies = new Dependencies (&_arena, _oop_recorder, compilerThread != NULL ? compilerThread->log () : NULL );
594
+ _dependencies = new Dependencies (&_arena, _oop_recorder, compilerThread != nullptr ? compilerThread->log () : nullptr );
595
595
if (is_set (code_flags, HCC_HAS_ASSUMPTIONS)) {
596
596
u2 length = stream->read_u2 (" assumptions:length" );
597
597
for (int i = 0 ; i < length; ++i) {
@@ -714,7 +714,7 @@ JVMCI::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler,
714
714
false );
715
715
result = JVMCI::ok;
716
716
} else {
717
- if (compile_state != NULL ) {
717
+ if (compile_state != nullptr ) {
718
718
jvmci_env ()->set_compile_state (compile_state);
719
719
}
720
720
@@ -728,7 +728,7 @@ JVMCI::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler,
728
728
}
729
729
730
730
JVMCIObject mirror = installed_code;
731
- nmethod* nm = NULL ; // nm is an out parameter of register_method
731
+ nmethod* nm = nullptr ; // nm is an out parameter of register_method
732
732
result = runtime ()->register_method (jvmci_env (),
733
733
method,
734
734
nm,
@@ -754,7 +754,7 @@ JVMCI::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler,
754
754
speculations_len);
755
755
if (result == JVMCI::ok) {
756
756
cb = nm;
757
- if (compile_state == NULL ) {
757
+ if (compile_state == nullptr ) {
758
758
// This compile didn't come through the CompileBroker so perform the printing here
759
759
DirectiveSet* directive = DirectivesStack::getMatchingDirective (method, compiler);
760
760
nm->maybe_print_nmethod (directive);
@@ -763,7 +763,7 @@ JVMCI::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler,
763
763
}
764
764
}
765
765
766
- if (cb != NULL ) {
766
+ if (cb != nullptr ) {
767
767
// Make sure the pre-calculated constants section size was correct.
768
768
guarantee ((cb->code_begin () - cb->content_begin ()) >= _constants_size, " %d < %d" , (int )(cb->code_begin () - cb->content_begin ()), _constants_size);
769
769
}
@@ -861,7 +861,7 @@ JVMCI::CodeInstallResult CodeInstaller::initialize_buffer(JVMCIObject compiled_c
861
861
}
862
862
863
863
buffer.initialize (total_size, locs_buffer_size);
864
- if (buffer.blob () == NULL ) {
864
+ if (buffer.blob () == nullptr ) {
865
865
return JVMCI::cache_full;
866
866
}
867
867
buffer.initialize_stubs_size (stubs_size);
@@ -1017,7 +1017,7 @@ void CodeInstaller::read_virtual_objects(HotSpotCompiledCodeStream* stream, JVMC
1017
1017
if (length == 0 ) {
1018
1018
return ;
1019
1019
}
1020
- GrowableArray<ScopeValue*> *objects = new GrowableArray<ScopeValue*>(length, length, NULL );
1020
+ GrowableArray<ScopeValue*> *objects = new GrowableArray<ScopeValue*>(length, length, nullptr );
1021
1021
stream->set_virtual_objects (objects);
1022
1022
// Create the unique ObjectValues
1023
1023
JavaThread* thread = stream->thread ();
@@ -1076,9 +1076,9 @@ void CodeInstaller::record_scope(jint pc_offset, HotSpotCompiledCodeStream* stre
1076
1076
bool reexecute = false ;
1077
1077
bool rethrow_exception = false ;
1078
1078
1079
- DebugToken* locals_token = NULL ;
1080
- DebugToken* stack_token = NULL ;
1081
- DebugToken* monitors_token = NULL ;
1079
+ DebugToken* locals_token = nullptr ;
1080
+ DebugToken* stack_token = nullptr ;
1081
+ DebugToken* monitors_token = nullptr ;
1082
1082
1083
1083
if (full_info) {
1084
1084
u1 frame_flags = stream->read_u1 (" flags" );
@@ -1100,7 +1100,7 @@ void CodeInstaller::record_scope(jint pc_offset, HotSpotCompiledCodeStream* stre
1100
1100
// has_ea_local_in_scope and arg_escape should be added to JVMCI
1101
1101
const bool has_ea_local_in_scope = false ;
1102
1102
const bool arg_escape = false ;
1103
- _debug_recorder->describe_scope (pc_offset, method, NULL , bci, reexecute, rethrow_exception, is_mh_invoke, return_oop,
1103
+ _debug_recorder->describe_scope (pc_offset, method, nullptr , bci, reexecute, rethrow_exception, is_mh_invoke, return_oop,
1104
1104
has_ea_local_in_scope, arg_escape,
1105
1105
locals_token, stack_token, monitors_token);
1106
1106
}
0 commit comments