mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-29 12:23:39 +00:00
8300242: Replace NULL with nullptr in share/code/
Reviewed-by: kvn, thartmann
This commit is contained in:
parent
5f66024e95
commit
cfe57466dd
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,7 +27,7 @@
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
#include "runtime/safepoint.hpp"
|
||||
|
||||
CompiledICProtectionBehaviour* CompiledICProtectionBehaviour::_current = NULL;
|
||||
CompiledICProtectionBehaviour* CompiledICProtectionBehaviour::_current = nullptr;
|
||||
|
||||
bool DefaultICProtectionBehaviour::lock(CompiledMethod* method) {
|
||||
if (is_safe(method)) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -140,7 +140,7 @@ CodeBlob::CodeBlob(const char* name, CompilerType type, const CodeBlobLayout& la
|
||||
|
||||
// Creates a simple CodeBlob. Sets up the size of the different regions.
|
||||
RuntimeBlob::RuntimeBlob(const char* name, int header_size, int size, int frame_complete, int locs_size)
|
||||
: CodeBlob(name, compiler_none, CodeBlobLayout((address) this, size, header_size, locs_size, size), frame_complete, 0, NULL, false /* caller_must_gc_arguments */)
|
||||
: CodeBlob(name, compiler_none, CodeBlobLayout((address) this, size, header_size, locs_size, size), frame_complete, 0, nullptr, false /* caller_must_gc_arguments */)
|
||||
{
|
||||
assert(is_aligned(locs_size, oopSize), "unaligned size");
|
||||
}
|
||||
@ -162,7 +162,7 @@ RuntimeBlob::RuntimeBlob(
|
||||
}
|
||||
|
||||
void RuntimeBlob::free(RuntimeBlob* blob) {
|
||||
assert(blob != NULL, "caller must check for NULL");
|
||||
assert(blob != nullptr, "caller must check for nullptr");
|
||||
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
|
||||
blob->flush();
|
||||
{
|
||||
@ -175,7 +175,7 @@ void RuntimeBlob::free(RuntimeBlob* blob) {
|
||||
|
||||
void CodeBlob::flush() {
|
||||
FREE_C_HEAP_ARRAY(unsigned char, _oop_maps);
|
||||
_oop_maps = NULL;
|
||||
_oop_maps = nullptr;
|
||||
NOT_PRODUCT(_asm_remarks.clear());
|
||||
NOT_PRODUCT(_dbg_strings.clear());
|
||||
}
|
||||
@ -183,10 +183,10 @@ void CodeBlob::flush() {
|
||||
void CodeBlob::set_oop_maps(OopMapSet* p) {
|
||||
// Danger Will Robinson! This method allocates a big
|
||||
// chunk of memory, its your job to free it.
|
||||
if (p != NULL) {
|
||||
if (p != nullptr) {
|
||||
_oop_maps = ImmutableOopMapSet::build_from(p);
|
||||
} else {
|
||||
_oop_maps = NULL;
|
||||
_oop_maps = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ void RuntimeBlob::trace_new_stub(RuntimeBlob* stub, const char* name1, const cha
|
||||
// Do not hold the CodeCache lock during name formatting.
|
||||
assert(!CodeCache_lock->owned_by_self(), "release CodeCache before registering the stub");
|
||||
|
||||
if (stub != NULL && (PrintStubCode ||
|
||||
if (stub != nullptr && (PrintStubCode ||
|
||||
Forte::is_enabled() ||
|
||||
JvmtiExport::should_post_dynamic_code_generated())) {
|
||||
char stub_id[256];
|
||||
@ -207,7 +207,7 @@ void RuntimeBlob::trace_new_stub(RuntimeBlob* stub, const char* name1, const cha
|
||||
tty->print_cr("Decoding %s " INTPTR_FORMAT, stub_id, (intptr_t) stub);
|
||||
Disassembler::decode(stub->code_begin(), stub->code_end(), tty
|
||||
NOT_PRODUCT(COMMA &stub->asm_remarks()));
|
||||
if ((stub->oop_maps() != NULL) && AbstractDisassembler::show_structs()) {
|
||||
if ((stub->oop_maps() != nullptr) && AbstractDisassembler::show_structs()) {
|
||||
tty->print_cr("- - - [OOP MAPS]- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
|
||||
stub->oop_maps()->print();
|
||||
}
|
||||
@ -230,7 +230,7 @@ void RuntimeBlob::trace_new_stub(RuntimeBlob* stub, const char* name1, const cha
|
||||
}
|
||||
|
||||
const ImmutableOopMap* CodeBlob::oop_map_for_return_address(address return_address) const {
|
||||
assert(_oop_maps != NULL, "nope");
|
||||
assert(_oop_maps != nullptr, "nope");
|
||||
return _oop_maps->find_map_at_offset((intptr_t) return_address - (intptr_t) code_begin());
|
||||
}
|
||||
|
||||
@ -250,12 +250,12 @@ BufferBlob::BufferBlob(const char* name, int size)
|
||||
BufferBlob* BufferBlob::create(const char* name, int buffer_size) {
|
||||
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
|
||||
|
||||
BufferBlob* blob = NULL;
|
||||
BufferBlob* blob = nullptr;
|
||||
unsigned int size = sizeof(BufferBlob);
|
||||
// align the size to CodeEntryAlignment
|
||||
size = CodeBlob::align_code_offset(size);
|
||||
size += align_up(buffer_size, oopSize);
|
||||
assert(name != NULL, "must provide a name");
|
||||
assert(name != nullptr, "must provide a name");
|
||||
{
|
||||
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
blob = new (size) BufferBlob(name, size);
|
||||
@ -268,15 +268,15 @@ BufferBlob* BufferBlob::create(const char* name, int buffer_size) {
|
||||
|
||||
|
||||
BufferBlob::BufferBlob(const char* name, int size, CodeBuffer* cb)
|
||||
: RuntimeBlob(name, cb, sizeof(BufferBlob), size, CodeOffsets::frame_never_safe, 0, NULL)
|
||||
: RuntimeBlob(name, cb, sizeof(BufferBlob), size, CodeOffsets::frame_never_safe, 0, nullptr)
|
||||
{}
|
||||
|
||||
BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) {
|
||||
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
|
||||
|
||||
BufferBlob* blob = NULL;
|
||||
BufferBlob* blob = nullptr;
|
||||
unsigned int size = CodeBlob::allocation_size(cb, sizeof(BufferBlob));
|
||||
assert(name != NULL, "must provide a name");
|
||||
assert(name != nullptr, "must provide a name");
|
||||
{
|
||||
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
blob = new (size) BufferBlob(name, size, cb);
|
||||
@ -309,7 +309,7 @@ AdapterBlob* AdapterBlob::create(CodeBuffer* cb) {
|
||||
|
||||
CodeCache::gc_on_allocation();
|
||||
|
||||
AdapterBlob* blob = NULL;
|
||||
AdapterBlob* blob = nullptr;
|
||||
unsigned int size = CodeBlob::allocation_size(cb, sizeof(AdapterBlob));
|
||||
{
|
||||
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
@ -338,12 +338,12 @@ VtableBlob::VtableBlob(const char* name, int size) :
|
||||
VtableBlob* VtableBlob::create(const char* name, int buffer_size) {
|
||||
assert(JavaThread::current()->thread_state() == _thread_in_vm, "called with the wrong state");
|
||||
|
||||
VtableBlob* blob = NULL;
|
||||
VtableBlob* blob = nullptr;
|
||||
unsigned int size = sizeof(VtableBlob);
|
||||
// align the size to CodeEntryAlignment
|
||||
size = align_code_offset(size);
|
||||
size += align_up(buffer_size, oopSize);
|
||||
assert(name != NULL, "must provide a name");
|
||||
assert(name != nullptr, "must provide a name");
|
||||
{
|
||||
if (!CodeCache_lock->try_lock()) {
|
||||
// If we can't take the CodeCache_lock, then this is a bad time to perform the ongoing
|
||||
@ -356,7 +356,7 @@ VtableBlob* VtableBlob::create(const char* name, int buffer_size) {
|
||||
// consistently taken in the opposite order. Bailing out results in an IC transition to
|
||||
// the clean state instead, which will cause subsequent calls to retry the transitioning
|
||||
// eventually.
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
blob = new (size) VtableBlob(name, size);
|
||||
CodeCache_lock->unlock();
|
||||
@ -373,7 +373,7 @@ VtableBlob* VtableBlob::create(const char* name, int buffer_size) {
|
||||
MethodHandlesAdapterBlob* MethodHandlesAdapterBlob::create(int buffer_size) {
|
||||
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
|
||||
|
||||
MethodHandlesAdapterBlob* blob = NULL;
|
||||
MethodHandlesAdapterBlob* blob = nullptr;
|
||||
unsigned int size = sizeof(MethodHandlesAdapterBlob);
|
||||
// align the size to CodeEntryAlignment
|
||||
size = CodeBlob::align_code_offset(size);
|
||||
@ -381,7 +381,7 @@ MethodHandlesAdapterBlob* MethodHandlesAdapterBlob::create(int buffer_size) {
|
||||
{
|
||||
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
blob = new (size) MethodHandlesAdapterBlob(size);
|
||||
if (blob == NULL) {
|
||||
if (blob == nullptr) {
|
||||
vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "CodeCache: no room for method handle adapter blob");
|
||||
}
|
||||
}
|
||||
@ -414,7 +414,7 @@ RuntimeStub* RuntimeStub::new_runtime_stub(const char* stub_name,
|
||||
OopMapSet* oop_maps,
|
||||
bool caller_must_gc_arguments)
|
||||
{
|
||||
RuntimeStub* stub = NULL;
|
||||
RuntimeStub* stub = nullptr;
|
||||
unsigned int size = CodeBlob::allocation_size(cb, sizeof(RuntimeStub));
|
||||
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
|
||||
{
|
||||
@ -473,7 +473,7 @@ DeoptimizationBlob* DeoptimizationBlob::create(
|
||||
int unpack_with_reexecution_offset,
|
||||
int frame_size)
|
||||
{
|
||||
DeoptimizationBlob* blob = NULL;
|
||||
DeoptimizationBlob* blob = nullptr;
|
||||
unsigned int size = CodeBlob::allocation_size(cb, sizeof(DeoptimizationBlob));
|
||||
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
|
||||
{
|
||||
@ -512,7 +512,7 @@ UncommonTrapBlob* UncommonTrapBlob::create(
|
||||
OopMapSet* oop_maps,
|
||||
int frame_size)
|
||||
{
|
||||
UncommonTrapBlob* blob = NULL;
|
||||
UncommonTrapBlob* blob = nullptr;
|
||||
unsigned int size = CodeBlob::allocation_size(cb, sizeof(UncommonTrapBlob));
|
||||
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
|
||||
{
|
||||
@ -548,7 +548,7 @@ ExceptionBlob* ExceptionBlob::create(
|
||||
OopMapSet* oop_maps,
|
||||
int frame_size)
|
||||
{
|
||||
ExceptionBlob* blob = NULL;
|
||||
ExceptionBlob* blob = nullptr;
|
||||
unsigned int size = CodeBlob::allocation_size(cb, sizeof(ExceptionBlob));
|
||||
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
|
||||
{
|
||||
@ -583,7 +583,7 @@ SafepointBlob* SafepointBlob::create(
|
||||
OopMapSet* oop_maps,
|
||||
int frame_size)
|
||||
{
|
||||
SafepointBlob* blob = NULL;
|
||||
SafepointBlob* blob = nullptr;
|
||||
unsigned int size = CodeBlob::allocation_size(cb, sizeof(SafepointBlob));
|
||||
ThreadInVMfromUnknown __tiv; // get to VM state in case we block on CodeCache_lock
|
||||
{
|
||||
@ -615,7 +615,7 @@ void CodeBlob::dump_for_addr(address addr, outputStream* st, bool verbose) const
|
||||
if (is_buffer_blob()) {
|
||||
// the interpreter is generated into a buffer blob
|
||||
InterpreterCodelet* i = Interpreter::codelet_containing(addr);
|
||||
if (i != NULL) {
|
||||
if (i != nullptr) {
|
||||
st->print_cr(INTPTR_FORMAT " is at code_begin+%d in an Interpreter codelet", p2i(addr), (int)(addr - i->code_begin()));
|
||||
i->print_on(st);
|
||||
return;
|
||||
@ -632,7 +632,7 @@ void CodeBlob::dump_for_addr(address addr, outputStream* st, bool verbose) const
|
||||
}
|
||||
// the stubroutines are generated into a buffer blob
|
||||
StubCodeDesc* d = StubCodeDesc::desc_for(addr);
|
||||
if (d != NULL) {
|
||||
if (d != nullptr) {
|
||||
st->print_cr(INTPTR_FORMAT " is at begin+%d in a stub", p2i(addr), (int)(addr - d->begin()));
|
||||
d->print_on(st);
|
||||
st->cr();
|
||||
@ -648,7 +648,7 @@ void CodeBlob::dump_for_addr(address addr, outputStream* st, bool verbose) const
|
||||
return;
|
||||
}
|
||||
VtableStub* v = VtableStubs::stub_containing(addr);
|
||||
if (v != NULL) {
|
||||
if (v != nullptr) {
|
||||
st->print_cr(INTPTR_FORMAT " is at entry_point+%d in a vtable stub", p2i(addr), (int)(addr - v->entry_point()));
|
||||
v->print_on(st);
|
||||
st->cr();
|
||||
@ -775,7 +775,7 @@ JavaFrameAnchor* UpcallStub::jfa_for_frame(const frame& frame) const {
|
||||
}
|
||||
|
||||
void UpcallStub::free(UpcallStub* blob) {
|
||||
assert(blob != nullptr, "caller must check for NULL");
|
||||
assert(blob != nullptr, "caller must check for nullptr");
|
||||
JNIHandles::destroy_global(blob->receiver());
|
||||
RuntimeBlob::free(blob);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -165,9 +165,9 @@ public:
|
||||
CompilerType compiler_type() const { return _type; }
|
||||
|
||||
// Casting
|
||||
nmethod* as_nmethod_or_null() { return is_nmethod() ? (nmethod*) this : NULL; }
|
||||
nmethod* as_nmethod_or_null() { return is_nmethod() ? (nmethod*) this : nullptr; }
|
||||
nmethod* as_nmethod() { assert(is_nmethod(), "must be nmethod"); return (nmethod*) this; }
|
||||
CompiledMethod* as_compiled_method_or_null() { return is_compiled() ? (CompiledMethod*) this : NULL; }
|
||||
CompiledMethod* as_compiled_method_or_null() { return is_compiled() ? (CompiledMethod*) this : nullptr; }
|
||||
CompiledMethod* as_compiled_method() { assert(is_compiled(), "must be compiled"); return (CompiledMethod*) this; }
|
||||
CodeBlob* as_codeblob_or_null() const { return (CodeBlob*) this; }
|
||||
UpcallStub* as_upcall_stub() const { assert(is_upcall_stub(), "must be upcall stub"); return (UpcallStub*) this; }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -32,7 +32,7 @@
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
|
||||
inline const ImmutableOopMap* CodeBlob::oop_map_for_slot(int slot, address return_address) const {
|
||||
assert(_oop_maps != NULL, "nope");
|
||||
assert(_oop_maps != nullptr, "nope");
|
||||
return _oop_maps->find_map_at_slot(slot, (intptr_t) return_address - (intptr_t) code_begin());
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -163,12 +163,12 @@ class CodeBlob_sizes {
|
||||
#define FOR_ALL_ALLOCABLE_HEAPS(heap) for (GrowableArrayIterator<CodeHeap*> heap = _allocable_heaps->begin(); heap != _allocable_heaps->end(); ++heap)
|
||||
|
||||
// Iterate over all CodeBlobs (cb) on the given CodeHeap
|
||||
#define FOR_ALL_BLOBS(cb, heap) for (CodeBlob* cb = first_blob(heap); cb != NULL; cb = next_blob(heap, cb))
|
||||
#define FOR_ALL_BLOBS(cb, heap) for (CodeBlob* cb = first_blob(heap); cb != nullptr; cb = next_blob(heap, cb))
|
||||
|
||||
address CodeCache::_low_bound = 0;
|
||||
address CodeCache::_high_bound = 0;
|
||||
int CodeCache::_number_of_nmethods_with_dependencies = 0;
|
||||
ExceptionCache* volatile CodeCache::_exception_cache_purge_list = NULL;
|
||||
ExceptionCache* volatile CodeCache::_exception_cache_purge_list = nullptr;
|
||||
|
||||
// Initialize arrays of CodeHeap subsets
|
||||
GrowableArray<CodeHeap*>* CodeCache::_heaps = new(mtCode) GrowableArray<CodeHeap*> (static_cast<int>(CodeBlobType::All), mtCode);
|
||||
@ -398,7 +398,7 @@ const char* CodeCache::get_code_heap_flag_name(CodeBlobType code_blob_type) {
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,18 +455,18 @@ CodeHeap* CodeCache::get_code_heap_containing(void* start) {
|
||||
return *heap;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CodeHeap* CodeCache::get_code_heap(const CodeBlob* cb) {
|
||||
assert(cb != NULL, "CodeBlob is null");
|
||||
assert(cb != nullptr, "CodeBlob is null");
|
||||
FOR_ALL_HEAPS(heap) {
|
||||
if ((*heap)->contains_blob(cb)) {
|
||||
return *heap;
|
||||
}
|
||||
}
|
||||
ShouldNotReachHere();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CodeHeap* CodeCache::get_code_heap(CodeBlobType code_blob_type) {
|
||||
@ -475,12 +475,12 @@ CodeHeap* CodeCache::get_code_heap(CodeBlobType code_blob_type) {
|
||||
return *heap;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CodeBlob* CodeCache::first_blob(CodeHeap* heap) {
|
||||
assert_locked_or_safepoint(CodeCache_lock);
|
||||
assert(heap != NULL, "heap is null");
|
||||
assert(heap != nullptr, "heap is null");
|
||||
return (CodeBlob*)heap->first();
|
||||
}
|
||||
|
||||
@ -488,13 +488,13 @@ CodeBlob* CodeCache::first_blob(CodeBlobType code_blob_type) {
|
||||
if (heap_available(code_blob_type)) {
|
||||
return first_blob(get_code_heap(code_blob_type));
|
||||
} else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
CodeBlob* CodeCache::next_blob(CodeHeap* heap, CodeBlob* cb) {
|
||||
assert_locked_or_safepoint(CodeCache_lock);
|
||||
assert(heap != NULL, "heap is null");
|
||||
assert(heap != nullptr, "heap is null");
|
||||
return (CodeBlob*)heap->next(cb);
|
||||
}
|
||||
|
||||
@ -509,17 +509,17 @@ CodeBlob* CodeCache::allocate(int size, CodeBlobType code_blob_type, bool handle
|
||||
assert_locked_or_safepoint(CodeCache_lock);
|
||||
assert(size > 0, "Code cache allocation request must be > 0 but is %d", size);
|
||||
if (size <= 0) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
CodeBlob* cb = NULL;
|
||||
CodeBlob* cb = nullptr;
|
||||
|
||||
// Get CodeHeap for the given CodeBlobType
|
||||
CodeHeap* heap = get_code_heap(code_blob_type);
|
||||
assert(heap != NULL, "heap is null");
|
||||
assert(heap != nullptr, "heap is null");
|
||||
|
||||
while (true) {
|
||||
cb = (CodeBlob*)heap->allocate(size);
|
||||
if (cb != NULL) break;
|
||||
if (cb != nullptr) break;
|
||||
if (!heap->expand_by(CodeCacheExpansionSize)) {
|
||||
// Save original type for error reporting
|
||||
if (orig_code_blob_type == CodeBlobType::All) {
|
||||
@ -558,7 +558,7 @@ CodeBlob* CodeCache::allocate(int size, CodeBlobType code_blob_type, bool handle
|
||||
MutexUnlocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
CompileBroker::handle_full_code_cache(orig_code_blob_type);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (PrintCodeCacheExtension) {
|
||||
ResourceMark rm;
|
||||
@ -632,7 +632,7 @@ void CodeCache::commit(CodeBlob* cb) {
|
||||
bool CodeCache::contains(void *p) {
|
||||
// S390 uses contains() in current_frame(), which is used before
|
||||
// code cache initialization if NativeMemoryTracking=detail is set.
|
||||
S390_ONLY(if (_heaps == NULL) return false;)
|
||||
S390_ONLY(if (_heaps == nullptr) return false;)
|
||||
// It should be ok to call contains without holding a lock.
|
||||
FOR_ALL_HEAPS(heap) {
|
||||
if ((*heap)->contains(p)) {
|
||||
@ -650,13 +650,13 @@ bool CodeCache::contains(nmethod *nm) {
|
||||
// valid indices, which it will always do, as long as the CodeBlob is not in the process of being recycled.
|
||||
CodeBlob* CodeCache::find_blob(void* start) {
|
||||
// NMT can walk the stack before code cache is created
|
||||
if (_heaps != NULL) {
|
||||
if (_heaps != nullptr) {
|
||||
CodeHeap* heap = get_code_heap_containing(start);
|
||||
if (heap != NULL) {
|
||||
if (heap != nullptr) {
|
||||
return heap->find_blob(start);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nmethod* CodeCache::find_nmethod(void* start) {
|
||||
@ -871,7 +871,7 @@ void CodeCache::on_gc_marking_cycle_finish() {
|
||||
|
||||
void CodeCache::arm_all_nmethods() {
|
||||
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
|
||||
if (bs_nm != NULL) {
|
||||
if (bs_nm != nullptr) {
|
||||
bs_nm->arm_all_nmethods();
|
||||
}
|
||||
}
|
||||
@ -917,7 +917,7 @@ void CodeCache::verify_icholder_relocations() {
|
||||
FOR_ALL_HEAPS(heap) {
|
||||
FOR_ALL_BLOBS(cb, *heap) {
|
||||
CompiledMethod *nm = cb->as_compiled_method_or_null();
|
||||
if (nm != NULL) {
|
||||
if (nm != nullptr) {
|
||||
count += nm->verify_icholder_relocations();
|
||||
}
|
||||
}
|
||||
@ -947,22 +947,22 @@ void CodeCache::release_exception_cache(ExceptionCache* entry) {
|
||||
// followed by a global handshake operation.
|
||||
void CodeCache::purge_exception_caches() {
|
||||
ExceptionCache* curr = _exception_cache_purge_list;
|
||||
while (curr != NULL) {
|
||||
while (curr != nullptr) {
|
||||
ExceptionCache* next = curr->purge_list_next();
|
||||
delete curr;
|
||||
curr = next;
|
||||
}
|
||||
_exception_cache_purge_list = NULL;
|
||||
_exception_cache_purge_list = nullptr;
|
||||
}
|
||||
|
||||
// Register an is_unloading nmethod to be flushed after unlinking
|
||||
void CodeCache::register_unlinked(nmethod* nm) {
|
||||
assert(nm->unlinked_next() == NULL, "Only register for unloading once");
|
||||
assert(nm->unlinked_next() == nullptr, "Only register for unloading once");
|
||||
for (;;) {
|
||||
// Only need acquire when reading the head, when the next
|
||||
// pointer is walked, which it is not here.
|
||||
nmethod* head = Atomic::load(&_unlinked_head);
|
||||
nmethod* next = head != NULL ? head : nm; // Self looped means end of list
|
||||
nmethod* next = head != nullptr ? head : nm; // Self looped means end of list
|
||||
nm->set_unlinked_next(next);
|
||||
if (Atomic::cmpxchg(&_unlinked_head, head, nm) == head) {
|
||||
break;
|
||||
@ -973,9 +973,9 @@ void CodeCache::register_unlinked(nmethod* nm) {
|
||||
// Flush all the nmethods the GC unlinked
|
||||
void CodeCache::flush_unlinked_nmethods() {
|
||||
nmethod* nm = _unlinked_head;
|
||||
_unlinked_head = NULL;
|
||||
_unlinked_head = nullptr;
|
||||
size_t freed_memory = 0;
|
||||
while (nm != NULL) {
|
||||
while (nm != nullptr) {
|
||||
nmethod* next = nm->unlinked_next();
|
||||
freed_memory += nm->total_size();
|
||||
nm->flush();
|
||||
@ -998,7 +998,7 @@ void CodeCache::flush_unlinked_nmethods() {
|
||||
}
|
||||
|
||||
uint8_t CodeCache::_unloading_cycle = 1;
|
||||
nmethod* volatile CodeCache::_unlinked_head = NULL;
|
||||
nmethod* volatile CodeCache::_unlinked_head = nullptr;
|
||||
|
||||
void CodeCache::increment_unloading_cycle() {
|
||||
// 2-bit value (see IsUnloadingState in nmethod.cpp for details)
|
||||
@ -1037,7 +1037,7 @@ void CodeCache::verify_oops() {
|
||||
|
||||
int CodeCache::blob_count(CodeBlobType code_blob_type) {
|
||||
CodeHeap* heap = get_code_heap(code_blob_type);
|
||||
return (heap != NULL) ? heap->blob_count() : 0;
|
||||
return (heap != nullptr) ? heap->blob_count() : 0;
|
||||
}
|
||||
|
||||
int CodeCache::blob_count() {
|
||||
@ -1050,7 +1050,7 @@ int CodeCache::blob_count() {
|
||||
|
||||
int CodeCache::nmethod_count(CodeBlobType code_blob_type) {
|
||||
CodeHeap* heap = get_code_heap(code_blob_type);
|
||||
return (heap != NULL) ? heap->nmethod_count() : 0;
|
||||
return (heap != nullptr) ? heap->nmethod_count() : 0;
|
||||
}
|
||||
|
||||
int CodeCache::nmethod_count() {
|
||||
@ -1063,7 +1063,7 @@ int CodeCache::nmethod_count() {
|
||||
|
||||
int CodeCache::adapter_count(CodeBlobType code_blob_type) {
|
||||
CodeHeap* heap = get_code_heap(code_blob_type);
|
||||
return (heap != NULL) ? heap->adapter_count() : 0;
|
||||
return (heap != nullptr) ? heap->adapter_count() : 0;
|
||||
}
|
||||
|
||||
int CodeCache::adapter_count() {
|
||||
@ -1076,12 +1076,12 @@ int CodeCache::adapter_count() {
|
||||
|
||||
address CodeCache::low_bound(CodeBlobType code_blob_type) {
|
||||
CodeHeap* heap = get_code_heap(code_blob_type);
|
||||
return (heap != NULL) ? (address)heap->low_boundary() : NULL;
|
||||
return (heap != nullptr) ? (address)heap->low_boundary() : nullptr;
|
||||
}
|
||||
|
||||
address CodeCache::high_bound(CodeBlobType code_blob_type) {
|
||||
CodeHeap* heap = get_code_heap(code_blob_type);
|
||||
return (heap != NULL) ? (address)heap->high_boundary() : NULL;
|
||||
return (heap != nullptr) ? (address)heap->high_boundary() : nullptr;
|
||||
}
|
||||
|
||||
size_t CodeCache::capacity() {
|
||||
@ -1094,7 +1094,7 @@ size_t CodeCache::capacity() {
|
||||
|
||||
size_t CodeCache::unallocated_capacity(CodeBlobType code_blob_type) {
|
||||
CodeHeap* heap = get_code_heap(code_blob_type);
|
||||
return (heap != NULL) ? heap->unallocated_capacity() : 0;
|
||||
return (heap != nullptr) ? heap->unallocated_capacity() : 0;
|
||||
}
|
||||
|
||||
size_t CodeCache::unallocated_capacity() {
|
||||
@ -1266,33 +1266,33 @@ int CodeCache::mark_for_deoptimization(KlassDepChange& changes) {
|
||||
|
||||
CompiledMethod* CodeCache::find_compiled(void* start) {
|
||||
CodeBlob *cb = find_blob(start);
|
||||
assert(cb == NULL || cb->is_compiled(), "did not find an compiled_method");
|
||||
assert(cb == nullptr || cb->is_compiled(), "did not find an compiled_method");
|
||||
return (CompiledMethod*)cb;
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMTI
|
||||
// RedefineClasses support for saving nmethods that are dependent on "old" methods.
|
||||
// We don't really expect this table to grow very large. If it does, it can become a hashtable.
|
||||
static GrowableArray<CompiledMethod*>* old_compiled_method_table = NULL;
|
||||
static GrowableArray<CompiledMethod*>* old_compiled_method_table = nullptr;
|
||||
|
||||
static void add_to_old_table(CompiledMethod* c) {
|
||||
if (old_compiled_method_table == NULL) {
|
||||
if (old_compiled_method_table == nullptr) {
|
||||
old_compiled_method_table = new (mtCode) GrowableArray<CompiledMethod*>(100, mtCode);
|
||||
}
|
||||
old_compiled_method_table->push(c);
|
||||
}
|
||||
|
||||
static void reset_old_method_table() {
|
||||
if (old_compiled_method_table != NULL) {
|
||||
if (old_compiled_method_table != nullptr) {
|
||||
delete old_compiled_method_table;
|
||||
old_compiled_method_table = NULL;
|
||||
old_compiled_method_table = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove this method when flushed.
|
||||
void CodeCache::unregister_old_nmethod(CompiledMethod* c) {
|
||||
assert_lock_strong(CodeCache_lock);
|
||||
if (old_compiled_method_table != NULL) {
|
||||
if (old_compiled_method_table != nullptr) {
|
||||
int index = old_compiled_method_table->find(c);
|
||||
if (index != -1) {
|
||||
old_compiled_method_table->delete_at(index);
|
||||
@ -1303,7 +1303,7 @@ void CodeCache::unregister_old_nmethod(CompiledMethod* c) {
|
||||
void CodeCache::old_nmethods_do(MetadataClosure* f) {
|
||||
// Walk old method table and mark those on stack.
|
||||
int length = 0;
|
||||
if (old_compiled_method_table != NULL) {
|
||||
if (old_compiled_method_table != nullptr) {
|
||||
length = old_compiled_method_table->length();
|
||||
for (int i = 0; i < length; i++) {
|
||||
// Walk all methods saved on the last pass. Concurrent class unloading may
|
||||
@ -1468,7 +1468,7 @@ PRAGMA_FORMAT_NONLITERAL_IGNORED
|
||||
void CodeCache::report_codemem_full(CodeBlobType code_blob_type, bool print) {
|
||||
// Get nmethod heap for the given CodeBlobType and build CodeCacheFull event
|
||||
CodeHeap* heap = get_code_heap(code_blob_type);
|
||||
assert(heap != NULL, "heap is null");
|
||||
assert(heap != nullptr, "heap is null");
|
||||
|
||||
int full_count = heap->report_full();
|
||||
|
||||
@ -1536,7 +1536,7 @@ void CodeCache::print_memory_overhead() {
|
||||
size_t wasted_bytes = 0;
|
||||
FOR_ALL_ALLOCABLE_HEAPS(heap) {
|
||||
CodeHeap* curr_heap = *heap;
|
||||
for (CodeBlob* cb = (CodeBlob*)curr_heap->first(); cb != NULL; cb = (CodeBlob*)curr_heap->next(cb)) {
|
||||
for (CodeBlob* cb = (CodeBlob*)curr_heap->first(); cb != nullptr; cb = (CodeBlob*)curr_heap->next(cb)) {
|
||||
HeapBlock* heap_block = ((HeapBlock*)cb) - 1;
|
||||
wasted_bytes += heap_block->length() * CodeCacheSegmentSize - cb->size();
|
||||
}
|
||||
@ -1586,7 +1586,7 @@ void CodeCache::print_internals() {
|
||||
if (cb->is_nmethod()) {
|
||||
nmethod* nm = (nmethod*)cb;
|
||||
|
||||
if (Verbose && nm->method() != NULL) {
|
||||
if (Verbose && nm->method() != nullptr) {
|
||||
ResourceMark rm;
|
||||
char *method_name = nm->method()->name_and_sig_as_C_string();
|
||||
tty->print("%s", method_name);
|
||||
@ -1596,9 +1596,9 @@ void CodeCache::print_internals() {
|
||||
nmethodCount++;
|
||||
|
||||
if(nm->is_not_entrant()) { nmethodNotEntrant++; }
|
||||
if(nm->method() != NULL && nm->is_native_method()) { nmethodNative++; }
|
||||
if(nm->method() != nullptr && nm->is_native_method()) { nmethodNative++; }
|
||||
|
||||
if(nm->method() != NULL && nm->is_java_method()) {
|
||||
if(nm->method() != nullptr && nm->is_java_method()) {
|
||||
nmethodJava++;
|
||||
max_nm_size = MAX2(max_nm_size, nm->size());
|
||||
}
|
||||
@ -1624,7 +1624,7 @@ void CodeCache::print_internals() {
|
||||
NMethodIterator iter(NMethodIterator::all_blobs);
|
||||
while(iter.next()) {
|
||||
nmethod* nm = iter.method();
|
||||
if(nm->method() != NULL && nm->is_java_method()) {
|
||||
if(nm->method() != nullptr && nm->is_java_method()) {
|
||||
buckets[nm->size() / bucketSize]++;
|
||||
}
|
||||
}
|
||||
@ -1737,7 +1737,7 @@ void CodeCache::print() {
|
||||
number_of_blobs++;
|
||||
code_size += cb->code_size();
|
||||
ImmutableOopMapSet* set = cb->oop_maps();
|
||||
if (set != NULL) {
|
||||
if (set != nullptr) {
|
||||
number_of_oop_maps += set->count();
|
||||
map_size += set->nr_of_bytes();
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -115,7 +115,7 @@ class CodeCache : AllStatic {
|
||||
static void check_heap_sizes(size_t non_nmethod_size, size_t profiled_size, size_t non_profiled_size, size_t cache_size, bool all_set);
|
||||
// Creates a new heap with the given name and size, containing CodeBlobs of the given type
|
||||
static void add_heap(ReservedSpace rs, const char* name, CodeBlobType code_blob_type);
|
||||
static CodeHeap* get_code_heap_containing(void* p); // Returns the CodeHeap containing the given pointer, or NULL
|
||||
static CodeHeap* get_code_heap_containing(void* p); // Returns the CodeHeap containing the given pointer, or nullptr
|
||||
static CodeHeap* get_code_heap(const CodeBlob* cb); // Returns the CodeHeap for the given CodeBlob
|
||||
static CodeHeap* get_code_heap(CodeBlobType code_blob_type); // Returns the CodeHeap for the given CodeBlobType
|
||||
// Returns the name of the VM option to set the size of the corresponding CodeHeap
|
||||
@ -321,7 +321,7 @@ class CodeCache : AllStatic {
|
||||
|
||||
static int get_codemem_full_count(CodeBlobType code_blob_type) {
|
||||
CodeHeap* heap = get_code_heap(code_blob_type);
|
||||
return (heap != NULL) ? heap->full_count() : 0;
|
||||
return (heap != nullptr) ? heap->full_count() : 0;
|
||||
}
|
||||
|
||||
// CodeHeap State Analytics.
|
||||
@ -366,7 +366,7 @@ template <class T, class Filter, bool is_relaxed> class CodeBlobIterator : publi
|
||||
// Filter is_unloading as required
|
||||
if (_only_not_unloading) {
|
||||
CompiledMethod* cm = _code_blob->as_compiled_method_or_null();
|
||||
if (cm != NULL && cm->is_unloading()) {
|
||||
if (cm != nullptr && cm->is_unloading()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -376,10 +376,10 @@ template <class T, class Filter, bool is_relaxed> class CodeBlobIterator : publi
|
||||
}
|
||||
|
||||
public:
|
||||
CodeBlobIterator(LivenessFilter filter, T* nm = NULL)
|
||||
CodeBlobIterator(LivenessFilter filter, T* nm = nullptr)
|
||||
: _only_not_unloading(filter == only_not_unloading)
|
||||
{
|
||||
if (Filter::heaps() == NULL) {
|
||||
if (Filter::heaps() == nullptr) {
|
||||
// The iterator is supposed to shortcut since we have
|
||||
// _heap == _end, but make sure we do not have garbage
|
||||
// in other fields as well.
|
||||
@ -388,9 +388,9 @@ template <class T, class Filter, bool is_relaxed> class CodeBlobIterator : publi
|
||||
}
|
||||
_heap = Filter::heaps()->begin();
|
||||
_end = Filter::heaps()->end();
|
||||
// If set to NULL, initialized by first call to next()
|
||||
// If set to nullptr, initialized by first call to next()
|
||||
_code_blob = nm;
|
||||
if (nm != NULL) {
|
||||
if (nm != nullptr) {
|
||||
while(!(*_heap)->contains_blob(_code_blob)) {
|
||||
++_heap;
|
||||
}
|
||||
@ -409,7 +409,7 @@ template <class T, class Filter, bool is_relaxed> class CodeBlobIterator : publi
|
||||
}
|
||||
}
|
||||
|
||||
bool end() const { return _code_blob == NULL; }
|
||||
bool end() const { return _code_blob == nullptr; }
|
||||
T* method() const { return (T*)_code_blob; }
|
||||
|
||||
private:
|
||||
@ -421,9 +421,9 @@ private:
|
||||
}
|
||||
CodeHeap *heap = *_heap;
|
||||
// Get first method CodeBlob
|
||||
if (_code_blob == NULL) {
|
||||
if (_code_blob == nullptr) {
|
||||
_code_blob = CodeCache::first_blob(heap);
|
||||
if (_code_blob == NULL) {
|
||||
if (_code_blob == nullptr) {
|
||||
return false;
|
||||
} else if (Filter::apply(_code_blob)) {
|
||||
return true;
|
||||
@ -431,10 +431,10 @@ private:
|
||||
}
|
||||
// Search for next method CodeBlob
|
||||
_code_blob = CodeCache::next_blob(heap, _code_blob);
|
||||
while (_code_blob != NULL && !Filter::apply(_code_blob)) {
|
||||
while (_code_blob != nullptr && !Filter::apply(_code_blob)) {
|
||||
_code_blob = CodeCache::next_blob(heap, _code_blob);
|
||||
}
|
||||
return _code_blob != NULL;
|
||||
return _code_blob != nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -37,7 +37,7 @@ inline CodeBlob* CodeCache::find_blob_fast(void* pc) {
|
||||
inline CodeBlob* CodeCache::find_blob_and_oopmap(void* pc, int& slot) {
|
||||
NativePostCallNop* nop = nativePostCallNop_at((address) pc);
|
||||
CodeBlob* cb;
|
||||
if (nop != NULL && nop->displacement() != 0) {
|
||||
if (nop != nullptr && nop->displacement() != 0) {
|
||||
int offset = (nop->displacement() & 0xffffff);
|
||||
cb = (CodeBlob*) ((address) pc - offset);
|
||||
slot = ((nop->displacement() >> 24) & 0xff);
|
||||
@ -46,13 +46,13 @@ inline CodeBlob* CodeCache::find_blob_and_oopmap(void* pc, int& slot) {
|
||||
cb = CodeCache::find_blob(pc);
|
||||
slot = -1;
|
||||
}
|
||||
assert(cb != NULL, "must be");
|
||||
assert(cb != nullptr, "must be");
|
||||
return cb;
|
||||
}
|
||||
|
||||
inline int CodeCache::find_oopmap_slot_fast(void* pc) {
|
||||
NativePostCallNop* nop = nativePostCallNop_at((address) pc);
|
||||
return (nop != NULL && nop->displacement() != 0)
|
||||
return (nop != nullptr && nop->displacement() != 0)
|
||||
? ((nop->displacement() >> 24) & 0xff)
|
||||
: -1;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -139,7 +139,7 @@
|
||||
// Flush the buffer contents unconditionally.
|
||||
// No action if the buffer is empty.
|
||||
#define BUFFEREDSTREAM_FLUSH(_termString) \
|
||||
if (((_termString) != NULL) && (strlen(_termString) > 0)){\
|
||||
if (((_termString) != nullptr) && (strlen(_termString) > 0)){\
|
||||
_sstbuf->print("%s", _termString); \
|
||||
} \
|
||||
if (_sstbuf != _outbuf) { \
|
||||
@ -153,7 +153,7 @@
|
||||
// Flush the buffer contents if the remaining capacity is
|
||||
// less than the given threshold.
|
||||
#define BUFFEREDSTREAM_FLUSH_IF(_termString, _remSize) \
|
||||
if (((_termString) != NULL) && (strlen(_termString) > 0)){\
|
||||
if (((_termString) != nullptr) && (strlen(_termString) > 0)){\
|
||||
_sstbuf->print("%s", _termString); \
|
||||
} \
|
||||
if (_sstbuf != _outbuf) { \
|
||||
@ -193,7 +193,7 @@
|
||||
BUFFEREDSTREAM_DECL_SIZE(_anyst, _outst, 4*K)
|
||||
|
||||
#define BUFFEREDSTREAM_FLUSH(_termString) \
|
||||
if (((_termString) != NULL) && (strlen(_termString) > 0)){\
|
||||
if (((_termString) != nullptr) && (strlen(_termString) > 0)){\
|
||||
_outbuf->print("%s", _termString); \
|
||||
}
|
||||
|
||||
@ -237,8 +237,8 @@ const unsigned int maxHeaps = 10;
|
||||
static unsigned int nHeaps = 0;
|
||||
static struct CodeHeapStat CodeHeapStatArray[maxHeaps];
|
||||
|
||||
// static struct StatElement *StatArray = NULL;
|
||||
static StatElement* StatArray = NULL;
|
||||
// static struct StatElement *StatArray = nullptr;
|
||||
static StatElement* StatArray = nullptr;
|
||||
static int log2_seg_size = 0;
|
||||
static size_t seg_size = 0;
|
||||
static size_t alloc_granules = 0;
|
||||
@ -249,14 +249,14 @@ static unsigned int nBlocks_t2 = 0; // counting "in_use" nmethods on
|
||||
static unsigned int nBlocks_alive = 0; // counting "not_used" and "not_entrant" nmethods only.
|
||||
static unsigned int nBlocks_stub = 0;
|
||||
|
||||
static struct FreeBlk* FreeArray = NULL;
|
||||
static struct FreeBlk* FreeArray = nullptr;
|
||||
static unsigned int alloc_freeBlocks = 0;
|
||||
|
||||
static struct TopSizeBlk* TopSizeArray = NULL;
|
||||
static struct TopSizeBlk* TopSizeArray = nullptr;
|
||||
static unsigned int alloc_topSizeBlocks = 0;
|
||||
static unsigned int used_topSizeBlocks = 0;
|
||||
|
||||
static struct SizeDistributionElement* SizeDistributionArray = NULL;
|
||||
static struct SizeDistributionElement* SizeDistributionArray = nullptr;
|
||||
|
||||
static int latest_compilation_id = 0;
|
||||
static volatile bool initialization_complete = false;
|
||||
@ -271,13 +271,13 @@ const char* CodeHeapState::get_heapName(CodeHeap* heap) {
|
||||
|
||||
// returns the index for the heap being processed.
|
||||
unsigned int CodeHeapState::findHeapIndex(outputStream* out, const char* heapName) {
|
||||
if (heapName == NULL) {
|
||||
if (heapName == nullptr) {
|
||||
return maxHeaps;
|
||||
}
|
||||
if (SegmentedCodeCache) {
|
||||
// Search for a pre-existing entry. If found, return that index.
|
||||
for (unsigned int i = 0; i < nHeaps; i++) {
|
||||
if (CodeHeapStatArray[i].heapName != NULL && strcmp(heapName, CodeHeapStatArray[i].heapName) == 0) {
|
||||
if (CodeHeapStatArray[i].heapName != nullptr && strcmp(heapName, CodeHeapStatArray[i].heapName) == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@ -318,7 +318,7 @@ void CodeHeapState::get_HeapStatGlobals(outputStream* out, const char* heapName)
|
||||
used_topSizeBlocks = CodeHeapStatArray[ix].used_topSizeBlocks;
|
||||
SizeDistributionArray = CodeHeapStatArray[ix].SizeDistributionArray;
|
||||
} else {
|
||||
StatArray = NULL;
|
||||
StatArray = nullptr;
|
||||
seg_size = 0;
|
||||
log2_seg_size = 0;
|
||||
alloc_granules = 0;
|
||||
@ -328,12 +328,12 @@ void CodeHeapState::get_HeapStatGlobals(outputStream* out, const char* heapName)
|
||||
nBlocks_t2 = 0;
|
||||
nBlocks_alive = 0;
|
||||
nBlocks_stub = 0;
|
||||
FreeArray = NULL;
|
||||
FreeArray = nullptr;
|
||||
alloc_freeBlocks = 0;
|
||||
TopSizeArray = NULL;
|
||||
TopSizeArray = nullptr;
|
||||
alloc_topSizeBlocks = 0;
|
||||
used_topSizeBlocks = 0;
|
||||
SizeDistributionArray = NULL;
|
||||
SizeDistributionArray = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -360,14 +360,14 @@ void CodeHeapState::set_HeapStatGlobals(outputStream* out, const char* heapName)
|
||||
|
||||
//---< get a new statistics array >---
|
||||
void CodeHeapState::prepare_StatArray(outputStream* out, size_t nElem, size_t granularity, const char* heapName) {
|
||||
if (StatArray == NULL) {
|
||||
if (StatArray == nullptr) {
|
||||
StatArray = new StatElement[nElem];
|
||||
//---< reset some counts >---
|
||||
alloc_granules = nElem;
|
||||
granule_size = granularity;
|
||||
}
|
||||
|
||||
if (StatArray == NULL) {
|
||||
if (StatArray == nullptr) {
|
||||
//---< just do nothing if allocation failed >---
|
||||
out->print_cr("Statistics could not be collected for %s, probably out of memory.", heapName);
|
||||
out->print_cr("Current granularity is " SIZE_FORMAT " bytes. Try a coarser granularity.", granularity);
|
||||
@ -381,13 +381,13 @@ void CodeHeapState::prepare_StatArray(outputStream* out, size_t nElem, size_t gr
|
||||
|
||||
//---< get a new free block array >---
|
||||
void CodeHeapState::prepare_FreeArray(outputStream* out, unsigned int nElem, const char* heapName) {
|
||||
if (FreeArray == NULL) {
|
||||
if (FreeArray == nullptr) {
|
||||
FreeArray = new FreeBlk[nElem];
|
||||
//---< reset some counts >---
|
||||
alloc_freeBlocks = nElem;
|
||||
}
|
||||
|
||||
if (FreeArray == NULL) {
|
||||
if (FreeArray == nullptr) {
|
||||
//---< just do nothing if allocation failed >---
|
||||
out->print_cr("Free space analysis cannot be done for %s, probably out of memory.", heapName);
|
||||
alloc_freeBlocks = 0;
|
||||
@ -399,14 +399,14 @@ void CodeHeapState::prepare_FreeArray(outputStream* out, unsigned int nElem, con
|
||||
|
||||
//---< get a new TopSizeArray >---
|
||||
void CodeHeapState::prepare_TopSizeArray(outputStream* out, unsigned int nElem, const char* heapName) {
|
||||
if (TopSizeArray == NULL) {
|
||||
if (TopSizeArray == nullptr) {
|
||||
TopSizeArray = new TopSizeBlk[nElem];
|
||||
//---< reset some counts >---
|
||||
alloc_topSizeBlocks = nElem;
|
||||
used_topSizeBlocks = 0;
|
||||
}
|
||||
|
||||
if (TopSizeArray == NULL) {
|
||||
if (TopSizeArray == nullptr) {
|
||||
//---< just do nothing if allocation failed >---
|
||||
out->print_cr("Top-%d list of largest CodeHeap blocks can not be collected for %s, probably out of memory.", nElem, heapName);
|
||||
alloc_topSizeBlocks = 0;
|
||||
@ -419,11 +419,11 @@ void CodeHeapState::prepare_TopSizeArray(outputStream* out, unsigned int nElem,
|
||||
|
||||
//---< get a new SizeDistributionArray >---
|
||||
void CodeHeapState::prepare_SizeDistArray(outputStream* out, unsigned int nElem, const char* heapName) {
|
||||
if (SizeDistributionArray == NULL) {
|
||||
if (SizeDistributionArray == nullptr) {
|
||||
SizeDistributionArray = new SizeDistributionElement[nElem];
|
||||
}
|
||||
|
||||
if (SizeDistributionArray == NULL) {
|
||||
if (SizeDistributionArray == nullptr) {
|
||||
//---< just do nothing if allocation failed >---
|
||||
out->print_cr("Size distribution can not be collected for %s, probably out of memory.", heapName);
|
||||
} else {
|
||||
@ -440,7 +440,7 @@ void CodeHeapState::prepare_SizeDistArray(outputStream* out, unsigned int nElem,
|
||||
|
||||
//---< get a new SizeDistributionArray >---
|
||||
void CodeHeapState::update_SizeDistArray(outputStream* out, unsigned int len) {
|
||||
if (SizeDistributionArray != NULL) {
|
||||
if (SizeDistributionArray != nullptr) {
|
||||
for (unsigned int i = log2_seg_size-1; i < nSizeDistElements; i++) {
|
||||
if ((SizeDistributionArray[i].rangeStart <= len) && (len < SizeDistributionArray[i].rangeEnd)) {
|
||||
SizeDistributionArray[i].lenSum += len;
|
||||
@ -452,40 +452,40 @@ void CodeHeapState::update_SizeDistArray(outputStream* out, unsigned int len) {
|
||||
}
|
||||
|
||||
void CodeHeapState::discard_StatArray(outputStream* out) {
|
||||
if (StatArray != NULL) {
|
||||
if (StatArray != nullptr) {
|
||||
delete StatArray;
|
||||
StatArray = NULL;
|
||||
StatArray = nullptr;
|
||||
alloc_granules = 0;
|
||||
granule_size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void CodeHeapState::discard_FreeArray(outputStream* out) {
|
||||
if (FreeArray != NULL) {
|
||||
if (FreeArray != nullptr) {
|
||||
delete[] FreeArray;
|
||||
FreeArray = NULL;
|
||||
FreeArray = nullptr;
|
||||
alloc_freeBlocks = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void CodeHeapState::discard_TopSizeArray(outputStream* out) {
|
||||
if (TopSizeArray != NULL) {
|
||||
if (TopSizeArray != nullptr) {
|
||||
for (unsigned int i = 0; i < alloc_topSizeBlocks; i++) {
|
||||
if (TopSizeArray[i].blob_name != NULL) {
|
||||
if (TopSizeArray[i].blob_name != nullptr) {
|
||||
os::free((void*)TopSizeArray[i].blob_name);
|
||||
}
|
||||
}
|
||||
delete[] TopSizeArray;
|
||||
TopSizeArray = NULL;
|
||||
TopSizeArray = nullptr;
|
||||
alloc_topSizeBlocks = 0;
|
||||
used_topSizeBlocks = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void CodeHeapState::discard_SizeDistArray(outputStream* out) {
|
||||
if (SizeDistributionArray != NULL) {
|
||||
if (SizeDistributionArray != nullptr) {
|
||||
delete[] SizeDistributionArray;
|
||||
SizeDistributionArray = NULL;
|
||||
SizeDistributionArray = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -504,7 +504,7 @@ void CodeHeapState::discard(outputStream* out, CodeHeap* heap) {
|
||||
discard_TopSizeArray(out);
|
||||
discard_SizeDistArray(out);
|
||||
set_HeapStatGlobals(out, CodeHeapStatArray[ix].heapName);
|
||||
CodeHeapStatArray[ix].heapName = NULL;
|
||||
CodeHeapStatArray[ix].heapName = nullptr;
|
||||
}
|
||||
nHeaps = 0;
|
||||
}
|
||||
@ -538,7 +538,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
memset(CodeHeapStatArray, 0, sizeof(CodeHeapStatArray));
|
||||
initialization_complete = true;
|
||||
|
||||
printBox(ast, '=', "C O D E H E A P A N A L Y S I S (general remarks)", NULL);
|
||||
printBox(ast, '=', "C O D E H E A P A N A L Y S I S (general remarks)", nullptr);
|
||||
ast->print_cr(" The code heap analysis function provides deep insights into\n"
|
||||
" the inner workings and the internal state of the Java VM's\n"
|
||||
" code cache - the place where all the JVM generated machine\n"
|
||||
@ -651,7 +651,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
|
||||
//---< allocate arrays if they don't yet exist, initialize >---
|
||||
prepare_StatArray(out, granules, granularity, heapName);
|
||||
if (StatArray == NULL) {
|
||||
if (StatArray == nullptr) {
|
||||
set_HeapStatGlobals(out, heapName);
|
||||
return;
|
||||
}
|
||||
@ -669,12 +669,12 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
size_t stubSpace = 0;
|
||||
size_t freeSpace = 0;
|
||||
size_t maxFreeSize = 0;
|
||||
HeapBlock* maxFreeBlock = NULL;
|
||||
HeapBlock* maxFreeBlock = nullptr;
|
||||
bool insane = false;
|
||||
|
||||
unsigned int n_methods = 0;
|
||||
|
||||
for (HeapBlock *h = heap->first_block(); h != NULL && !insane; h = heap->next_block(h)) {
|
||||
for (HeapBlock *h = heap->first_block(); h != nullptr && !insane; h = heap->next_block(h)) {
|
||||
unsigned int hb_len = (unsigned int)h->length(); // despite being size_t, length can never overflow an unsigned int.
|
||||
size_t hb_bytelen = ((size_t)hb_len)<<log2_seg_size;
|
||||
unsigned int ix_beg = (unsigned int)(((char*)h-low_bound)/granule_size);
|
||||
@ -722,12 +722,12 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
nBlocks_used++;
|
||||
usedSpace += hb_bytelen;
|
||||
CodeBlob* cb = (CodeBlob*)heap->find_start(h);
|
||||
cbType = get_cbType(cb); // Will check for cb == NULL and other safety things.
|
||||
cbType = get_cbType(cb); // Will check for cb == nullptr and other safety things.
|
||||
if (cbType != noType) {
|
||||
const char* blob_name = nullptr;
|
||||
unsigned int nm_size = 0;
|
||||
nmethod* nm = cb->as_nmethod_or_null();
|
||||
if (nm != NULL) { // no is_readable check required, nm = (nmethod*)cb.
|
||||
if (nm != nullptr) { // no is_readable check required, nm = (nmethod*)cb.
|
||||
ResourceMark rm;
|
||||
Method* method = nm->method();
|
||||
if (nm->is_in_use() || nm->is_not_entrant()) {
|
||||
@ -790,7 +790,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
currMin = hb_len;
|
||||
currMin_ix = 0;
|
||||
used_topSizeBlocks++;
|
||||
blob_name = NULL; // indicate blob_name was consumed
|
||||
blob_name = nullptr; // indicate blob_name was consumed
|
||||
// This check roughly cuts 5000 iterations (JVM98, mixed, dbg, termination stats):
|
||||
} else if ((used_topSizeBlocks < alloc_topSizeBlocks) && (hb_len < currMin)) {
|
||||
//---< all blocks in list are larger, but there is room left in array >---
|
||||
@ -806,7 +806,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
currMin = hb_len;
|
||||
currMin_ix = used_topSizeBlocks;
|
||||
used_topSizeBlocks++;
|
||||
blob_name = NULL; // indicate blob_name was consumed
|
||||
blob_name = nullptr; // indicate blob_name was consumed
|
||||
} else {
|
||||
// This check cuts total_iterations by a factor of 6 (JVM98, mixed, dbg, termination stats):
|
||||
// We don't need to search the list if we know beforehand that the current block size is
|
||||
@ -846,7 +846,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
TopSizeArray[i].level = comp_lvl;
|
||||
TopSizeArray[i].type = cbType;
|
||||
used_topSizeBlocks++;
|
||||
blob_name = NULL; // indicate blob_name was consumed
|
||||
blob_name = nullptr; // indicate blob_name was consumed
|
||||
} else { // no room for new entries, current block replaces entry for smallest block
|
||||
//---< Find last entry (entry for smallest remembered block) >---
|
||||
// We either want to insert right before the smallest entry, which is when <i>
|
||||
@ -870,7 +870,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
j = TopSizeArray[j].index;
|
||||
}
|
||||
if (!insane) {
|
||||
if (TopSizeArray[j].blob_name != NULL) {
|
||||
if (TopSizeArray[j].blob_name != nullptr) {
|
||||
os::free((void*)TopSizeArray[j].blob_name);
|
||||
}
|
||||
if (prev_j == tsbStopper) {
|
||||
@ -902,7 +902,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
TopSizeArray[i].level = comp_lvl;
|
||||
TopSizeArray[i].type = cbType;
|
||||
}
|
||||
blob_name = NULL; // indicate blob_name was consumed
|
||||
blob_name = nullptr; // indicate blob_name was consumed
|
||||
} // insane
|
||||
}
|
||||
break;
|
||||
@ -917,9 +917,9 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
}
|
||||
}
|
||||
}
|
||||
if (blob_name != NULL) {
|
||||
if (blob_name != nullptr) {
|
||||
os::free((void*)blob_name);
|
||||
blob_name = NULL;
|
||||
blob_name = nullptr;
|
||||
}
|
||||
//----------------------------------------------
|
||||
//---< END register block in TopSizeArray >---
|
||||
@ -1138,7 +1138,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
}
|
||||
|
||||
prepare_FreeArray(out, nBlocks_free, heapName);
|
||||
if (FreeArray == NULL) {
|
||||
if (FreeArray == nullptr) {
|
||||
done = true;
|
||||
continue;
|
||||
}
|
||||
@ -1150,7 +1150,7 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
unsigned int ix = 0;
|
||||
FreeBlock* cur = heap->freelist();
|
||||
|
||||
while (cur != NULL) {
|
||||
while (cur != nullptr) {
|
||||
if (ix < alloc_freeBlocks) { // don't index out of bounds if _freelist has more blocks than anticipated
|
||||
FreeArray[ix].start = cur;
|
||||
FreeArray[ix].len = (unsigned int)(cur->length()<<log2_seg_size);
|
||||
@ -1185,15 +1185,15 @@ void CodeHeapState::aggregate(outputStream* out, CodeHeap* heap, size_t granular
|
||||
}
|
||||
|
||||
//---< calculate and fill remaining fields >---
|
||||
if (FreeArray != NULL) {
|
||||
if (FreeArray != nullptr) {
|
||||
// This loop is intentionally printing directly to "out".
|
||||
// It should not print anything, anyway.
|
||||
for (unsigned int ix = 0; ix < alloc_freeBlocks-1; ix++) {
|
||||
size_t lenSum = 0;
|
||||
FreeArray[ix].gap = (unsigned int)((address)FreeArray[ix+1].start - ((address)FreeArray[ix].start + FreeArray[ix].len));
|
||||
for (HeapBlock *h = heap->next_block(FreeArray[ix].start); (h != NULL) && (h != FreeArray[ix+1].start); h = heap->next_block(h)) {
|
||||
for (HeapBlock *h = heap->next_block(FreeArray[ix].start); (h != nullptr) && (h != FreeArray[ix+1].start); h = heap->next_block(h)) {
|
||||
CodeBlob *cb = (CodeBlob*)(heap->find_start(h));
|
||||
if ((cb != NULL) && !cb->is_nmethod()) { // checks equivalent to those in get_cbType()
|
||||
if ((cb != nullptr) && !cb->is_nmethod()) { // checks equivalent to those in get_cbType()
|
||||
FreeArray[ix].stubs_in_gap = true;
|
||||
}
|
||||
FreeArray[ix].n_gapBlocks++;
|
||||
@ -1222,7 +1222,7 @@ void CodeHeapState::print_usedSpace(outputStream* out, CodeHeap* heap) {
|
||||
const char* heapName = get_heapName(heap);
|
||||
get_HeapStatGlobals(out, heapName);
|
||||
|
||||
if ((StatArray == NULL) || (TopSizeArray == NULL) || (used_topSizeBlocks == 0)) {
|
||||
if ((StatArray == nullptr) || (TopSizeArray == nullptr) || (used_topSizeBlocks == 0)) {
|
||||
return;
|
||||
}
|
||||
BUFFEREDSTREAM_DECL(ast, out)
|
||||
@ -1263,14 +1263,14 @@ void CodeHeapState::print_usedSpace(outputStream* out, CodeHeap* heap) {
|
||||
unsigned int printed_topSizeBlocks = 0;
|
||||
for (unsigned int i = 0; i != tsbStopper; i = TopSizeArray[i].index) {
|
||||
printed_topSizeBlocks++;
|
||||
if (TopSizeArray[i].blob_name == NULL) {
|
||||
if (TopSizeArray[i].blob_name == nullptr) {
|
||||
TopSizeArray[i].blob_name = os::strdup("unnamed blob or blob name unavailable");
|
||||
}
|
||||
// heap->find_start() is safe. Only works on _segmap.
|
||||
// Returns NULL or void*. Returned CodeBlob may be uninitialized.
|
||||
// Returns nullptr or void*. Returned CodeBlob may be uninitialized.
|
||||
HeapBlock* heapBlock = TopSizeArray[i].start;
|
||||
CodeBlob* this_blob = (CodeBlob*)(heap->find_start(heapBlock));
|
||||
if (this_blob != NULL) {
|
||||
if (this_blob != nullptr) {
|
||||
//---< access these fields only if we own the CodeCache_lock >---
|
||||
//---< blob address >---
|
||||
ast->print(INTPTR_FORMAT, p2i(this_blob));
|
||||
@ -1329,7 +1329,7 @@ void CodeHeapState::print_usedSpace(outputStream* out, CodeHeap* heap) {
|
||||
//-- Print Usage Histogram --
|
||||
//-----------------------------
|
||||
|
||||
if (SizeDistributionArray != NULL) {
|
||||
if (SizeDistributionArray != nullptr) {
|
||||
unsigned long total_count = 0;
|
||||
unsigned long total_size = 0;
|
||||
const unsigned long pctFactor = 200;
|
||||
@ -1432,7 +1432,7 @@ void CodeHeapState::print_freeSpace(outputStream* out, CodeHeap* heap) {
|
||||
const char* heapName = get_heapName(heap);
|
||||
get_HeapStatGlobals(out, heapName);
|
||||
|
||||
if ((StatArray == NULL) || (FreeArray == NULL) || (alloc_granules == 0)) {
|
||||
if ((StatArray == nullptr) || (FreeArray == nullptr) || (alloc_granules == 0)) {
|
||||
return;
|
||||
}
|
||||
BUFFEREDSTREAM_DECL(ast, out)
|
||||
@ -1483,13 +1483,13 @@ void CodeHeapState::print_freeSpace(outputStream* out, CodeHeap* heap) {
|
||||
unsigned int currSize = FreeArray[ix].len;
|
||||
|
||||
unsigned int iy;
|
||||
for (iy = 0; iy < nTop && FreeTopTen[iy] != NULL; iy++) {
|
||||
for (iy = 0; iy < nTop && FreeTopTen[iy] != nullptr; iy++) {
|
||||
if (FreeTopTen[iy]->len < currSize) {
|
||||
for (unsigned int iz = nTop-1; iz > iy; iz--) { // make room to insert new free block
|
||||
FreeTopTen[iz] = FreeTopTen[iz-1];
|
||||
}
|
||||
FreeTopTen[iy] = &FreeArray[ix]; // insert new free block
|
||||
if (FreeTopTen[nTop-1] != NULL) {
|
||||
if (FreeTopTen[nTop-1] != nullptr) {
|
||||
currMax10 = FreeTopTen[nTop-1]->len;
|
||||
}
|
||||
break; // done with this, check next free block
|
||||
@ -1500,7 +1500,7 @@ void CodeHeapState::print_freeSpace(outputStream* out, CodeHeap* heap) {
|
||||
currSize, currMax10);
|
||||
continue;
|
||||
}
|
||||
if (FreeTopTen[iy] == NULL) {
|
||||
if (FreeTopTen[iy] == nullptr) {
|
||||
FreeTopTen[iy] = &FreeArray[ix];
|
||||
if (iy == (nTop-1)) {
|
||||
currMax10 = currSize;
|
||||
@ -1514,7 +1514,7 @@ void CodeHeapState::print_freeSpace(outputStream* out, CodeHeap* heap) {
|
||||
printBox(ast, '-', "Top Ten Free Blocks in ", heapName);
|
||||
|
||||
//---< print Top Ten Free Blocks >---
|
||||
for (unsigned int iy = 0; (iy < nTop) && (FreeTopTen[iy] != NULL); iy++) {
|
||||
for (unsigned int iy = 0; (iy < nTop) && (FreeTopTen[iy] != nullptr); iy++) {
|
||||
ast->print("Pos %3d: Block %4d - size " HEX32_FORMAT ",", iy+1, FreeTopTen[iy]->index, FreeTopTen[iy]->len);
|
||||
ast->fill_to(39);
|
||||
if (FreeTopTen[iy]->index == (alloc_freeBlocks-1)) {
|
||||
@ -1548,13 +1548,13 @@ void CodeHeapState::print_freeSpace(outputStream* out, CodeHeap* heap) {
|
||||
if (lenTriple > currMax10) { // larger than the ten largest found so far
|
||||
|
||||
unsigned int iy;
|
||||
for (iy = 0; (iy < nTop) && (FreeTopTenTriple[iy] != NULL); iy++) {
|
||||
for (iy = 0; (iy < nTop) && (FreeTopTenTriple[iy] != nullptr); iy++) {
|
||||
if (FreeTopTenTriple[iy]->len < lenTriple) {
|
||||
for (unsigned int iz = nTop-1; iz > iy; iz--) {
|
||||
FreeTopTenTriple[iz] = FreeTopTenTriple[iz-1];
|
||||
}
|
||||
FreeTopTenTriple[iy] = &FreeArray[ix];
|
||||
if (FreeTopTenTriple[nTop-1] != NULL) {
|
||||
if (FreeTopTenTriple[nTop-1] != nullptr) {
|
||||
currMax10 = FreeTopTenTriple[nTop-1]->len;
|
||||
}
|
||||
break;
|
||||
@ -1565,7 +1565,7 @@ void CodeHeapState::print_freeSpace(outputStream* out, CodeHeap* heap) {
|
||||
lenTriple, currMax10);
|
||||
continue;
|
||||
}
|
||||
if (FreeTopTenTriple[iy] == NULL) {
|
||||
if (FreeTopTenTriple[iy] == nullptr) {
|
||||
FreeTopTenTriple[iy] = &FreeArray[ix];
|
||||
if (iy == (nTop-1)) {
|
||||
currMax10 = lenTriple;
|
||||
@ -1584,7 +1584,7 @@ void CodeHeapState::print_freeSpace(outputStream* out, CodeHeap* heap) {
|
||||
" fragmentation.\n");
|
||||
|
||||
//---< print Top Ten Free-Occupied-Free Triples >---
|
||||
for (unsigned int iy = 0; (iy < nTop) && (FreeTopTenTriple[iy] != NULL); iy++) {
|
||||
for (unsigned int iy = 0; (iy < nTop) && (FreeTopTenTriple[iy] != nullptr); iy++) {
|
||||
ast->print("Pos %3d: Block %4d - size " HEX32_FORMAT ",", iy+1, FreeTopTenTriple[iy]->index, FreeTopTenTriple[iy]->len);
|
||||
ast->fill_to(39);
|
||||
ast->print("Gap (to next) " HEX32_FORMAT ",", FreeTopTenTriple[iy]->gap);
|
||||
@ -1606,7 +1606,7 @@ void CodeHeapState::print_count(outputStream* out, CodeHeap* heap) {
|
||||
const char* heapName = get_heapName(heap);
|
||||
get_HeapStatGlobals(out, heapName);
|
||||
|
||||
if ((StatArray == NULL) || (alloc_granules == 0)) {
|
||||
if ((StatArray == nullptr) || (alloc_granules == 0)) {
|
||||
return;
|
||||
}
|
||||
BUFFEREDSTREAM_DECL(ast, out)
|
||||
@ -1630,7 +1630,7 @@ void CodeHeapState::print_count(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (segment_granules) {
|
||||
printBox(ast, '-', "Total (all types) count for granule size == segment size", NULL);
|
||||
printBox(ast, '-', "Total (all types) count for granule size == segment size", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1638,7 +1638,7 @@ void CodeHeapState::print_count(outputStream* out, CodeHeap* heap) {
|
||||
print_blobType_single(ast, StatArray[ix].type);
|
||||
}
|
||||
} else {
|
||||
printBox(ast, '-', "Total (all tiers) count, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
|
||||
printBox(ast, '-', "Total (all tiers) count, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1653,7 +1653,7 @@ void CodeHeapState::print_count(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_t1 > 0) {
|
||||
printBox(ast, '-', "Tier1 nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
|
||||
printBox(ast, '-', "Tier1 nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1673,7 +1673,7 @@ void CodeHeapState::print_count(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_t2 > 0) {
|
||||
printBox(ast, '-', "Tier2 nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
|
||||
printBox(ast, '-', "Tier2 nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1693,7 +1693,7 @@ void CodeHeapState::print_count(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_alive > 0) {
|
||||
printBox(ast, '-', "not_used/not_entrant/not_installed nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
|
||||
printBox(ast, '-', "not_used/not_entrant/not_installed nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1713,7 +1713,7 @@ void CodeHeapState::print_count(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_stub > 0) {
|
||||
printBox(ast, '-', "Stub & Blob count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL);
|
||||
printBox(ast, '-', "Stub & Blob count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1733,7 +1733,7 @@ void CodeHeapState::print_count(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (!segment_granules) { // Prevent totally redundant printouts
|
||||
printBox(ast, '-', "Count by tier (combined): <#t1>:<#t2>:<#s>, 0x0..0xf. '*' indicates >= 16 blocks", NULL);
|
||||
printBox(ast, '-', "Count by tier (combined): <#t1>:<#t2>:<#s>, 0x0..0xf. '*' indicates >= 16 blocks", nullptr);
|
||||
|
||||
granules_per_line = 24;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1764,7 +1764,7 @@ void CodeHeapState::print_space(outputStream* out, CodeHeap* heap) {
|
||||
const char* heapName = get_heapName(heap);
|
||||
get_HeapStatGlobals(out, heapName);
|
||||
|
||||
if ((StatArray == NULL) || (alloc_granules == 0)) {
|
||||
if ((StatArray == nullptr) || (alloc_granules == 0)) {
|
||||
return;
|
||||
}
|
||||
BUFFEREDSTREAM_DECL(ast, out)
|
||||
@ -1791,7 +1791,7 @@ void CodeHeapState::print_space(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (segment_granules) {
|
||||
printBox(ast, '-', "Total (all types) space consumption for granule size == segment size", NULL);
|
||||
printBox(ast, '-', "Total (all types) space consumption for granule size == segment size", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1799,7 +1799,7 @@ void CodeHeapState::print_space(outputStream* out, CodeHeap* heap) {
|
||||
print_blobType_single(ast, StatArray[ix].type);
|
||||
}
|
||||
} else {
|
||||
printBox(ast, '-', "Total (all types) space consumption. ' ' indicates empty, '*' indicates full.", NULL);
|
||||
printBox(ast, '-', "Total (all types) space consumption. ' ' indicates empty, '*' indicates full.", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1814,7 +1814,7 @@ void CodeHeapState::print_space(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_t1 > 0) {
|
||||
printBox(ast, '-', "Tier1 space consumption. ' ' indicates empty, '*' indicates full", NULL);
|
||||
printBox(ast, '-', "Tier1 space consumption. ' ' indicates empty, '*' indicates full", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1834,7 +1834,7 @@ void CodeHeapState::print_space(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_t2 > 0) {
|
||||
printBox(ast, '-', "Tier2 space consumption. ' ' indicates empty, '*' indicates full", NULL);
|
||||
printBox(ast, '-', "Tier2 space consumption. ' ' indicates empty, '*' indicates full", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1854,7 +1854,7 @@ void CodeHeapState::print_space(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_alive > 0) {
|
||||
printBox(ast, '-', "not_used/not_entrant/not_installed space consumption. ' ' indicates empty, '*' indicates full", NULL);
|
||||
printBox(ast, '-', "not_used/not_entrant/not_installed space consumption. ' ' indicates empty, '*' indicates full", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1874,7 +1874,7 @@ void CodeHeapState::print_space(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_stub > 0) {
|
||||
printBox(ast, '-', "Stub and Blob space consumption. ' ' indicates empty, '*' indicates full", NULL);
|
||||
printBox(ast, '-', "Stub and Blob space consumption. ' ' indicates empty, '*' indicates full", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1894,7 +1894,7 @@ void CodeHeapState::print_space(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (!segment_granules) { // Prevent totally redundant printouts
|
||||
printBox(ast, '-', "Space consumption by tier (combined): <t1%>:<t2%>:<s%>. ' ' indicates empty, '*' indicates full", NULL);
|
||||
printBox(ast, '-', "Space consumption by tier (combined): <t1%>:<t2%>:<s%>. ' ' indicates empty, '*' indicates full", nullptr);
|
||||
|
||||
granules_per_line = 24;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1933,7 +1933,7 @@ void CodeHeapState::print_age(outputStream* out, CodeHeap* heap) {
|
||||
const char* heapName = get_heapName(heap);
|
||||
get_HeapStatGlobals(out, heapName);
|
||||
|
||||
if ((StatArray == NULL) || (alloc_granules == 0)) {
|
||||
if ((StatArray == nullptr) || (alloc_granules == 0)) {
|
||||
return;
|
||||
}
|
||||
BUFFEREDSTREAM_DECL(ast, out)
|
||||
@ -1954,7 +1954,7 @@ void CodeHeapState::print_age(outputStream* out, CodeHeap* heap) {
|
||||
}
|
||||
|
||||
{
|
||||
printBox(ast, '-', "Age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
|
||||
printBox(ast, '-', "Age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1972,7 +1972,7 @@ void CodeHeapState::print_age(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_t1 > 0) {
|
||||
printBox(ast, '-', "Tier1 age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
|
||||
printBox(ast, '-', "Tier1 age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -1988,7 +1988,7 @@ void CodeHeapState::print_age(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_t2 > 0) {
|
||||
printBox(ast, '-', "Tier2 age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
|
||||
printBox(ast, '-', "Tier2 age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -2004,7 +2004,7 @@ void CodeHeapState::print_age(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (nBlocks_alive > 0) {
|
||||
printBox(ast, '-', "not_used/not_entrant/not_installed age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
|
||||
printBox(ast, '-', "not_used/not_entrant/not_installed age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", nullptr);
|
||||
|
||||
granules_per_line = 128;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -2020,7 +2020,7 @@ void CodeHeapState::print_age(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
{
|
||||
if (!segment_granules) { // Prevent totally redundant printouts
|
||||
printBox(ast, '-', "age distribution by tier <a1>:<a2>. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL);
|
||||
printBox(ast, '-', "age distribution by tier <a1>:<a2>. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", nullptr);
|
||||
|
||||
granules_per_line = 32;
|
||||
for (unsigned int ix = 0; ix < alloc_granules; ix++) {
|
||||
@ -2045,14 +2045,14 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
|
||||
const char* heapName = get_heapName(heap);
|
||||
get_HeapStatGlobals(out, heapName);
|
||||
|
||||
if ((StatArray == NULL) || (alloc_granules == 0)) {
|
||||
if ((StatArray == nullptr) || (alloc_granules == 0)) {
|
||||
return;
|
||||
}
|
||||
BUFFEREDSTREAM_DECL(ast, out)
|
||||
|
||||
unsigned int granules_per_line = 128;
|
||||
char* low_bound = heap->low_boundary();
|
||||
CodeBlob* last_blob = NULL;
|
||||
CodeBlob* last_blob = nullptr;
|
||||
bool name_in_addr_range = true;
|
||||
bool have_locks = holding_required_locks();
|
||||
|
||||
@ -2090,7 +2090,7 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
|
||||
if (nBlobs > 0 ) {
|
||||
for (unsigned int is = 0; is < granule_size; is+=(unsigned int)seg_size) {
|
||||
// heap->find_start() is safe. Only works on _segmap.
|
||||
// Returns NULL or void*. Returned CodeBlob may be uninitialized.
|
||||
// Returns nullptr or void*. Returned CodeBlob may be uninitialized.
|
||||
char* this_seg = low_bound + ix*granule_size + is;
|
||||
CodeBlob* this_blob = (CodeBlob*)(heap->find_start(this_seg));
|
||||
bool blob_is_safe = blob_access_is_safe(this_blob);
|
||||
@ -2112,12 +2112,12 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
//---< access these fields only if we own the CodeCache_lock >---
|
||||
const char* blob_name = "<unavailable>";
|
||||
nmethod* nm = NULL;
|
||||
nmethod* nm = nullptr;
|
||||
if (have_locks) {
|
||||
blob_name = this_blob->name();
|
||||
nm = this_blob->as_nmethod_or_null();
|
||||
// this_blob->name() could return NULL if no name was given to CTOR. Inlined, maybe invisible on stack
|
||||
if (blob_name == NULL) {
|
||||
// this_blob->name() could return nullptr if no name was given to CTOR. Inlined, maybe invisible on stack
|
||||
if (blob_name == nullptr) {
|
||||
blob_name = "<unavailable>";
|
||||
}
|
||||
}
|
||||
@ -2140,7 +2140,7 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
|
||||
ast->fill_to(33);
|
||||
|
||||
// access nmethod and Method fields only if we own the CodeCache_lock.
|
||||
// This fact is implicitly transported via nm != NULL.
|
||||
// This fact is implicitly transported via nm != nullptr.
|
||||
if (nmethod_access_is_safe(nm)) {
|
||||
Method* method = nm->method();
|
||||
ResourceMark rm;
|
||||
@ -2160,11 +2160,11 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
|
||||
|
||||
if (get_name) {
|
||||
Symbol* methName = method->name();
|
||||
const char* methNameS = (methName == NULL) ? NULL : methName->as_C_string();
|
||||
methNameS = (methNameS == NULL) ? "<method name unavailable>" : methNameS;
|
||||
const char* methNameS = (methName == nullptr) ? nullptr : methName->as_C_string();
|
||||
methNameS = (methNameS == nullptr) ? "<method name unavailable>" : methNameS;
|
||||
Symbol* methSig = method->signature();
|
||||
const char* methSigS = (methSig == NULL) ? NULL : methSig->as_C_string();
|
||||
methSigS = (methSigS == NULL) ? "<method signature unavailable>" : methSigS;
|
||||
const char* methSigS = (methSig == nullptr) ? nullptr : methSig->as_C_string();
|
||||
methSigS = (methSigS == nullptr) ? "<method signature unavailable>" : methSigS;
|
||||
Klass* klass = method->method_holder();
|
||||
assert(klass != nullptr, "No method holder");
|
||||
const char* classNameS = (klass->name() == nullptr) ? "<class name unavailable>" : klass->external_name();
|
||||
@ -2186,7 +2186,7 @@ void CodeHeapState::print_names(outputStream* out, CodeHeap* heap) {
|
||||
}
|
||||
ast->cr();
|
||||
BUFFEREDSTREAM_FLUSH_AUTO("")
|
||||
} else if (!blob_is_safe && (this_blob != last_blob) && (this_blob != NULL)) {
|
||||
} else if (!blob_is_safe && (this_blob != last_blob) && (this_blob != nullptr)) {
|
||||
last_blob = this_blob;
|
||||
}
|
||||
}
|
||||
@ -2200,10 +2200,10 @@ void CodeHeapState::printBox(outputStream* ast, const char border, const char* t
|
||||
unsigned int lineLen = 1 + 2 + 2 + 1;
|
||||
char edge, frame;
|
||||
|
||||
if (text1 != NULL) {
|
||||
if (text1 != nullptr) {
|
||||
lineLen += (unsigned int)strlen(text1); // text1 is much shorter than MAX_INT chars.
|
||||
}
|
||||
if (text2 != NULL) {
|
||||
if (text2 != nullptr) {
|
||||
lineLen += (unsigned int)strlen(text2); // text2 is much shorter than MAX_INT chars.
|
||||
}
|
||||
if (border == '-') {
|
||||
@ -2221,10 +2221,10 @@ void CodeHeapState::printBox(outputStream* ast, const char border, const char* t
|
||||
ast->print_cr("%c", edge);
|
||||
|
||||
ast->print("%c ", frame);
|
||||
if (text1 != NULL) {
|
||||
if (text1 != nullptr) {
|
||||
ast->print("%s", text1);
|
||||
}
|
||||
if (text2 != NULL) {
|
||||
if (text2 != nullptr) {
|
||||
ast->print("%s", text2);
|
||||
}
|
||||
ast->print_cr(" %c", frame);
|
||||
@ -2238,7 +2238,7 @@ void CodeHeapState::printBox(outputStream* ast, const char border, const char* t
|
||||
|
||||
void CodeHeapState::print_blobType_legend(outputStream* out) {
|
||||
out->cr();
|
||||
printBox(out, '-', "Block types used in the following CodeHeap dump", NULL);
|
||||
printBox(out, '-', "Block types used in the following CodeHeap dump", nullptr);
|
||||
for (int type = noType; type < lastType; type += 1) {
|
||||
out->print_cr(" %c - %s", blobTypeChar[type], blobTypeName[type]);
|
||||
}
|
||||
@ -2249,7 +2249,7 @@ void CodeHeapState::print_blobType_legend(outputStream* out) {
|
||||
void CodeHeapState::print_space_legend(outputStream* out) {
|
||||
int range_beg = latest_compilation_id;
|
||||
out->cr();
|
||||
printBox(out, '-', "Space ranges, based on granule occupancy", NULL);
|
||||
printBox(out, '-', "Space ranges, based on granule occupancy", nullptr);
|
||||
out->print_cr(" - 0%% == occupancy");
|
||||
for (int i=0; i<=9; i++) {
|
||||
out->print_cr(" %d - %3d%% < occupancy < %3d%%", i, 10*i, 10*(i+1));
|
||||
@ -2264,7 +2264,7 @@ void CodeHeapState::print_age_legend(outputStream* out) {
|
||||
int age_range = 256;
|
||||
int range_beg = latest_compilation_id;
|
||||
out->cr();
|
||||
printBox(out, '-', "Age ranges, based on compilation id", NULL);
|
||||
printBox(out, '-', "Age ranges, based on compilation id", nullptr);
|
||||
while (age_range > 0) {
|
||||
out->print_cr(" %u - %6d to %6d", indicator, range_beg, latest_compilation_id - latest_compilation_id/age_range);
|
||||
range_beg = latest_compilation_id - latest_compilation_id/age_range;
|
||||
@ -2346,7 +2346,7 @@ void CodeHeapState::print_line_delim(outputStream* out, bufferedStream* ast, cha
|
||||
// Find out which blob type we have at hand.
|
||||
// Return "noType" if anything abnormal is detected.
|
||||
CodeHeapState::blobType CodeHeapState::get_cbType(CodeBlob* cb) {
|
||||
if (cb != NULL) {
|
||||
if (cb != nullptr) {
|
||||
if (cb->is_runtime_stub()) return runtimeStub;
|
||||
if (cb->is_deoptimization_stub()) return deoptimizationStub;
|
||||
if (cb->is_uncommon_trap_stub()) return uncommonTrapStub;
|
||||
@ -2360,7 +2360,7 @@ CodeHeapState::blobType CodeHeapState::get_cbType(CodeBlob* cb) {
|
||||
// Should be ensured by caller. aggregate() and print_names() do that.
|
||||
if (holding_required_locks()) {
|
||||
nmethod* nm = cb->as_nmethod_or_null();
|
||||
if (nm != NULL) { // no is_readable check required, nm = (nmethod*)cb.
|
||||
if (nm != nullptr) { // no is_readable check required, nm = (nmethod*)cb.
|
||||
if (nm->is_in_use()) return nMethod_inuse;
|
||||
if (!nm->is_not_entrant()) return nMethod_notused;
|
||||
return nMethod_notentrant;
|
||||
@ -2372,7 +2372,7 @@ CodeHeapState::blobType CodeHeapState::get_cbType(CodeBlob* cb) {
|
||||
|
||||
// make sure the blob at hand is not garbage.
|
||||
bool CodeHeapState::blob_access_is_safe(CodeBlob* this_blob) {
|
||||
return (this_blob != NULL) && // a blob must have been found, obviously
|
||||
return (this_blob != nullptr) && // a blob must have been found, obviously
|
||||
(this_blob->header_size() >= 0) &&
|
||||
(this_blob->relocation_size() >= 0) &&
|
||||
((address)this_blob + this_blob->header_size() == (address)(this_blob->relocation_begin())) &&
|
||||
@ -2381,8 +2381,8 @@ bool CodeHeapState::blob_access_is_safe(CodeBlob* this_blob) {
|
||||
|
||||
// make sure the nmethod at hand (and the linked method) is not garbage.
|
||||
bool CodeHeapState::nmethod_access_is_safe(nmethod* nm) {
|
||||
Method* method = (nm == NULL) ? NULL : nm->method(); // nm->method() was found to be uninitialized, i.e. != NULL, but invalid.
|
||||
return (nm != NULL) && (method != NULL) && (method->signature() != NULL);
|
||||
Method* method = (nm == nullptr) ? nullptr : nm->method(); // nm->method() was found to be uninitialized, i.e. != nullptr, but invalid.
|
||||
return (nm != nullptr) && (method != nullptr) && (method->signature() != nullptr);
|
||||
}
|
||||
|
||||
bool CodeHeapState::holding_required_locks() {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -69,7 +69,7 @@ bool CompiledICLocker::is_safe(CompiledMethod* method) {
|
||||
|
||||
bool CompiledICLocker::is_safe(address code) {
|
||||
CodeBlob* cb = CodeCache::find_blob(code);
|
||||
assert(cb != NULL && cb->is_compiled(), "must be compiled");
|
||||
assert(cb != nullptr && cb->is_compiled(), "must be compiled");
|
||||
CompiledMethod* cm = cb->as_compiled_method();
|
||||
return CompiledICProtectionBehaviour::current()->is_safe(cm);
|
||||
}
|
||||
@ -85,9 +85,9 @@ void* CompiledIC::cached_value() const {
|
||||
if (!is_in_transition_state()) {
|
||||
void* data = get_data();
|
||||
// If we let the metadata value here be initialized to zero...
|
||||
assert(data != NULL || Universe::non_oop_word() == NULL,
|
||||
assert(data != nullptr || Universe::non_oop_word() == nullptr,
|
||||
"no raw nulls in CompiledIC metadatas, because of patching races");
|
||||
return (data == (void*)Universe::non_oop_word()) ? NULL : data;
|
||||
return (data == (void*)Universe::non_oop_word()) ? nullptr : data;
|
||||
} else {
|
||||
return InlineCacheBuffer::cached_value_for((CompiledIC *)this);
|
||||
}
|
||||
@ -95,10 +95,10 @@ void* CompiledIC::cached_value() const {
|
||||
|
||||
|
||||
void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub, void* cache, bool is_icholder) {
|
||||
assert(entry_point != NULL, "must set legal entry point");
|
||||
assert(entry_point != nullptr, "must set legal entry point");
|
||||
assert(CompiledICLocker::is_safe(_method), "mt unsafe call");
|
||||
assert (!is_optimized() || cache == NULL, "an optimized virtual call does not have a cached metadata");
|
||||
assert (cache == NULL || cache != (Metadata*)badOopVal, "invalid metadata");
|
||||
assert (!is_optimized() || cache == nullptr, "an optimized virtual call does not have a cached metadata");
|
||||
assert (cache == nullptr || cache != (Metadata*)badOopVal, "invalid metadata");
|
||||
|
||||
assert(!is_icholder || is_icholder_entry(entry_point), "must be");
|
||||
|
||||
@ -129,7 +129,7 @@ void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub
|
||||
|
||||
{
|
||||
CodeBlob* cb = CodeCache::find_blob(_call->instruction_address());
|
||||
assert(cb != NULL && cb->is_compiled(), "must be compiled");
|
||||
assert(cb != nullptr && cb->is_compiled(), "must be compiled");
|
||||
_call->set_destination_mt_safe(entry_point);
|
||||
}
|
||||
|
||||
@ -137,18 +137,18 @@ void CompiledIC::internal_set_ic_destination(address entry_point, bool is_icstub
|
||||
// Optimized call sites don't have a cache value and ICStub call
|
||||
// sites only change the entry point. Changing the value in that
|
||||
// case could lead to MT safety issues.
|
||||
assert(cache == NULL, "must be null");
|
||||
assert(cache == nullptr, "must be null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cache == NULL) cache = Universe::non_oop_word();
|
||||
if (cache == nullptr) cache = Universe::non_oop_word();
|
||||
|
||||
set_data((intptr_t)cache);
|
||||
}
|
||||
|
||||
|
||||
void CompiledIC::set_ic_destination(ICStub* stub) {
|
||||
internal_set_ic_destination(stub->code_begin(), true, NULL, false);
|
||||
internal_set_ic_destination(stub->code_begin(), true, nullptr, false);
|
||||
}
|
||||
|
||||
|
||||
@ -202,7 +202,7 @@ void CompiledIC::initialize_from_iter(RelocIterator* iter) {
|
||||
} else {
|
||||
assert(iter->type() == relocInfo::opt_virtual_call_type, "must be a virtual call");
|
||||
_is_optimized = true;
|
||||
_value = NULL;
|
||||
_value = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,8 +212,8 @@ CompiledIC::CompiledIC(CompiledMethod* cm, NativeCall* call)
|
||||
_call = _method->call_wrapper_at((address) call);
|
||||
address ic_call = _call->instruction_address();
|
||||
|
||||
assert(ic_call != NULL, "ic_call address must be set");
|
||||
assert(cm != NULL, "must pass compiled method");
|
||||
assert(ic_call != nullptr, "ic_call address must be set");
|
||||
assert(cm != nullptr, "must pass compiled method");
|
||||
assert(cm->contains(ic_call), "must be in compiled method");
|
||||
|
||||
// Search for the ic_call at the given address.
|
||||
@ -232,8 +232,8 @@ CompiledIC::CompiledIC(RelocIterator* iter)
|
||||
address ic_call = _call->instruction_address();
|
||||
|
||||
CompiledMethod* nm = iter->code();
|
||||
assert(ic_call != NULL, "ic_call address must be set");
|
||||
assert(nm != NULL, "must pass compiled method");
|
||||
assert(ic_call != nullptr, "ic_call address must be set");
|
||||
assert(nm != nullptr, "must pass compiled method");
|
||||
assert(nm->contains(ic_call), "must be in compiled method");
|
||||
|
||||
initialize_from_iter(iter);
|
||||
@ -255,7 +255,7 @@ bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
|
||||
assert(bytecode == Bytecodes::_invokeinterface, "");
|
||||
int itable_index = call_info->itable_index();
|
||||
entry = VtableStubs::find_itable_stub(itable_index);
|
||||
if (entry == NULL) {
|
||||
if (entry == nullptr) {
|
||||
return false;
|
||||
}
|
||||
#ifdef ASSERT
|
||||
@ -278,10 +278,10 @@ bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
|
||||
int vtable_index = call_info->vtable_index();
|
||||
assert(call_info->resolved_klass()->verify_vtable_index(vtable_index), "sanity check");
|
||||
entry = VtableStubs::find_vtable_stub(vtable_index);
|
||||
if (entry == NULL) {
|
||||
if (entry == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (!InlineCacheBuffer::create_transition_stub(this, NULL, entry)) {
|
||||
if (!InlineCacheBuffer::create_transition_stub(this, nullptr, entry)) {
|
||||
needs_ic_stub_refill = true;
|
||||
return false;
|
||||
}
|
||||
@ -289,7 +289,7 @@ bool CompiledIC::set_to_megamorphic(CallInfo* call_info, Bytecodes::Code bytecod
|
||||
|
||||
if (TraceICs) {
|
||||
ResourceMark rm;
|
||||
assert(call_info->selected_method() != NULL, "Unexpected null selected method");
|
||||
assert(call_info->selected_method() != nullptr, "Unexpected null selected method");
|
||||
tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT,
|
||||
p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry));
|
||||
}
|
||||
@ -311,17 +311,17 @@ bool CompiledIC::is_megamorphic() const {
|
||||
assert(!is_optimized(), "an optimized call cannot be megamorphic");
|
||||
|
||||
// Cannot rely on cached_value. It is either an interface or a method.
|
||||
return VtableStubs::entry_point(ic_destination()) != NULL;
|
||||
return VtableStubs::entry_point(ic_destination()) != nullptr;
|
||||
}
|
||||
|
||||
bool CompiledIC::is_call_to_compiled() const {
|
||||
assert(CompiledICLocker::is_safe(_method), "mt unsafe call");
|
||||
|
||||
CodeBlob* cb = CodeCache::find_blob(ic_destination());
|
||||
bool is_monomorphic = (cb != NULL && cb->is_compiled());
|
||||
bool is_monomorphic = (cb != nullptr && cb->is_compiled());
|
||||
// Check that the cached_value is a klass for non-optimized monomorphic calls
|
||||
// This assertion is invalid for compiler1: a call that does not look optimized (no static stub) can be used
|
||||
// for calling directly to vep without using the inline cache (i.e., cached_value == NULL).
|
||||
// for calling directly to vep without using the inline cache (i.e., cached_value == nullptr).
|
||||
// For JVMCI this occurs because CHA is only used to improve inlining so call sites which could be optimized
|
||||
// virtuals because there are no currently loaded subclasses of a type are left as virtual call sites.
|
||||
#ifdef ASSERT
|
||||
@ -330,7 +330,7 @@ bool CompiledIC::is_call_to_compiled() const {
|
||||
assert( is_c1_or_jvmci_method ||
|
||||
!is_monomorphic ||
|
||||
is_optimized() ||
|
||||
(cached_metadata() != NULL && cached_metadata()->is_klass()), "sanity check");
|
||||
(cached_metadata() != nullptr && cached_metadata()->is_klass()), "sanity check");
|
||||
#endif // ASSERT
|
||||
return is_monomorphic;
|
||||
}
|
||||
@ -343,8 +343,8 @@ bool CompiledIC::is_call_to_interpreted() const {
|
||||
bool is_call_to_interpreted = false;
|
||||
if (!is_optimized()) {
|
||||
CodeBlob* cb = CodeCache::find_blob(ic_destination());
|
||||
is_call_to_interpreted = (cb != NULL && cb->is_adapter_blob());
|
||||
assert(!is_call_to_interpreted || (is_icholder_call() && cached_icholder() != NULL), "sanity check");
|
||||
is_call_to_interpreted = (cb != nullptr && cb->is_adapter_blob());
|
||||
assert(!is_call_to_interpreted || (is_icholder_call() && cached_icholder() != nullptr), "sanity check");
|
||||
} else {
|
||||
// Check if we are calling into our own codeblob (i.e., to a stub)
|
||||
address dest = ic_destination();
|
||||
@ -375,11 +375,11 @@ bool CompiledIC::set_to_clean(bool in_use) {
|
||||
if (is_optimized()) {
|
||||
set_ic_destination(entry);
|
||||
} else {
|
||||
set_ic_destination_and_value(entry, (void*)NULL);
|
||||
set_ic_destination_and_value(entry, (void*)nullptr);
|
||||
}
|
||||
} else {
|
||||
// Unsafe transition - create stub.
|
||||
if (!InlineCacheBuffer::create_transition_stub(this, NULL, entry)) {
|
||||
if (!InlineCacheBuffer::create_transition_stub(this, nullptr, entry)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -398,7 +398,7 @@ bool CompiledIC::is_clean() const {
|
||||
bool is_clean = false;
|
||||
address dest = ic_destination();
|
||||
is_clean = dest == _call->get_resolve_call_stub(is_optimized());
|
||||
assert(!is_clean || is_optimized() || cached_value() == NULL, "sanity check");
|
||||
assert(!is_clean || is_optimized() || cached_value() == nullptr, "sanity check");
|
||||
return is_clean;
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ bool CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
|
||||
// (either because of CHA or the static target is final)
|
||||
// At code generation time, this call has been emitted as static call
|
||||
// Call via stub
|
||||
assert(info.cached_metadata() != NULL && info.cached_metadata()->is_method(), "sanity check");
|
||||
assert(info.cached_metadata() != nullptr && info.cached_metadata()->is_method(), "sanity check");
|
||||
methodHandle method (thread, (Method*)info.cached_metadata());
|
||||
_call->set_to_interpreted(method, info);
|
||||
|
||||
@ -449,10 +449,10 @@ bool CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
|
||||
}
|
||||
} else {
|
||||
// Call to compiled code
|
||||
bool static_bound = info.is_optimized() || (info.cached_metadata() == NULL);
|
||||
bool static_bound = info.is_optimized() || (info.cached_metadata() == nullptr);
|
||||
#ifdef ASSERT
|
||||
CodeBlob* cb = CodeCache::find_blob(info.entry());
|
||||
assert (cb != NULL && cb->is_compiled(), "must be compiled!");
|
||||
assert (cb != nullptr && cb->is_compiled(), "must be compiled!");
|
||||
#endif /* ASSERT */
|
||||
|
||||
// This is MT safe if we come from a clean-cache and go through a
|
||||
@ -474,10 +474,10 @@ bool CompiledIC::set_to_monomorphic(CompiledICInfo& info) {
|
||||
|
||||
if (TraceICs) {
|
||||
ResourceMark rm(thread);
|
||||
assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be");
|
||||
assert(info.cached_metadata() == nullptr || info.cached_metadata()->is_klass(), "must be");
|
||||
tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to compiled (rcvr klass = %s) %s",
|
||||
p2i(instruction_address()),
|
||||
(info.cached_metadata() != NULL) ? ((Klass*)info.cached_metadata())->print_value_string() : "NULL",
|
||||
(info.cached_metadata() != nullptr) ? ((Klass*)info.cached_metadata())->print_value_string() : "nullptr",
|
||||
(safe) ? "" : " via stub");
|
||||
}
|
||||
}
|
||||
@ -506,8 +506,8 @@ void CompiledIC::compute_monomorphic_entry(const methodHandle& method,
|
||||
TRAPS) {
|
||||
CompiledMethod* method_code = method->code();
|
||||
|
||||
address entry = NULL;
|
||||
if (method_code != NULL && method_code->is_in_use() && !method_code->is_unloading()) {
|
||||
address entry = nullptr;
|
||||
if (method_code != nullptr && method_code->is_in_use() && !method_code->is_unloading()) {
|
||||
assert(method_code->is_compiled(), "must be compiled");
|
||||
// Call to compiled code
|
||||
//
|
||||
@ -532,16 +532,16 @@ void CompiledIC::compute_monomorphic_entry(const methodHandle& method,
|
||||
entry = method_code->entry_point();
|
||||
}
|
||||
}
|
||||
if (entry != NULL) {
|
||||
if (entry != nullptr) {
|
||||
// Call to near compiled code.
|
||||
info.set_compiled_entry(entry, is_optimized ? NULL : receiver_klass, is_optimized);
|
||||
info.set_compiled_entry(entry, is_optimized ? nullptr : receiver_klass, is_optimized);
|
||||
} else {
|
||||
if (is_optimized) {
|
||||
// Use stub entry
|
||||
info.set_interpreter_entry(method()->get_c2i_entry(), method());
|
||||
} else {
|
||||
// Use icholder entry
|
||||
assert(method_code == NULL || method_code->is_compiled(), "must be compiled");
|
||||
assert(method_code == nullptr || method_code->is_compiled(), "must be compiled");
|
||||
CompiledICHolder* holder = new CompiledICHolder(method(), receiver_klass);
|
||||
info.set_icholder_entry(method()->get_c2i_unverified_entry(), holder);
|
||||
}
|
||||
@ -552,13 +552,13 @@ void CompiledIC::compute_monomorphic_entry(const methodHandle& method,
|
||||
|
||||
bool CompiledIC::is_icholder_entry(address entry) {
|
||||
CodeBlob* cb = CodeCache::find_blob(entry);
|
||||
if (cb != NULL && cb->is_adapter_blob()) {
|
||||
if (cb != nullptr && cb->is_adapter_blob()) {
|
||||
return true;
|
||||
}
|
||||
// itable stubs also use CompiledICHolder
|
||||
if (cb != NULL && cb->is_vtable_blob()) {
|
||||
if (cb != nullptr && cb->is_vtable_blob()) {
|
||||
VtableStub* s = VtableStubs::entry_point(entry);
|
||||
return (s != NULL) && s->is_itable_stub();
|
||||
return (s != nullptr) && s->is_itable_stub();
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -633,7 +633,7 @@ void CompiledStaticCall::set(const StaticCallInfo& info) {
|
||||
void CompiledStaticCall::compute_entry(const methodHandle& m, bool caller_is_nmethod, StaticCallInfo& info) {
|
||||
CompiledMethod* m_code = m->code();
|
||||
info._callee = m;
|
||||
if (m_code != NULL && m_code->is_in_use() && !m_code->is_unloading()) {
|
||||
if (m_code != nullptr && m_code->is_in_use() && !m_code->is_unloading()) {
|
||||
info._to_interpreter = false;
|
||||
info._entry = m_code->verified_entry_point();
|
||||
} else {
|
||||
@ -654,7 +654,7 @@ void CompiledStaticCall::compute_entry_for_continuation_entry(const methodHandle
|
||||
|
||||
address CompiledDirectStaticCall::find_stub_for(address instruction) {
|
||||
// Find reloc. information containing this call-site
|
||||
RelocIterator iter((nmethod*)NULL, instruction);
|
||||
RelocIterator iter((nmethod*)nullptr, instruction);
|
||||
while (iter.next()) {
|
||||
if (iter.addr() == instruction) {
|
||||
switch(iter.type()) {
|
||||
@ -671,7 +671,7 @@ address CompiledDirectStaticCall::find_stub_for(address instruction) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
address CompiledDirectStaticCall::find_stub() {
|
||||
@ -699,7 +699,7 @@ void CompiledIC::print() {
|
||||
|
||||
void CompiledIC::print_compiled_ic() {
|
||||
tty->print("Inline cache at " INTPTR_FORMAT ", calling %s " INTPTR_FORMAT " cached_value " INTPTR_FORMAT,
|
||||
p2i(instruction_address()), is_call_to_interpreted() ? "interpreted " : "", p2i(ic_destination()), p2i(is_optimized() ? NULL : cached_value()));
|
||||
p2i(instruction_address()), is_call_to_interpreted() ? "interpreted " : "", p2i(ic_destination()), p2i(is_optimized() ? nullptr : cached_value()));
|
||||
}
|
||||
|
||||
void CompiledDirectStaticCall::print() {
|
||||
@ -722,7 +722,7 @@ void CompiledDirectStaticCall::verify_mt_safe(const methodHandle& callee, addres
|
||||
// becomes not entrant and the cache access returns null, the new
|
||||
// resolve will lead to a new generated LambdaForm.
|
||||
Method* old_method = reinterpret_cast<Method*>(method_holder->data());
|
||||
assert(old_method == NULL || old_method == callee() ||
|
||||
assert(old_method == nullptr || old_method == callee() ||
|
||||
callee->is_compiled_lambda_form() ||
|
||||
!old_method->method_holder()->is_loader_alive() ||
|
||||
old_method->is_old(), // may be race patching deoptimized nmethod due to redefinition.
|
||||
@ -730,7 +730,7 @@ void CompiledDirectStaticCall::verify_mt_safe(const methodHandle& callee, addres
|
||||
|
||||
address destination = jump->jump_destination();
|
||||
assert(destination == (address)-1 || destination == entry
|
||||
|| old_method == NULL || !old_method->method_holder()->is_loader_alive() // may have a race due to class unloading.
|
||||
|| old_method == nullptr || !old_method->method_holder()->is_loader_alive() // may have a race due to class unloading.
|
||||
|| old_method->is_old(), // may be race patching deoptimized nmethod due to redefinition.
|
||||
"b) MT-unsafe modification of inline cache");
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -90,7 +90,7 @@ class CompiledICInfo : public StackObj {
|
||||
Metadata* cached_metadata() const { assert(!_is_icholder, ""); return (Metadata*)_cached_value; }
|
||||
CompiledICHolder* claim_cached_icholder() {
|
||||
assert(_is_icholder, "");
|
||||
assert(_cached_value != NULL, "must be non-NULL");
|
||||
assert(_cached_value != nullptr, "must be non-nullptr");
|
||||
_release_icholder = false;
|
||||
CompiledICHolder* icholder = (CompiledICHolder*)_cached_value;
|
||||
icholder->claim();
|
||||
@ -126,7 +126,7 @@ class CompiledICInfo : public StackObj {
|
||||
_release_icholder = true;
|
||||
}
|
||||
|
||||
CompiledICInfo(): _entry(NULL), _cached_value(NULL), _is_icholder(false),
|
||||
CompiledICInfo(): _entry(nullptr), _cached_value(nullptr), _is_icholder(false),
|
||||
_is_optimized(false), _to_interpreter(false), _release_icholder(false) {
|
||||
}
|
||||
~CompiledICInfo() {
|
||||
@ -186,7 +186,7 @@ class CompiledIC: public ResourceObj {
|
||||
void set_ic_destination(ICStub* stub);
|
||||
void set_ic_destination(address entry_point) {
|
||||
assert(_is_optimized, "use set_ic_destination_and_value instead");
|
||||
internal_set_ic_destination(entry_point, false, NULL, false);
|
||||
internal_set_ic_destination(entry_point, false, nullptr, false);
|
||||
}
|
||||
// This only for use by ICStubs where the type of the value isn't known
|
||||
void set_ic_destination_and_value(address entry_point, void* value) {
|
||||
@ -338,7 +338,7 @@ class StaticCallInfo {
|
||||
class CompiledStaticCall : public ResourceObj {
|
||||
public:
|
||||
// Code
|
||||
static address emit_to_interp_stub(CodeBuffer &cbuf, address mark = NULL);
|
||||
static address emit_to_interp_stub(CodeBuffer &cbuf, address mark = nullptr);
|
||||
static int to_interp_stub_size();
|
||||
static int to_trampoline_stub_size();
|
||||
static int reloc_to_interp_stub();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -56,7 +56,7 @@ CompiledMethod::CompiledMethod(Method* method, const char* name, CompilerType ty
|
||||
: CodeBlob(name, type, layout, frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments, compiled),
|
||||
_mark_for_deoptimization_status(not_marked),
|
||||
_method(method),
|
||||
_gc_data(NULL)
|
||||
_gc_data(nullptr)
|
||||
{
|
||||
init_defaults();
|
||||
}
|
||||
@ -68,17 +68,17 @@ CompiledMethod::CompiledMethod(Method* method, const char* name, CompilerType ty
|
||||
frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments, compiled),
|
||||
_mark_for_deoptimization_status(not_marked),
|
||||
_method(method),
|
||||
_gc_data(NULL)
|
||||
_gc_data(nullptr)
|
||||
{
|
||||
init_defaults();
|
||||
}
|
||||
|
||||
void CompiledMethod::init_defaults() {
|
||||
{ // avoid uninitialized fields, even for short time periods
|
||||
_scopes_data_begin = NULL;
|
||||
_deopt_handler_begin = NULL;
|
||||
_deopt_mh_handler_begin = NULL;
|
||||
_exception_cache = NULL;
|
||||
_scopes_data_begin = nullptr;
|
||||
_deopt_handler_begin = nullptr;
|
||||
_deopt_mh_handler_begin = nullptr;
|
||||
_exception_cache = nullptr;
|
||||
}
|
||||
_has_unsafe_access = 0;
|
||||
_has_method_handle_invokes = 0;
|
||||
@ -89,7 +89,7 @@ void CompiledMethod::init_defaults() {
|
||||
bool CompiledMethod::is_method_handle_return(address return_pc) {
|
||||
if (!has_method_handle_invokes()) return false;
|
||||
PcDesc* pd = pc_desc_at(return_pc);
|
||||
if (pd == NULL)
|
||||
if (pd == nullptr)
|
||||
return false;
|
||||
return pd->is_method_handle_invoke();
|
||||
}
|
||||
@ -108,14 +108,14 @@ const char* CompiledMethod::state() const {
|
||||
return "not_entrant";
|
||||
default:
|
||||
fatal("unexpected method state: %d", state);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void CompiledMethod::mark_for_deoptimization(bool inc_recompile_counts) {
|
||||
// assert(can_be_deoptimized(), ""); // in some places we check before marking, in others not.
|
||||
MutexLocker ml(CompiledMethod_lock->owned_by_self() ? NULL : CompiledMethod_lock,
|
||||
MutexLocker ml(CompiledMethod_lock->owned_by_self() ? nullptr : CompiledMethod_lock,
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
if (_mark_for_deoptimization_status != deoptimize_done) { // can't go backwards
|
||||
_mark_for_deoptimization_status = (inc_recompile_counts ? deoptimize : deoptimize_noupdate);
|
||||
@ -130,12 +130,12 @@ ExceptionCache* CompiledMethod::exception_cache_acquire() const {
|
||||
|
||||
void CompiledMethod::add_exception_cache_entry(ExceptionCache* new_entry) {
|
||||
assert(ExceptionCache_lock->owned_by_self(),"Must hold the ExceptionCache_lock");
|
||||
assert(new_entry != NULL,"Must be non null");
|
||||
assert(new_entry->next() == NULL, "Must be null");
|
||||
assert(new_entry != nullptr,"Must be non null");
|
||||
assert(new_entry->next() == nullptr, "Must be null");
|
||||
|
||||
for (;;) {
|
||||
ExceptionCache *ec = exception_cache();
|
||||
if (ec != NULL) {
|
||||
if (ec != nullptr) {
|
||||
Klass* ex_klass = ec->exception_type();
|
||||
if (!ex_klass->is_loader_alive()) {
|
||||
// We must guarantee that entries are not inserted with new next pointer
|
||||
@ -151,7 +151,7 @@ void CompiledMethod::add_exception_cache_entry(ExceptionCache* new_entry) {
|
||||
continue;
|
||||
}
|
||||
ec = exception_cache();
|
||||
if (ec != NULL) {
|
||||
if (ec != nullptr) {
|
||||
new_entry->set_next(ec);
|
||||
}
|
||||
}
|
||||
@ -177,19 +177,19 @@ void CompiledMethod::clean_exception_cache() {
|
||||
// That similarly implies that CAS operations on ExceptionCache entries do not
|
||||
// suffer from ABA problems as unlinking and deletion is separated by a global
|
||||
// handshake operation.
|
||||
ExceptionCache* prev = NULL;
|
||||
ExceptionCache* prev = nullptr;
|
||||
ExceptionCache* curr = exception_cache_acquire();
|
||||
|
||||
while (curr != NULL) {
|
||||
while (curr != nullptr) {
|
||||
ExceptionCache* next = curr->next();
|
||||
|
||||
if (!curr->exception_type()->is_loader_alive()) {
|
||||
if (prev == NULL) {
|
||||
if (prev == nullptr) {
|
||||
// Try to clean head; this is contended by concurrent inserts, that
|
||||
// both lazily clean the head, and insert entries at the head. If
|
||||
// the CAS fails, the operation is restarted.
|
||||
if (Atomic::cmpxchg(&_exception_cache, curr, next) != curr) {
|
||||
prev = NULL;
|
||||
prev = nullptr;
|
||||
curr = exception_cache_acquire();
|
||||
continue;
|
||||
}
|
||||
@ -217,14 +217,14 @@ address CompiledMethod::handler_for_exception_and_pc(Handle exception, address p
|
||||
// have false negatives. This is okay, as it can only happen during
|
||||
// the first few exception lookups for a given nmethod.
|
||||
ExceptionCache* ec = exception_cache_acquire();
|
||||
while (ec != NULL) {
|
||||
while (ec != nullptr) {
|
||||
address ret_val;
|
||||
if ((ret_val = ec->match(exception,pc)) != NULL) {
|
||||
if ((ret_val = ec->match(exception,pc)) != nullptr) {
|
||||
return ret_val;
|
||||
}
|
||||
ec = ec->next();
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CompiledMethod::add_handler_for_exception_and_pc(Handle exception, address pc, address handler) {
|
||||
@ -237,7 +237,7 @@ void CompiledMethod::add_handler_for_exception_and_pc(Handle exception, address
|
||||
MutexLocker ml(ExceptionCache_lock);
|
||||
ExceptionCache* target_entry = exception_cache_entry_for_exception(exception);
|
||||
|
||||
if (target_entry == NULL || !target_entry->add_address_and_handler(pc,handler)) {
|
||||
if (target_entry == nullptr || !target_entry->add_address_and_handler(pc,handler)) {
|
||||
target_entry = new ExceptionCache(exception,pc,handler);
|
||||
add_exception_cache_entry(target_entry);
|
||||
}
|
||||
@ -248,13 +248,13 @@ void CompiledMethod::add_handler_for_exception_and_pc(Handle exception, address
|
||||
// directly.
|
||||
ExceptionCache* CompiledMethod::exception_cache_entry_for_exception(Handle exception) {
|
||||
ExceptionCache* ec = exception_cache_acquire();
|
||||
while (ec != NULL) {
|
||||
while (ec != nullptr) {
|
||||
if (ec->match_exception_with_space(exception)) {
|
||||
return ec;
|
||||
}
|
||||
ec = ec->next();
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//-------------end of code for ExceptionCache--------------
|
||||
@ -281,7 +281,7 @@ bool CompiledMethod::is_at_poll_or_poll_return(address pc) {
|
||||
|
||||
void CompiledMethod::verify_oop_relocations() {
|
||||
// Ensure sure that the code matches the current oop values
|
||||
RelocIterator iter(this, NULL, NULL);
|
||||
RelocIterator iter(this, nullptr, nullptr);
|
||||
while (iter.next()) {
|
||||
if (iter.type() == relocInfo::oop_type) {
|
||||
oop_Relocation* reloc = iter.oop_reloc();
|
||||
@ -295,13 +295,13 @@ void CompiledMethod::verify_oop_relocations() {
|
||||
|
||||
ScopeDesc* CompiledMethod::scope_desc_at(address pc) {
|
||||
PcDesc* pd = pc_desc_at(pc);
|
||||
guarantee(pd != NULL, "scope must be present");
|
||||
guarantee(pd != nullptr, "scope must be present");
|
||||
return new ScopeDesc(this, pd);
|
||||
}
|
||||
|
||||
ScopeDesc* CompiledMethod::scope_desc_near(address pc) {
|
||||
PcDesc* pd = pc_desc_near(pc);
|
||||
guarantee(pd != NULL, "scope must be present");
|
||||
guarantee(pd != nullptr, "scope must be present");
|
||||
return new ScopeDesc(this, pd);
|
||||
}
|
||||
|
||||
@ -322,7 +322,7 @@ address CompiledMethod::oops_reloc_begin() const {
|
||||
|
||||
// It is not safe to read oops concurrently using entry barriers, if their
|
||||
// location depend on whether the nmethod is entrant or not.
|
||||
// assert(BarrierSet::barrier_set()->barrier_set_nmethod() == NULL, "Not safe oop scan");
|
||||
// assert(BarrierSet::barrier_set()->barrier_set_nmethod() == nullptr, "Not safe oop scan");
|
||||
|
||||
address low_boundary = verified_entry_point();
|
||||
if (!is_in_use() && is_nmethod()) {
|
||||
@ -348,7 +348,7 @@ int CompiledMethod::verify_icholder_relocations() {
|
||||
tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
|
||||
ic->print();
|
||||
}
|
||||
assert(ic->cached_icholder() != NULL, "must be non-NULL");
|
||||
assert(ic->cached_icholder() != nullptr, "must be non-nullptr");
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@ -360,7 +360,7 @@ int CompiledMethod::verify_icholder_relocations() {
|
||||
// Method that knows how to preserve outgoing arguments at call. This method must be
|
||||
// called with a frame corresponding to a Java invoke
|
||||
void CompiledMethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) {
|
||||
if (method() == NULL) {
|
||||
if (method() == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -378,7 +378,7 @@ void CompiledMethod::preserve_callee_argument_oops(frame fr, const RegisterMap *
|
||||
// The method attached by JIT-compilers should be used, if present.
|
||||
// Bytecode can be inaccurate in such case.
|
||||
Method* callee = attached_method_before_pc(pc);
|
||||
if (callee != NULL) {
|
||||
if (callee != nullptr) {
|
||||
has_receiver = !(callee->access_flags().is_static());
|
||||
has_appendix = false;
|
||||
signature = callee->signature();
|
||||
@ -412,7 +412,7 @@ Method* CompiledMethod::attached_method(address call_instr) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL; // not found
|
||||
return nullptr; // not found
|
||||
}
|
||||
|
||||
Method* CompiledMethod::attached_method_before_pc(address pc) {
|
||||
@ -420,7 +420,7 @@ Method* CompiledMethod::attached_method_before_pc(address pc) {
|
||||
NativeCall* ncall = nativeCall_before(pc);
|
||||
return attached_method(ncall->instruction_address());
|
||||
}
|
||||
return NULL; // not a call
|
||||
return nullptr; // not a call
|
||||
}
|
||||
|
||||
void CompiledMethod::clear_inline_caches() {
|
||||
@ -449,7 +449,7 @@ void CompiledMethod::clear_ic_callsites() {
|
||||
// Check class_loader is alive for this bit of metadata.
|
||||
class CheckClass : public MetadataClosure {
|
||||
void do_metadata(Metadata* md) {
|
||||
Klass* klass = NULL;
|
||||
Klass* klass = nullptr;
|
||||
if (md->is_klass()) {
|
||||
klass = ((Klass*)md);
|
||||
} else if (md->is_method()) {
|
||||
@ -480,7 +480,7 @@ bool CompiledMethod::clean_ic_if_metadata_is_dead(CompiledIC *ic) {
|
||||
}
|
||||
} else {
|
||||
Metadata* ic_metdata = ic->cached_metadata();
|
||||
if (ic_metdata != NULL) {
|
||||
if (ic_metdata != nullptr) {
|
||||
if (ic_metdata->is_klass()) {
|
||||
if (((Klass*)ic_metdata)->is_loader_alive()) {
|
||||
return true;
|
||||
@ -509,8 +509,8 @@ template <class CompiledICorStaticCall>
|
||||
static bool clean_if_nmethod_is_unloaded(CompiledICorStaticCall *ic, address addr, CompiledMethod* from,
|
||||
bool clean_all) {
|
||||
CodeBlob *cb = CodeCache::find_blob(addr);
|
||||
CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
|
||||
if (nm != NULL) {
|
||||
CompiledMethod* nm = (cb != nullptr) ? cb->as_compiled_method_or_null() : nullptr;
|
||||
if (nm != nullptr) {
|
||||
// Clean inline caches pointing to bad nmethods
|
||||
if (clean_all || !nm->is_in_use() || nm->is_unloading() || (nm->method()->code() != nm)) {
|
||||
if (!ic->set_to_clean(!from->is_unloading())) {
|
||||
@ -561,13 +561,13 @@ bool CompiledMethod::unload_nmethod_caches(bool unloading_occurred) {
|
||||
|
||||
void CompiledMethod::run_nmethod_entry_barrier() {
|
||||
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
|
||||
if (bs_nm != NULL) {
|
||||
if (bs_nm != nullptr) {
|
||||
// We want to keep an invariant that nmethods found through iterations of a Thread's
|
||||
// nmethods found in safepoints have gone through an entry barrier and are not armed.
|
||||
// By calling this nmethod entry barrier, it plays along and acts
|
||||
// like any other nmethod found on the stack of a thread (fewer surprises).
|
||||
nmethod* nm = as_nmethod_or_null();
|
||||
if (nm != NULL && bs_nm->is_armed(nm)) {
|
||||
if (nm != nullptr && bs_nm->is_armed(nm)) {
|
||||
bool alive = bs_nm->nmethod_entry_barrier(nm);
|
||||
assert(alive, "should be alive");
|
||||
}
|
||||
@ -655,10 +655,10 @@ bool CompiledMethod::cleanup_inline_caches_impl(bool unloading_occurred, bool cl
|
||||
}
|
||||
metadata_Relocation* r = iter.metadata_reloc();
|
||||
Metadata* md = r->metadata_value();
|
||||
if (md != NULL && md->is_method()) {
|
||||
if (md != nullptr && md->is_method()) {
|
||||
Method* method = static_cast<Method*>(md);
|
||||
if (!method->method_holder()->is_loader_alive()) {
|
||||
Atomic::store(r->metadata_addr(), (Method*)NULL);
|
||||
Atomic::store(r->metadata_addr(), (Method*)nullptr);
|
||||
|
||||
if (!r->metadata_is_immediate()) {
|
||||
r->fix_metadata_relocation();
|
||||
@ -686,7 +686,7 @@ address CompiledMethod::continuation_for_implicit_exception(address pc, bool for
|
||||
Thread* thread = Thread::current();
|
||||
ResourceMark rm(thread);
|
||||
CodeBlob* cb = CodeCache::find_blob(pc);
|
||||
assert(cb != NULL && cb == this, "");
|
||||
assert(cb != nullptr && cb == this, "");
|
||||
ttyLocker ttyl;
|
||||
tty->print_cr("implicit exception happened at " INTPTR_FORMAT, p2i(pc));
|
||||
print();
|
||||
@ -697,7 +697,7 @@ address CompiledMethod::continuation_for_implicit_exception(address pc, bool for
|
||||
#endif
|
||||
if (cont_offset == 0) {
|
||||
// Let the normal error handling report the exception
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (cont_offset == exception_offset) {
|
||||
#if INCLUDE_JVMCI
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -95,7 +95,7 @@ class PcDescCache {
|
||||
typedef PcDesc* PcDescPtr;
|
||||
volatile PcDescPtr _pc_descs[cache_size]; // last cache_size pc_descs found
|
||||
public:
|
||||
PcDescCache() { debug_only(_pc_descs[0] = NULL); }
|
||||
PcDescCache() { debug_only(_pc_descs[0] = nullptr); }
|
||||
void reset_to(PcDesc* initial_pc_desc);
|
||||
PcDesc* find_pc_desc(int pc_offset, bool approximate);
|
||||
void add_pc_desc(PcDesc* pc_desc);
|
||||
@ -130,7 +130,7 @@ public:
|
||||
PcDesc* find_pc_desc(address pc, bool approximate, const PcDescSearch& search) {
|
||||
address base_address = search.code_begin();
|
||||
PcDesc* desc = _pc_desc_cache.last_pc_desc();
|
||||
if (desc != NULL && desc->pc_offset() == pc - base_address) {
|
||||
if (desc != nullptr && desc->pc_offset() == pc - base_address) {
|
||||
return desc;
|
||||
}
|
||||
return find_pc_desc_internal(pc, approximate, search);
|
||||
@ -221,8 +221,8 @@ public:
|
||||
virtual int osr_entry_bci() const = 0;
|
||||
Method* method() const { return _method; }
|
||||
virtual void print_pcs() = 0;
|
||||
bool is_native_method() const { return _method != NULL && _method->is_native(); }
|
||||
bool is_java_method() const { return _method != NULL && !_method->is_native(); }
|
||||
bool is_native_method() const { return _method != nullptr && _method->is_native(); }
|
||||
bool is_java_method() const { return _method != nullptr && !_method->is_native(); }
|
||||
|
||||
// ScopeDesc retrieval operation
|
||||
PcDesc* pc_desc_at(address pc) { return find_pc_desc(pc, false); }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -58,13 +58,13 @@ inline bool CompiledMethod::is_deopt_mh_entry(address pc) {
|
||||
// (b) it is a deopt PC
|
||||
|
||||
inline address CompiledMethod::get_deopt_original_pc(const frame* fr) {
|
||||
if (fr->cb() == NULL) return NULL;
|
||||
if (fr->cb() == nullptr) return nullptr;
|
||||
|
||||
CompiledMethod* cm = fr->cb()->as_compiled_method_or_null();
|
||||
if (cm != NULL && cm->is_deopt_pc(fr->pc()))
|
||||
if (cm != nullptr && cm->is_deopt_pc(fr->pc()))
|
||||
return cm->get_original_pc(fr);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -72,7 +72,7 @@ jlong CompressedReadStream::read_long() {
|
||||
return jlong_from(high, low);
|
||||
}
|
||||
|
||||
CompressedWriteStream::CompressedWriteStream(int initial_size) : CompressedStream(NULL, 0) {
|
||||
CompressedWriteStream::CompressedWriteStream(int initial_size) : CompressedStream(nullptr, 0) {
|
||||
_buffer = NEW_RESOURCE_ARRAY(u_char, initial_size);
|
||||
_size = initial_size;
|
||||
_position = 0;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -54,7 +54,7 @@ void DebugInfoWriteStream::write_metadata(Metadata* h) {
|
||||
oop DebugInfoReadStream::read_oop() {
|
||||
nmethod* nm = const_cast<CompiledMethod*>(code())->as_nmethod_or_null();
|
||||
oop o;
|
||||
if (nm != NULL) {
|
||||
if (nm != nullptr) {
|
||||
// Despite these oops being found inside nmethods that are on-stack,
|
||||
// they are not kept alive by all GCs (e.g. G1 and Shenandoah).
|
||||
o = nm->oop_at_phantom(read_int());
|
||||
@ -68,7 +68,7 @@ oop DebugInfoReadStream::read_oop() {
|
||||
ScopeValue* DebugInfoReadStream::read_object_value(bool is_auto_box) {
|
||||
int id = read_int();
|
||||
#ifdef ASSERT
|
||||
assert(_obj_pool != NULL, "object pool does not exist");
|
||||
assert(_obj_pool != nullptr, "object pool does not exist");
|
||||
for (int i = _obj_pool->length() - 1; i >= 0; i--) {
|
||||
assert(_obj_pool->at(i)->as_ObjectValue()->id() != id, "should not be read twice");
|
||||
}
|
||||
@ -82,7 +82,7 @@ ScopeValue* DebugInfoReadStream::read_object_value(bool is_auto_box) {
|
||||
|
||||
ScopeValue* DebugInfoReadStream::get_cached_object() {
|
||||
int id = read_int();
|
||||
assert(_obj_pool != NULL, "object pool does not exist");
|
||||
assert(_obj_pool != nullptr, "object pool does not exist");
|
||||
for (int i = _obj_pool->length() - 1; i >= 0; i--) {
|
||||
ObjectValue* ov = _obj_pool->at(i)->as_ObjectValue();
|
||||
if (ov->id() == id) {
|
||||
@ -90,7 +90,7 @@ ScopeValue* DebugInfoReadStream::get_cached_object() {
|
||||
}
|
||||
}
|
||||
ShouldNotReachHere();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Serializing scope values
|
||||
@ -101,7 +101,7 @@ enum { LOCATION_CODE = 0, CONSTANT_INT_CODE = 1, CONSTANT_OOP_CODE = 2,
|
||||
AUTO_BOX_OBJECT_CODE = 7, MARKER_CODE = 8 };
|
||||
|
||||
ScopeValue* ScopeValue::read_from(DebugInfoReadStream* stream) {
|
||||
ScopeValue* result = NULL;
|
||||
ScopeValue* result = nullptr;
|
||||
switch(stream->read_int()) {
|
||||
case LOCATION_CODE: result = new LocationValue(stream); break;
|
||||
case CONSTANT_INT_CODE: result = new ConstantIntValue(stream); break;
|
||||
@ -244,7 +244,7 @@ void ConstantOopWriteValue::write_on(DebugInfoWriteStream* stream) {
|
||||
// cannot use ThreadInVMfromNative here since in case of JVMCI compiler,
|
||||
// thread is already in VM state.
|
||||
ThreadInVMfromUnknown tiv;
|
||||
assert(JNIHandles::resolve(value()) == NULL ||
|
||||
assert(JNIHandles::resolve(value()) == nullptr ||
|
||||
Universe::heap()->is_in(JNIHandles::resolve(value())),
|
||||
"Should be in heap");
|
||||
}
|
||||
@ -265,7 +265,7 @@ void ConstantOopWriteValue::print_on(outputStream* st) const {
|
||||
|
||||
ConstantOopReadValue::ConstantOopReadValue(DebugInfoReadStream* stream) {
|
||||
_value = Handle(Thread::current(), stream->read_oop());
|
||||
assert(_value() == NULL ||
|
||||
assert(_value() == nullptr ||
|
||||
Universe::heap()->is_in(_value()), "Should be in heap");
|
||||
}
|
||||
|
||||
@ -274,10 +274,10 @@ void ConstantOopReadValue::write_on(DebugInfoWriteStream* stream) {
|
||||
}
|
||||
|
||||
void ConstantOopReadValue::print_on(outputStream* st) const {
|
||||
if (value()() != NULL) {
|
||||
if (value()() != nullptr) {
|
||||
value()()->print_value_on(st);
|
||||
} else {
|
||||
st->print("NULL");
|
||||
st->print("nullptr");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -138,7 +138,7 @@ class ObjectValue: public ScopeValue {
|
||||
|
||||
ObjectValue(int id)
|
||||
: _id(id)
|
||||
, _klass(NULL)
|
||||
, _klass(nullptr)
|
||||
, _field_values()
|
||||
, _value()
|
||||
, _visited(false) {}
|
||||
@ -301,7 +301,7 @@ class DebugInfoReadStream : public CompressedReadStream {
|
||||
const CompiledMethod* code() const { return _code; }
|
||||
GrowableArray<ScopeValue*>* _obj_pool;
|
||||
public:
|
||||
DebugInfoReadStream(const CompiledMethod* code, int offset, GrowableArray<ScopeValue*>* obj_pool = NULL) :
|
||||
DebugInfoReadStream(const CompiledMethod* code, int offset, GrowableArray<ScopeValue*>* obj_pool = nullptr) :
|
||||
CompressedReadStream(code->scopes_data_begin(), offset) {
|
||||
_code = code;
|
||||
_obj_pool = obj_pool;
|
||||
@ -312,7 +312,7 @@ class DebugInfoReadStream : public CompressedReadStream {
|
||||
Method* read_method() {
|
||||
Method* o = (Method*)(code()->metadata_at(read_int()));
|
||||
// is_metadata() is a faster check than is_metaspace_object()
|
||||
assert(o == NULL || o->is_metadata(), "meta data only");
|
||||
assert(o == nullptr || o->is_metadata(), "meta data only");
|
||||
return o;
|
||||
}
|
||||
ScopeValue* read_object_value(bool is_auto_box);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -82,7 +82,7 @@ public:
|
||||
return that;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static int compare(DIR_Chunk* const & a, DIR_Chunk* const & b) {
|
||||
@ -137,7 +137,7 @@ DebugInformationRecorder::DebugInformationRecorder(OopRecorder* oop_recorder)
|
||||
_oop_recorder = oop_recorder;
|
||||
|
||||
_all_chunks = new GrowableArray<DIR_Chunk*>(300);
|
||||
_next_chunk = _next_chunk_limit = NULL;
|
||||
_next_chunk = _next_chunk_limit = nullptr;
|
||||
|
||||
add_new_pc_offset(PcDesc::lower_offset_limit); // sentinel record
|
||||
|
||||
@ -196,7 +196,7 @@ void DebugInformationRecorder::add_new_pc_offset(int pc_offset) {
|
||||
|
||||
|
||||
int DebugInformationRecorder::serialize_monitor_values(GrowableArray<MonitorValue*>* monitors) {
|
||||
if (monitors == NULL || monitors->is_empty()) return DebugInformationRecorder::serialized_null;
|
||||
if (monitors == nullptr || monitors->is_empty()) return DebugInformationRecorder::serialized_null;
|
||||
assert(_recording_state == rs_safepoint, "must be recording a safepoint");
|
||||
int result = stream()->position();
|
||||
stream()->write_int(monitors->length());
|
||||
@ -217,7 +217,7 @@ int DebugInformationRecorder::serialize_monitor_values(GrowableArray<MonitorValu
|
||||
|
||||
|
||||
int DebugInformationRecorder::serialize_scope_values(GrowableArray<ScopeValue*>* values) {
|
||||
if (values == NULL || values->is_empty()) return DebugInformationRecorder::serialized_null;
|
||||
if (values == nullptr || values->is_empty()) return DebugInformationRecorder::serialized_null;
|
||||
assert(_recording_state == rs_safepoint, "must be recording a safepoint");
|
||||
int result = stream()->position();
|
||||
assert(result != serialized_null, "sanity");
|
||||
@ -315,17 +315,17 @@ void DebugInformationRecorder::describe_scope(int pc_offset,
|
||||
|
||||
// serialize scope
|
||||
Metadata* method_enc;
|
||||
if (method != NULL) {
|
||||
if (method != nullptr) {
|
||||
method_enc = method->constant_encoding();
|
||||
} else if (methodH.not_null()) {
|
||||
method_enc = methodH();
|
||||
} else {
|
||||
method_enc = NULL;
|
||||
method_enc = nullptr;
|
||||
}
|
||||
int method_enc_index = oop_recorder()->find_index(method_enc);
|
||||
stream()->write_int(method_enc_index);
|
||||
stream()->write_bci(bci);
|
||||
assert(method == NULL ||
|
||||
assert(method == nullptr ||
|
||||
(method->is_native() && bci == 0) ||
|
||||
(!method->is_native() && 0 <= bci && bci < method->code_size()) ||
|
||||
bci == -1, "illegal bci");
|
||||
@ -352,7 +352,7 @@ void DebugInformationRecorder::describe_scope(int pc_offset,
|
||||
void DebugInformationRecorder::dump_object_pool(GrowableArray<ScopeValue*>* objects) {
|
||||
guarantee( _pcs_length > 0, "safepoint must exist before describing scopes");
|
||||
PcDesc* last_pd = &_pcs[_pcs_length-1];
|
||||
if (objects != NULL) {
|
||||
if (objects != nullptr) {
|
||||
for (int i = objects->length() - 1; i >= 0; i--) {
|
||||
objects->at(i)->as_ObjectValue()->set_visited(false);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -109,9 +109,9 @@ class DebugInformationRecorder: public ResourceObj {
|
||||
bool return_oop = false,
|
||||
bool has_ea_local_in_scope = false,
|
||||
bool arg_escape = false,
|
||||
DebugToken* locals = NULL,
|
||||
DebugToken* expressions = NULL,
|
||||
DebugToken* monitors = NULL);
|
||||
DebugToken* locals = nullptr,
|
||||
DebugToken* expressions = nullptr,
|
||||
DebugToken* monitors = nullptr);
|
||||
|
||||
|
||||
void dump_object_pool(GrowableArray<ScopeValue*>* objects);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -203,17 +203,17 @@ class Dependencies: public ResourceObj {
|
||||
|
||||
public:
|
||||
DepValue() : _id(0) {}
|
||||
DepValue(OopRecorder* rec, Metadata* metadata, DepValue* candidate = NULL) {
|
||||
assert(candidate == NULL || candidate->is_metadata(), "oops");
|
||||
if (candidate != NULL && candidate->as_metadata(rec) == metadata) {
|
||||
DepValue(OopRecorder* rec, Metadata* metadata, DepValue* candidate = nullptr) {
|
||||
assert(candidate == nullptr || candidate->is_metadata(), "oops");
|
||||
if (candidate != nullptr && candidate->as_metadata(rec) == metadata) {
|
||||
_id = candidate->_id;
|
||||
} else {
|
||||
_id = rec->find_index(metadata) + 1;
|
||||
}
|
||||
}
|
||||
DepValue(OopRecorder* rec, jobject obj, DepValue* candidate = NULL) {
|
||||
assert(candidate == NULL || candidate->is_object(), "oops");
|
||||
if (candidate != NULL && candidate->as_object(rec) == obj) {
|
||||
DepValue(OopRecorder* rec, jobject obj, DepValue* candidate = nullptr) {
|
||||
assert(candidate == nullptr || candidate->is_object(), "oops");
|
||||
if (candidate != nullptr && candidate->as_object(rec) == obj) {
|
||||
_id = candidate->_id;
|
||||
} else {
|
||||
_id = -(rec->find_index(obj) + 1);
|
||||
@ -233,13 +233,13 @@ class Dependencies: public ResourceObj {
|
||||
Metadata* as_metadata(OopRecorder* rec) const { assert(is_metadata(), "oops"); return rec->metadata_at(index()); }
|
||||
Klass* as_klass(OopRecorder* rec) const {
|
||||
Metadata* m = as_metadata(rec);
|
||||
assert(m != NULL, "as_metadata returned NULL");
|
||||
assert(m != nullptr, "as_metadata returned nullptr");
|
||||
assert(m->is_klass(), "oops");
|
||||
return (Klass*) m;
|
||||
}
|
||||
Method* as_method(OopRecorder* rec) const {
|
||||
Metadata* m = as_metadata(rec);
|
||||
assert(m != NULL, "as_metadata returned NULL");
|
||||
assert(m != nullptr, "as_metadata returned nullptr");
|
||||
assert(m->is_method(), "oops");
|
||||
return (Method*) m;
|
||||
}
|
||||
@ -266,7 +266,7 @@ class Dependencies: public ResourceObj {
|
||||
bool note_dep_seen(int dept, ciBaseObject* x) {
|
||||
assert(dept < BitsPerInt, "oob");
|
||||
int x_id = x->ident();
|
||||
assert(_dep_seen != NULL, "deps must be writable");
|
||||
assert(_dep_seen != nullptr, "deps must be writable");
|
||||
int seen = _dep_seen->at_grow(x_id, 0);
|
||||
_dep_seen->at_put(x_id, seen | (1<<dept));
|
||||
// return true if we've already seen dept/x
|
||||
@ -278,7 +278,7 @@ class Dependencies: public ResourceObj {
|
||||
assert(dept < BitsPerInt, "oops");
|
||||
// place metadata deps at even indexes, object deps at odd indexes
|
||||
int x_id = x.is_metadata() ? x.index() * 2 : (x.index() * 2) + 1;
|
||||
assert(_dep_seen != NULL, "deps must be writable");
|
||||
assert(_dep_seen != nullptr, "deps must be writable");
|
||||
int seen = _dep_seen->at_grow(x_id, 0);
|
||||
_dep_seen->at_put(x_id, seen | (1<<dept));
|
||||
// return true if we've already seen dept/x
|
||||
@ -391,7 +391,7 @@ class Dependencies: public ResourceObj {
|
||||
static Klass* find_finalizable_subclass(InstanceKlass* ik);
|
||||
|
||||
static bool is_concrete_root_method(Method* uniqm, InstanceKlass* ctxk);
|
||||
static Klass* find_witness_AME(InstanceKlass* ctxk, Method* m, KlassDepChange* changes = NULL);
|
||||
static Klass* find_witness_AME(InstanceKlass* ctxk, Method* m, KlassDepChange* changes = nullptr);
|
||||
|
||||
// These versions of the concreteness queries work through the CI.
|
||||
// The CI versions are allowed to skew sometimes from the VM
|
||||
@ -418,17 +418,17 @@ class Dependencies: public ResourceObj {
|
||||
// Checking old assertions at run-time (in the VM only):
|
||||
static Klass* check_evol_method(Method* m);
|
||||
static Klass* check_leaf_type(InstanceKlass* ctxk);
|
||||
static Klass* check_abstract_with_unique_concrete_subtype(InstanceKlass* ctxk, Klass* conck, NewKlassDepChange* changes = NULL);
|
||||
static Klass* check_unique_implementor(InstanceKlass* ctxk, Klass* uniqk, NewKlassDepChange* changes = NULL);
|
||||
static Klass* check_unique_concrete_method(InstanceKlass* ctxk, Method* uniqm, NewKlassDepChange* changes = NULL);
|
||||
static Klass* check_unique_concrete_method(InstanceKlass* ctxk, Method* uniqm, Klass* resolved_klass, Method* resolved_method, KlassDepChange* changes = NULL);
|
||||
static Klass* check_has_no_finalizable_subclasses(InstanceKlass* ctxk, NewKlassDepChange* changes = NULL);
|
||||
static Klass* check_call_site_target_value(oop call_site, oop method_handle, CallSiteDepChange* changes = NULL);
|
||||
// A returned Klass* is NULL if the dependency assertion is still
|
||||
// valid. A non-NULL Klass* is a 'witness' to the assertion
|
||||
static Klass* check_abstract_with_unique_concrete_subtype(InstanceKlass* ctxk, Klass* conck, NewKlassDepChange* changes = nullptr);
|
||||
static Klass* check_unique_implementor(InstanceKlass* ctxk, Klass* uniqk, NewKlassDepChange* changes = nullptr);
|
||||
static Klass* check_unique_concrete_method(InstanceKlass* ctxk, Method* uniqm, NewKlassDepChange* changes = nullptr);
|
||||
static Klass* check_unique_concrete_method(InstanceKlass* ctxk, Method* uniqm, Klass* resolved_klass, Method* resolved_method, KlassDepChange* changes = nullptr);
|
||||
static Klass* check_has_no_finalizable_subclasses(InstanceKlass* ctxk, NewKlassDepChange* changes = nullptr);
|
||||
static Klass* check_call_site_target_value(oop call_site, oop method_handle, CallSiteDepChange* changes = nullptr);
|
||||
// A returned Klass* is nullptr if the dependency assertion is still
|
||||
// valid. A non-nullptr Klass* is a 'witness' to the assertion
|
||||
// failure, a point in the class hierarchy where the assertion has
|
||||
// been proven false. For example, if check_leaf_type returns
|
||||
// non-NULL, the value is a subtype of the supposed leaf type. This
|
||||
// non-nullptr, the value is a subtype of the supposed leaf type. This
|
||||
// witness value may be useful for logging the dependency failure.
|
||||
// Note that, when a dependency fails, there may be several possible
|
||||
// witnesses to the failure. The value returned from the check_foo
|
||||
@ -441,7 +441,7 @@ class Dependencies: public ResourceObj {
|
||||
// Detecting possible new assertions:
|
||||
static Klass* find_unique_concrete_subtype(InstanceKlass* ctxk);
|
||||
static Method* find_unique_concrete_method(InstanceKlass* ctxk, Method* m,
|
||||
Klass** participant = NULL); // out parameter
|
||||
Klass** participant = nullptr); // out parameter
|
||||
static Method* find_unique_concrete_method(InstanceKlass* ctxk, Method* m, Klass* resolved_klass, Method* resolved_method);
|
||||
|
||||
#ifdef ASSERT
|
||||
@ -452,11 +452,11 @@ class Dependencies: public ResourceObj {
|
||||
void encode_content_bytes();
|
||||
|
||||
address content_bytes() {
|
||||
assert(_content_bytes != NULL, "encode it first");
|
||||
assert(_content_bytes != nullptr, "encode it first");
|
||||
return _content_bytes;
|
||||
}
|
||||
size_t size_in_bytes() {
|
||||
assert(_content_bytes != NULL, "encode it first");
|
||||
assert(_content_bytes != nullptr, "encode it first");
|
||||
return _size_in_bytes;
|
||||
}
|
||||
|
||||
@ -465,7 +465,7 @@ class Dependencies: public ResourceObj {
|
||||
|
||||
void copy_to(nmethod* nm);
|
||||
|
||||
DepType validate_dependencies(CompileTask* task, char** failure_detail = NULL);
|
||||
DepType validate_dependencies(CompileTask* task, char** failure_detail = nullptr);
|
||||
|
||||
void log_all_dependencies();
|
||||
|
||||
@ -479,25 +479,25 @@ class Dependencies: public ResourceObj {
|
||||
|
||||
void log_dependency(DepType dept,
|
||||
ciBaseObject* x0,
|
||||
ciBaseObject* x1 = NULL,
|
||||
ciBaseObject* x2 = NULL,
|
||||
ciBaseObject* x3 = NULL) {
|
||||
if (log() == NULL) {
|
||||
ciBaseObject* x1 = nullptr,
|
||||
ciBaseObject* x2 = nullptr,
|
||||
ciBaseObject* x3 = nullptr) {
|
||||
if (log() == nullptr) {
|
||||
return;
|
||||
}
|
||||
ResourceMark rm;
|
||||
GrowableArray<ciBaseObject*>* ciargs =
|
||||
new GrowableArray<ciBaseObject*>(dep_args(dept));
|
||||
assert (x0 != NULL, "no log x0");
|
||||
assert (x0 != nullptr, "no log x0");
|
||||
ciargs->push(x0);
|
||||
|
||||
if (x1 != NULL) {
|
||||
if (x1 != nullptr) {
|
||||
ciargs->push(x1);
|
||||
}
|
||||
if (x2 != NULL) {
|
||||
if (x2 != nullptr) {
|
||||
ciargs->push(x2);
|
||||
}
|
||||
if (x3 != NULL) {
|
||||
if (x3 != nullptr) {
|
||||
ciargs->push(x3);
|
||||
}
|
||||
assert(ciargs->length() == dep_args(dept), "");
|
||||
@ -510,11 +510,11 @@ class Dependencies: public ResourceObj {
|
||||
bool _valid;
|
||||
void* _value;
|
||||
public:
|
||||
DepArgument() : _is_oop(false), _valid(false), _value(NULL) {}
|
||||
DepArgument() : _is_oop(false), _valid(false), _value(nullptr) {}
|
||||
DepArgument(oop v): _is_oop(true), _valid(true), _value(v) {}
|
||||
DepArgument(Metadata* v): _is_oop(false), _valid(true), _value(v) {}
|
||||
|
||||
bool is_null() const { return _value == NULL; }
|
||||
bool is_null() const { return _value == nullptr; }
|
||||
bool is_oop() const { return _is_oop; }
|
||||
bool is_metadata() const { return !_is_oop; }
|
||||
bool is_klass() const { return is_metadata() && metadata_value()->is_klass(); }
|
||||
@ -526,7 +526,7 @@ class Dependencies: public ResourceObj {
|
||||
|
||||
static void print_dependency(DepType dept,
|
||||
GrowableArray<DepArgument>* args,
|
||||
Klass* witness = NULL, outputStream* st = tty);
|
||||
Klass* witness = nullptr, outputStream* st = tty);
|
||||
|
||||
private:
|
||||
// helper for encoding common context types as zero:
|
||||
@ -537,15 +537,15 @@ class Dependencies: public ResourceObj {
|
||||
static void write_dependency_to(CompileLog* log,
|
||||
DepType dept,
|
||||
GrowableArray<ciBaseObject*>* args,
|
||||
Klass* witness = NULL);
|
||||
Klass* witness = nullptr);
|
||||
static void write_dependency_to(CompileLog* log,
|
||||
DepType dept,
|
||||
GrowableArray<DepArgument>* args,
|
||||
Klass* witness = NULL);
|
||||
Klass* witness = nullptr);
|
||||
static void write_dependency_to(xmlStream* xtty,
|
||||
DepType dept,
|
||||
GrowableArray<DepArgument>* args,
|
||||
Klass* witness = NULL);
|
||||
Klass* witness = nullptr);
|
||||
public:
|
||||
// Use this to iterate over an nmethod's dependency set.
|
||||
// Works on new and old dependency sets.
|
||||
@ -585,7 +585,7 @@ class Dependencies: public ResourceObj {
|
||||
|
||||
public:
|
||||
DepStream(Dependencies* deps)
|
||||
: _code(NULL),
|
||||
: _code(nullptr),
|
||||
_deps(deps),
|
||||
_bytes(deps->content_bytes())
|
||||
{
|
||||
@ -593,7 +593,7 @@ class Dependencies: public ResourceObj {
|
||||
}
|
||||
DepStream(nmethod* code)
|
||||
: _code(code),
|
||||
_deps(NULL),
|
||||
_deps(nullptr),
|
||||
_bytes(code->dependencies_begin())
|
||||
{
|
||||
initial_asserts(code->dependencies_size());
|
||||
@ -627,9 +627,9 @@ class Dependencies: public ResourceObj {
|
||||
|
||||
// The point of the whole exercise: Is this dep still OK?
|
||||
Klass* check_dependency() {
|
||||
Klass* result = check_klass_dependency(NULL);
|
||||
if (result != NULL) return result;
|
||||
return check_call_site_dependency(NULL);
|
||||
Klass* result = check_klass_dependency(nullptr);
|
||||
if (result != nullptr) return result;
|
||||
return check_call_site_dependency(nullptr);
|
||||
}
|
||||
|
||||
// A lighter version: Checks only around recent changes in a class
|
||||
@ -637,10 +637,10 @@ class Dependencies: public ResourceObj {
|
||||
Klass* spot_check_dependency_at(DepChange& changes);
|
||||
|
||||
// Log the current dependency to xtty or compilation log.
|
||||
void log_dependency(Klass* witness = NULL);
|
||||
void log_dependency(Klass* witness = nullptr);
|
||||
|
||||
// Print the current dependency to tty.
|
||||
void print_dependency(Klass* witness = NULL, bool verbose = false, outputStream* st = tty);
|
||||
void print_dependency(Klass* witness = nullptr, bool verbose = false, outputStream* st = tty);
|
||||
};
|
||||
friend class Dependencies::DepStream;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,11 +33,11 @@
|
||||
#include "runtime/perfData.hpp"
|
||||
#include "utilities/exceptions.hpp"
|
||||
|
||||
PerfCounter* DependencyContext::_perf_total_buckets_allocated_count = NULL;
|
||||
PerfCounter* DependencyContext::_perf_total_buckets_deallocated_count = NULL;
|
||||
PerfCounter* DependencyContext::_perf_total_buckets_stale_count = NULL;
|
||||
PerfCounter* DependencyContext::_perf_total_buckets_stale_acc_count = NULL;
|
||||
nmethodBucket* volatile DependencyContext::_purge_list = NULL;
|
||||
PerfCounter* DependencyContext::_perf_total_buckets_allocated_count = nullptr;
|
||||
PerfCounter* DependencyContext::_perf_total_buckets_deallocated_count = nullptr;
|
||||
PerfCounter* DependencyContext::_perf_total_buckets_stale_count = nullptr;
|
||||
PerfCounter* DependencyContext::_perf_total_buckets_stale_acc_count = nullptr;
|
||||
nmethodBucket* volatile DependencyContext::_purge_list = nullptr;
|
||||
volatile uint64_t DependencyContext::_cleaning_epoch = 0;
|
||||
uint64_t DependencyContext::_cleaning_epoch_monotonic = 0;
|
||||
|
||||
@ -66,7 +66,7 @@ void DependencyContext::init() {
|
||||
//
|
||||
int DependencyContext::mark_dependent_nmethods(DepChange& changes) {
|
||||
int found = 0;
|
||||
for (nmethodBucket* b = dependencies_not_unloading(); b != NULL; b = b->next_not_unloading()) {
|
||||
for (nmethodBucket* b = dependencies_not_unloading(); b != nullptr; b = b->next_not_unloading()) {
|
||||
nmethod* nm = b->get_nmethod();
|
||||
if (b->count() > 0) {
|
||||
if (nm->is_marked_for_deoptimization()) {
|
||||
@ -97,13 +97,13 @@ int DependencyContext::mark_dependent_nmethods(DepChange& changes) {
|
||||
//
|
||||
void DependencyContext::add_dependent_nmethod(nmethod* nm) {
|
||||
assert_lock_strong(CodeCache_lock);
|
||||
for (nmethodBucket* b = dependencies_not_unloading(); b != NULL; b = b->next_not_unloading()) {
|
||||
for (nmethodBucket* b = dependencies_not_unloading(); b != nullptr; b = b->next_not_unloading()) {
|
||||
if (nm == b->get_nmethod()) {
|
||||
b->increment();
|
||||
return;
|
||||
}
|
||||
}
|
||||
nmethodBucket* new_head = new nmethodBucket(nm, NULL);
|
||||
nmethodBucket* new_head = new nmethodBucket(nm, nullptr);
|
||||
for (;;) {
|
||||
nmethodBucket* head = Atomic::load(_dependency_context_addr);
|
||||
new_head->set_next(head);
|
||||
@ -146,7 +146,7 @@ void DependencyContext::release(nmethodBucket* b) {
|
||||
//
|
||||
void DependencyContext::purge_dependency_contexts() {
|
||||
int removed = 0;
|
||||
for (nmethodBucket* b = _purge_list; b != NULL;) {
|
||||
for (nmethodBucket* b = _purge_list; b != nullptr;) {
|
||||
nmethodBucket* next = b->purge_list_next();
|
||||
removed++;
|
||||
delete b;
|
||||
@ -155,7 +155,7 @@ void DependencyContext::purge_dependency_contexts() {
|
||||
if (UsePerfData && removed > 0) {
|
||||
_perf_total_buckets_deallocated_count->inc(removed);
|
||||
}
|
||||
_purge_list = NULL;
|
||||
_purge_list = nullptr;
|
||||
}
|
||||
|
||||
//
|
||||
@ -169,7 +169,7 @@ void DependencyContext::clean_unloading_dependents() {
|
||||
// Walk the nmethodBuckets and move dead entries on the purge list, which will
|
||||
// be deleted during ClassLoaderDataGraph::purge().
|
||||
nmethodBucket* b = dependencies_not_unloading();
|
||||
while (b != NULL) {
|
||||
while (b != nullptr) {
|
||||
nmethodBucket* next = b->next_not_unloading();
|
||||
b = next;
|
||||
}
|
||||
@ -185,15 +185,15 @@ nmethodBucket* DependencyContext::release_and_get_next_not_unloading(nmethodBuck
|
||||
// Invalidate all dependencies in the context
|
||||
void DependencyContext::remove_all_dependents() {
|
||||
nmethodBucket* b = dependencies_not_unloading();
|
||||
set_dependencies(NULL);
|
||||
set_dependencies(nullptr);
|
||||
assert(b == nullptr, "All dependents should be unloading");
|
||||
}
|
||||
|
||||
int DependencyContext::remove_and_mark_for_deoptimization_all_dependents() {
|
||||
nmethodBucket* b = dependencies_not_unloading();
|
||||
set_dependencies(NULL);
|
||||
set_dependencies(nullptr);
|
||||
int marked = 0;
|
||||
while (b != NULL) {
|
||||
while (b != nullptr) {
|
||||
nmethod* nm = b->get_nmethod();
|
||||
if (b->count() > 0) {
|
||||
// Also count already (concurrently) marked nmethods to make sure
|
||||
@ -209,7 +209,7 @@ int DependencyContext::remove_and_mark_for_deoptimization_all_dependents() {
|
||||
#ifndef PRODUCT
|
||||
void DependencyContext::print_dependent_nmethods(bool verbose) {
|
||||
int idx = 0;
|
||||
for (nmethodBucket* b = dependencies_not_unloading(); b != NULL; b = b->next_not_unloading()) {
|
||||
for (nmethodBucket* b = dependencies_not_unloading(); b != nullptr; b = b->next_not_unloading()) {
|
||||
nmethod* nm = b->get_nmethod();
|
||||
tty->print("[%d] count=%d { ", idx++, b->count());
|
||||
if (!verbose) {
|
||||
@ -225,7 +225,7 @@ void DependencyContext::print_dependent_nmethods(bool verbose) {
|
||||
#endif //PRODUCT
|
||||
|
||||
bool DependencyContext::is_dependent_nmethod(nmethod* nm) {
|
||||
for (nmethodBucket* b = dependencies_not_unloading(); b != NULL; b = b->next_not_unloading()) {
|
||||
for (nmethodBucket* b = dependencies_not_unloading(); b != nullptr; b = b->next_not_unloading()) {
|
||||
if (nm == b->get_nmethod()) {
|
||||
#ifdef ASSERT
|
||||
int count = b->count();
|
||||
@ -260,7 +260,7 @@ nmethodBucket* DependencyContext::dependencies_not_unloading() {
|
||||
for (;;) {
|
||||
// Need acquire because the read value could come from a concurrent insert.
|
||||
nmethodBucket* head = Atomic::load_acquire(_dependency_context_addr);
|
||||
if (head == NULL || !head->get_nmethod()->is_unloading()) {
|
||||
if (head == nullptr || !head->get_nmethod()->is_unloading()) {
|
||||
return head;
|
||||
}
|
||||
nmethodBucket* head_next = head->next();
|
||||
@ -314,7 +314,7 @@ nmethodBucket* nmethodBucket::next_not_unloading() {
|
||||
// Do not need acquire because the loaded entry can never be
|
||||
// concurrently inserted.
|
||||
nmethodBucket* next = Atomic::load(&_next);
|
||||
if (next == NULL || !next->get_nmethod()->is_unloading()) {
|
||||
if (next == nullptr || !next->get_nmethod()->is_unloading()) {
|
||||
return next;
|
||||
}
|
||||
nmethodBucket* next_next = Atomic::load(&next->_next);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -54,7 +54,7 @@ class nmethodBucket: public CHeapObj<mtClass> {
|
||||
|
||||
public:
|
||||
nmethodBucket(nmethod* nmethod, nmethodBucket* next) :
|
||||
_nmethod(nmethod), _count(1), _next(next), _purge_list_next(NULL) {}
|
||||
_nmethod(nmethod), _count(1), _next(next), _purge_list_next(nullptr) {}
|
||||
|
||||
int count() { return _count; }
|
||||
int increment() { _count += 1; return _count; }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -53,7 +53,7 @@ HandlerTableEntry* ExceptionHandlerTable::subtable_for(int catch_pco) const {
|
||||
i += t->len() + 1; // +1 for header
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -78,16 +78,16 @@ void ExceptionHandlerTable::add_subtable(
|
||||
GrowableArray<intptr_t>* scope_depths_from_top_scope,
|
||||
GrowableArray<intptr_t>* handler_pcos
|
||||
) {
|
||||
assert(subtable_for(catch_pco) == NULL, "catch handlers for this catch_pco added twice");
|
||||
assert(subtable_for(catch_pco) == nullptr, "catch handlers for this catch_pco added twice");
|
||||
assert(handler_bcis->length() == handler_pcos->length(), "bci & pc table have different length");
|
||||
assert(scope_depths_from_top_scope == NULL || handler_bcis->length() == scope_depths_from_top_scope->length(), "bci & scope_depths table have different length");
|
||||
assert(scope_depths_from_top_scope == nullptr || handler_bcis->length() == scope_depths_from_top_scope->length(), "bci & scope_depths table have different length");
|
||||
if (handler_bcis->length() > 0) {
|
||||
// add subtable header
|
||||
add_entry(HandlerTableEntry(handler_bcis->length(), catch_pco, 0));
|
||||
// add individual entries
|
||||
for (int i = 0; i < handler_bcis->length(); i++) {
|
||||
intptr_t scope_depth = 0;
|
||||
if (scope_depths_from_top_scope != NULL) {
|
||||
if (scope_depths_from_top_scope != nullptr) {
|
||||
scope_depth = scope_depths_from_top_scope->at(i);
|
||||
}
|
||||
add_entry(HandlerTableEntry(handler_bcis->at(i), handler_pcos->at(i), scope_depth));
|
||||
@ -109,20 +109,20 @@ void ExceptionHandlerTable::copy_bytes_to(address addr) {
|
||||
|
||||
HandlerTableEntry* ExceptionHandlerTable::entry_for(int catch_pco, int handler_bci, int scope_depth) const {
|
||||
HandlerTableEntry* t = subtable_for(catch_pco);
|
||||
if (t != NULL) {
|
||||
if (t != nullptr) {
|
||||
int l = t->len();
|
||||
while (l-- > 0) {
|
||||
t++;
|
||||
if (t->bci() == handler_bci && t->scope_depth() == scope_depth) return t;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
void ExceptionHandlerTable::print_subtable(HandlerTableEntry* t, address base) const {
|
||||
int l = t->len();
|
||||
bool have_base_addr = (base != NULL);
|
||||
bool have_base_addr = (base != nullptr);
|
||||
if (have_base_addr) {
|
||||
tty->print_cr("catch_pco = %d (pc=" INTPTR_FORMAT ", %d entries)", t->pco(), p2i(base + t->pco()), l);
|
||||
} else {
|
||||
@ -154,7 +154,7 @@ void ExceptionHandlerTable::print(address base) const {
|
||||
void ExceptionHandlerTable::print_subtable_for(int catch_pco) const {
|
||||
HandlerTableEntry* subtable = subtable_for(catch_pco);
|
||||
|
||||
if( subtable != NULL ) { print_subtable( subtable ); }
|
||||
if( subtable != nullptr ) { print_subtable( subtable ); }
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -218,7 +218,7 @@ void ImplicitExceptionTable::print(address base) const {
|
||||
ImplicitExceptionTable::ImplicitExceptionTable(const CompiledMethod* nm) {
|
||||
if (nm->nul_chk_table_size() == 0) {
|
||||
_len = 0;
|
||||
_data = NULL;
|
||||
_data = nullptr;
|
||||
} else {
|
||||
// the first word is the length if non-zero, so read it out and
|
||||
// skip to the next word to get the table.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -123,8 +123,8 @@ class ExceptionHandlerTable {
|
||||
HandlerTableEntry* entry_for(int catch_pco, int handler_bci, int scope_depth) const;
|
||||
|
||||
// debugging
|
||||
void print_subtable(HandlerTableEntry* t, address base = NULL) const;
|
||||
void print(address base = NULL) const;
|
||||
void print_subtable(HandlerTableEntry* t, address base = nullptr) const;
|
||||
void print(address base = nullptr) const;
|
||||
void print_subtable_for(int catch_pco) const;
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -42,9 +42,9 @@
|
||||
|
||||
DEF_STUB_INTERFACE(ICStub);
|
||||
|
||||
StubQueue* InlineCacheBuffer::_buffer = NULL;
|
||||
StubQueue* InlineCacheBuffer::_buffer = nullptr;
|
||||
|
||||
CompiledICHolder* InlineCacheBuffer::_pending_released = NULL;
|
||||
CompiledICHolder* InlineCacheBuffer::_pending_released = nullptr;
|
||||
int InlineCacheBuffer::_pending_count = 0;
|
||||
|
||||
#ifdef ASSERT
|
||||
@ -53,30 +53,30 @@ ICRefillVerifier::ICRefillVerifier()
|
||||
_refill_remembered(false)
|
||||
{
|
||||
Thread* thread = Thread::current();
|
||||
assert(thread->missed_ic_stub_refill_verifier() == NULL, "nesting not supported");
|
||||
assert(thread->missed_ic_stub_refill_verifier() == nullptr, "nesting not supported");
|
||||
thread->set_missed_ic_stub_refill_verifier(this);
|
||||
}
|
||||
|
||||
ICRefillVerifier::~ICRefillVerifier() {
|
||||
assert(!_refill_requested || _refill_remembered,
|
||||
"Forgot to refill IC stubs after failed IC transition");
|
||||
Thread::current()->set_missed_ic_stub_refill_verifier(NULL);
|
||||
Thread::current()->set_missed_ic_stub_refill_verifier(nullptr);
|
||||
}
|
||||
|
||||
ICRefillVerifierMark::ICRefillVerifierMark(ICRefillVerifier* verifier) {
|
||||
Thread* thread = Thread::current();
|
||||
assert(thread->missed_ic_stub_refill_verifier() == NULL, "nesting not supported");
|
||||
assert(thread->missed_ic_stub_refill_verifier() == nullptr, "nesting not supported");
|
||||
thread->set_missed_ic_stub_refill_verifier(verifier);
|
||||
}
|
||||
|
||||
ICRefillVerifierMark::~ICRefillVerifierMark() {
|
||||
Thread::current()->set_missed_ic_stub_refill_verifier(NULL);
|
||||
Thread::current()->set_missed_ic_stub_refill_verifier(nullptr);
|
||||
}
|
||||
|
||||
static ICRefillVerifier* current_ic_refill_verifier() {
|
||||
Thread* current = Thread::current();
|
||||
ICRefillVerifier* verifier = current->missed_ic_stub_refill_verifier();
|
||||
assert(verifier != NULL, "need a verifier for safety");
|
||||
assert(verifier != nullptr, "need a verifier for safety");
|
||||
return verifier;
|
||||
}
|
||||
#endif
|
||||
@ -85,7 +85,7 @@ void ICStub::finalize() {
|
||||
if (!is_empty()) {
|
||||
ResourceMark rm;
|
||||
CompiledIC *ic = CompiledIC_at(CodeCache::find_compiled(ic_site()), ic_site());
|
||||
assert(CodeCache::find_compiled(ic->instruction_address()) != NULL, "inline cache in non-compiled?");
|
||||
assert(CodeCache::find_compiled(ic->instruction_address()) != nullptr, "inline cache in non-compiled?");
|
||||
|
||||
assert(this == ICStub_from_destination_address(ic->stub_address()), "wrong owner of ic buffer");
|
||||
ic->set_ic_destination_and_value(destination(), cached_value());
|
||||
@ -119,7 +119,7 @@ void ICStub::clear() {
|
||||
if (CompiledIC::is_icholder_entry(destination())) {
|
||||
InlineCacheBuffer::queue_for_release((CompiledICHolder*)cached_value());
|
||||
}
|
||||
_ic_site = NULL;
|
||||
_ic_site = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -139,9 +139,9 @@ void ICStub::print() {
|
||||
|
||||
|
||||
void InlineCacheBuffer::initialize() {
|
||||
if (_buffer != NULL) return; // already initialized
|
||||
if (_buffer != nullptr) return; // already initialized
|
||||
_buffer = new StubQueue(new ICStubInterface, 10*K, InlineCacheBuffer_lock, "InlineCacheBuffer");
|
||||
assert (_buffer != NULL, "cannot allocate InlineCacheBuffer");
|
||||
assert (_buffer != nullptr, "cannot allocate InlineCacheBuffer");
|
||||
}
|
||||
|
||||
|
||||
@ -196,7 +196,7 @@ bool InlineCacheBuffer::create_transition_stub(CompiledIC *ic, void* cached_valu
|
||||
|
||||
// allocate and initialize new "out-of-line" inline-cache
|
||||
ICStub* ic_stub = new_ic_stub();
|
||||
if (ic_stub == NULL) {
|
||||
if (ic_stub == nullptr) {
|
||||
#ifdef ASSERT
|
||||
ICRefillVerifier* verifier = current_ic_refill_verifier();
|
||||
verifier->request_refill();
|
||||
@ -234,8 +234,8 @@ void* InlineCacheBuffer::cached_value_for(CompiledIC *ic) {
|
||||
void InlineCacheBuffer::release_pending_icholders() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "should only be called during a safepoint");
|
||||
CompiledICHolder* holder = _pending_released;
|
||||
_pending_released = NULL;
|
||||
while (holder != NULL) {
|
||||
_pending_released = nullptr;
|
||||
while (holder != nullptr) {
|
||||
CompiledICHolder* next = holder->next();
|
||||
delete holder;
|
||||
holder = next;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -56,7 +56,7 @@ class ICStub: public Stub {
|
||||
protected:
|
||||
friend class ICStubInterface;
|
||||
// This will be called only by ICStubInterface
|
||||
void initialize(int size) { _size = size; _ic_site = NULL; }
|
||||
void initialize(int size) { _size = size; _ic_site = nullptr; }
|
||||
void finalize(); // called when a method is removed
|
||||
|
||||
// General info
|
||||
@ -77,7 +77,7 @@ class ICStub: public Stub {
|
||||
// Call site info
|
||||
address ic_site() const { return _ic_site; }
|
||||
void clear();
|
||||
bool is_empty() const { return _ic_site == NULL; }
|
||||
bool is_empty() const { return _ic_site == nullptr; }
|
||||
|
||||
// stub info
|
||||
address destination() const; // destination of jump instruction
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -101,7 +101,7 @@ class nmethod : public CompiledMethod {
|
||||
//
|
||||
// _oops_do_mark_link special values:
|
||||
//
|
||||
// _oops_do_mark_link == NULL: the nmethod has not been visited at all yet, i.e.
|
||||
// _oops_do_mark_link == nullptr: the nmethod has not been visited at all yet, i.e.
|
||||
// is Unclaimed.
|
||||
//
|
||||
// For other values, its lowest two bits indicate the following states of the nmethod:
|
||||
@ -173,7 +173,7 @@ class nmethod : public CompiledMethod {
|
||||
|
||||
// Attempt Unclaimed -> N|SD transition. Returns the current link.
|
||||
oops_do_mark_link* oops_do_try_claim_strong_done();
|
||||
// Attempt N|WR -> X|WD transition. Returns NULL if successful, X otherwise.
|
||||
// Attempt N|WR -> X|WD transition. Returns nullptr if successful, X otherwise.
|
||||
nmethod* oops_do_try_add_to_list_as_weak_done();
|
||||
|
||||
// Attempt X|WD -> N|SR transition. Returns the current link.
|
||||
@ -343,11 +343,11 @@ class nmethod : public CompiledMethod {
|
||||
AbstractCompiler* compiler,
|
||||
CompLevel comp_level
|
||||
#if INCLUDE_JVMCI
|
||||
, char* speculations = NULL,
|
||||
, char* speculations = nullptr,
|
||||
int speculations_len = 0,
|
||||
int nmethod_mirror_index = -1,
|
||||
const char* nmethod_mirror_name = NULL,
|
||||
FailedSpeculation** failed_speculations = NULL
|
||||
const char* nmethod_mirror_name = nullptr,
|
||||
FailedSpeculation** failed_speculations = nullptr
|
||||
#endif
|
||||
);
|
||||
|
||||
@ -380,7 +380,7 @@ class nmethod : public CompiledMethod {
|
||||
address stub_begin () const { return header_begin() + _stub_offset ; }
|
||||
address stub_end () const { return header_begin() + _oops_offset ; }
|
||||
address exception_begin () const { return header_begin() + _exception_offset ; }
|
||||
address unwind_handler_begin () const { return _unwind_handler_offset != -1 ? (header_begin() + _unwind_handler_offset) : NULL; }
|
||||
address unwind_handler_begin () const { return _unwind_handler_offset != -1 ? (header_begin() + _unwind_handler_offset) : nullptr; }
|
||||
oop* oops_begin () const { return (oop*) (header_begin() + _oops_offset) ; }
|
||||
oop* oops_end () const { return (oop*) (header_begin() + _metadata_offset) ; }
|
||||
|
||||
@ -491,7 +491,7 @@ class nmethod : public CompiledMethod {
|
||||
|
||||
// Support for meta data in scopes and relocs:
|
||||
// Note: index 0 is reserved for null.
|
||||
Metadata* metadata_at(int index) const { return index == 0 ? NULL: *metadata_addr_at(index); }
|
||||
Metadata* metadata_at(int index) const { return index == 0 ? nullptr: *metadata_addr_at(index); }
|
||||
Metadata** metadata_addr_at(int index) const { // for GC
|
||||
// relocation indexes are biased by 1 (because 0 is reserved)
|
||||
assert(index > 0 && index <= metadata_count(), "must be a valid non-zero index");
|
||||
@ -508,7 +508,7 @@ private:
|
||||
|
||||
public:
|
||||
void fix_oop_relocations(address begin, address end) { fix_oop_relocations(begin, end, false); }
|
||||
void fix_oop_relocations() { fix_oop_relocations(NULL, NULL, false); }
|
||||
void fix_oop_relocations() { fix_oop_relocations(nullptr, nullptr, false); }
|
||||
|
||||
// On-stack replacement support
|
||||
int osr_entry_bci() const { assert(is_osr_method(), "wrong kind of nmethod"); return _entry_bci; }
|
||||
@ -542,10 +542,10 @@ public:
|
||||
void update_speculation(JavaThread* thread);
|
||||
|
||||
// Gets the data specific to a JVMCI compiled method.
|
||||
// This returns a non-NULL value iff this nmethod was
|
||||
// This returns a non-nullptr value iff this nmethod was
|
||||
// compiled by the JVMCI compiler.
|
||||
JVMCINMethodData* jvmci_nmethod_data() const {
|
||||
return jvmci_data_size() == 0 ? NULL : (JVMCINMethodData*) jvmci_data_begin();
|
||||
return jvmci_data_size() == 0 ? nullptr : (JVMCINMethodData*) jvmci_data_begin();
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -601,7 +601,7 @@ public:
|
||||
void post_compiled_method(CompileTask* task);
|
||||
|
||||
// jvmti support:
|
||||
void post_compiled_method_load_event(JvmtiThreadState* state = NULL);
|
||||
void post_compiled_method_load_event(JvmtiThreadState* state = nullptr);
|
||||
|
||||
// verify operations
|
||||
void verify();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -41,8 +41,8 @@ template <class T> int ValueRecorder<T>::_missed_indexes = 0;
|
||||
|
||||
|
||||
template <class T> ValueRecorder<T>::ValueRecorder(Arena* arena) {
|
||||
_handles = NULL;
|
||||
_indexes = NULL;
|
||||
_handles = nullptr;
|
||||
_indexes = nullptr;
|
||||
_arena = arena;
|
||||
_complete = false;
|
||||
}
|
||||
@ -54,7 +54,7 @@ template <class T> template <class X> ValueRecorder<T>::IndexCache<X>::IndexCac
|
||||
|
||||
template <class T> int ValueRecorder<T>::size() {
|
||||
_complete = true;
|
||||
if (_handles == NULL) return 0;
|
||||
if (_handles == nullptr) return 0;
|
||||
return _handles->length() * sizeof(T);
|
||||
}
|
||||
|
||||
@ -65,8 +65,8 @@ template <class T> void ValueRecorder<T>::copy_values_to(nmethod* nm) {
|
||||
}
|
||||
|
||||
template <class T> void ValueRecorder<T>::maybe_initialize() {
|
||||
if (_handles == NULL) {
|
||||
if (_arena != NULL) {
|
||||
if (_handles == nullptr) {
|
||||
if (_arena != nullptr) {
|
||||
_handles = new(_arena) GrowableArray<T>(_arena, 10, 0, 0);
|
||||
_no_finds = new(_arena) GrowableArray<int>( _arena, 10, 0, 0);
|
||||
} else {
|
||||
@ -78,8 +78,8 @@ template <class T> void ValueRecorder<T>::maybe_initialize() {
|
||||
|
||||
|
||||
template <class T> T ValueRecorder<T>::at(int index) {
|
||||
// there is always a NULL virtually present as first object
|
||||
if (index == null_index) return NULL;
|
||||
// there is always a nullptr virtually present as first object
|
||||
if (index == null_index) return nullptr;
|
||||
return _handles->at(index - first_index);
|
||||
}
|
||||
|
||||
@ -95,10 +95,10 @@ template <class T> int ValueRecorder<T>::add_handle(T h, bool make_findable) {
|
||||
assert(!(make_findable && !is_real(h)), "nulls are not findable");
|
||||
if (make_findable) {
|
||||
// This index may be returned from find_index().
|
||||
if (_indexes != NULL) {
|
||||
if (_indexes != nullptr) {
|
||||
int* cloc = _indexes->cache_location(h);
|
||||
_indexes->set_cache_location_index(cloc, index);
|
||||
} else if (index == index_cache_threshold && _arena != NULL) {
|
||||
} else if (index == index_cache_threshold && _arena != nullptr) {
|
||||
_indexes = new(_arena) IndexCache<T>();
|
||||
for (int i = 0; i < _handles->length(); i++) {
|
||||
// Load the cache with pre-existing elements.
|
||||
@ -111,7 +111,7 @@ template <class T> int ValueRecorder<T>::add_handle(T h, bool make_findable) {
|
||||
} else if (is_real(h)) {
|
||||
// Remember that this index is not to be returned from find_index().
|
||||
// This case is rare, because most or all uses of allocate_index pass
|
||||
// an argument of NULL or Universe::non_oop_word.
|
||||
// an argument of nullptr or Universe::non_oop_word.
|
||||
// Thus, the expected length of _no_finds is zero.
|
||||
_no_finds->append(index);
|
||||
}
|
||||
@ -124,10 +124,10 @@ template <class T> int ValueRecorder<T>::maybe_find_index(T h) {
|
||||
debug_only(_find_index_calls++);
|
||||
assert(!_complete, "cannot allocate more elements after size query");
|
||||
maybe_initialize();
|
||||
if (h == NULL) return null_index;
|
||||
if (h == nullptr) return null_index;
|
||||
assert(is_real(h), "must be valid");
|
||||
int* cloc = (_indexes == NULL)? NULL: _indexes->cache_location(h);
|
||||
if (cloc != NULL) {
|
||||
int* cloc = (_indexes == nullptr)? nullptr: _indexes->cache_location(h);
|
||||
if (cloc != nullptr) {
|
||||
int cindex = _indexes->cache_location_index(cloc);
|
||||
if (cindex == 0) {
|
||||
return -1; // We know this handle is completely new.
|
||||
@ -147,7 +147,7 @@ template <class T> int ValueRecorder<T>::maybe_find_index(T h) {
|
||||
if (_handles->at(i) == h) {
|
||||
int findex = i + first_index;
|
||||
if (_no_finds->contains(findex)) continue; // oops; skip this one
|
||||
if (cloc != NULL) {
|
||||
if (cloc != nullptr) {
|
||||
_indexes->set_cache_location_index(cloc, findex);
|
||||
}
|
||||
debug_only(_missed_indexes++);
|
||||
@ -188,7 +188,7 @@ int ObjectLookup::sort_oop_by_address(oop const& a, ObjectEntry const& b) {
|
||||
}
|
||||
|
||||
int ObjectLookup::find_index(jobject handle, OopRecorder* oop_recorder) {
|
||||
if (handle == NULL) {
|
||||
if (handle == nullptr) {
|
||||
return 0;
|
||||
}
|
||||
oop object = JNIHandles::resolve(handle);
|
||||
@ -208,6 +208,6 @@ OopRecorder::OopRecorder(Arena* arena, bool deduplicate): _oops(arena), _metadat
|
||||
if (deduplicate) {
|
||||
_object_lookup = new ObjectLookup();
|
||||
} else {
|
||||
_object_lookup = NULL;
|
||||
_object_lookup = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -38,9 +38,9 @@ template <class T> class ValueRecorder : public StackObj {
|
||||
// The zero index is reserved for a constant (shareable) null.
|
||||
// Indexes may not be negative.
|
||||
|
||||
// Use the given arena to manage storage, if not NULL.
|
||||
// Use the given arena to manage storage, if not nullptr.
|
||||
// By default, uses the current ResourceArea.
|
||||
ValueRecorder(Arena* arena = NULL);
|
||||
ValueRecorder(Arena* arena = nullptr);
|
||||
|
||||
// Generate a new index on which nmethod::oop_addr_at will work.
|
||||
// allocate_index and find_index never return the same index,
|
||||
@ -70,18 +70,18 @@ template <class T> class ValueRecorder : public StackObj {
|
||||
T at(int index);
|
||||
|
||||
int count() {
|
||||
if (_handles == NULL) return 0;
|
||||
// there is always a NULL virtually present as first object
|
||||
if (_handles == nullptr) return 0;
|
||||
// there is always a nullptr virtually present as first object
|
||||
return _handles->length() + first_index;
|
||||
}
|
||||
|
||||
// Helper function; returns false for NULL or Universe::non_oop_word().
|
||||
// Helper function; returns false for nullptr or Universe::non_oop_word().
|
||||
inline bool is_real(T h);
|
||||
|
||||
// copy the generated table to nmethod
|
||||
void copy_values_to(nmethod* nm);
|
||||
|
||||
bool is_unused() { return _handles == NULL && !_complete; }
|
||||
bool is_unused() { return _handles == nullptr && !_complete; }
|
||||
#ifdef ASSERT
|
||||
bool is_complete() { return _complete; }
|
||||
#endif
|
||||
@ -132,7 +132,7 @@ template <class T> class ValueRecorder : public StackObj {
|
||||
|
||||
enum { null_index = 0, first_index = 1, index_cache_threshold = 20 };
|
||||
|
||||
GrowableArray<T>* _handles; // ordered list (first is always NULL)
|
||||
GrowableArray<T>* _handles; // ordered list (first is always nullptr)
|
||||
GrowableArray<int>* _no_finds; // all unfindable indexes; usually empty
|
||||
IndexCache<T>* _indexes; // map: handle -> its probable index
|
||||
Arena* _arena;
|
||||
@ -154,7 +154,7 @@ class ObjectLookup : public ResourceObj {
|
||||
|
||||
public:
|
||||
ObjectEntry(jobject value, int index) : _value(value), _index(index) {}
|
||||
ObjectEntry() : _value(NULL), _index(0) {}
|
||||
ObjectEntry() : _value(nullptr), _index(0) {}
|
||||
oop oop_value() const;
|
||||
int index() { return _index; }
|
||||
};
|
||||
@ -181,13 +181,13 @@ class OopRecorder : public ResourceObj {
|
||||
ValueRecorder<Metadata*> _metadata;
|
||||
ObjectLookup* _object_lookup;
|
||||
public:
|
||||
OopRecorder(Arena* arena = NULL, bool deduplicate = false);
|
||||
OopRecorder(Arena* arena = nullptr, bool deduplicate = false);
|
||||
|
||||
int allocate_oop_index(jobject h) {
|
||||
return _oops.allocate_index(h);
|
||||
}
|
||||
virtual int find_index(jobject h) {
|
||||
return _object_lookup != NULL ? _object_lookup->find_index(h, this) : _oops.find_index(h);
|
||||
return _object_lookup != nullptr ? _object_lookup->find_index(h, this) : _oops.find_index(h);
|
||||
}
|
||||
jobject oop_at(int index) {
|
||||
return _oops.at(index);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
template <class T>
|
||||
bool ValueRecorder<T>::is_real(T h) {
|
||||
return h != NULL && h != (T)Universe::non_oop_word();
|
||||
return h != nullptr && h != (T)Universe::non_oop_word();
|
||||
}
|
||||
|
||||
bool OopRecorder::is_real(jobject h) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -50,7 +50,7 @@ void PcDesc::print_on(outputStream* st, CompiledMethod* code) {
|
||||
}
|
||||
|
||||
for (ScopeDesc* sd = code->scope_desc_at(real_pc(code));
|
||||
sd != NULL;
|
||||
sd != nullptr;
|
||||
sd = sd->sender()) {
|
||||
sd->print_on(st);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -119,12 +119,12 @@ void relocInfo::change_reloc_info_for_address(RelocIterator *itr, address pc, re
|
||||
void RelocIterator::initialize(CompiledMethod* nm, address begin, address limit) {
|
||||
initialize_misc();
|
||||
|
||||
if (nm == NULL && begin != NULL) {
|
||||
if (nm == nullptr && begin != nullptr) {
|
||||
// allow nmethod to be deduced from beginning address
|
||||
CodeBlob* cb = CodeCache::find_blob(begin);
|
||||
nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
|
||||
nm = (cb != nullptr) ? cb->as_compiled_method_or_null() : nullptr;
|
||||
}
|
||||
guarantee(nm != NULL, "must be able to deduce nmethod from other arguments");
|
||||
guarantee(nm != nullptr, "must be able to deduce nmethod from other arguments");
|
||||
|
||||
_code = nm;
|
||||
_current = nm->relocation_begin() - 1;
|
||||
@ -141,8 +141,8 @@ void RelocIterator::initialize(CompiledMethod* nm, address begin, address limit)
|
||||
_section_end [CodeBuffer::SECT_STUBS ] = nm->stub_end() ;
|
||||
|
||||
assert(!has_current(), "just checking");
|
||||
assert(begin == NULL || begin >= nm->code_begin(), "in bounds");
|
||||
assert(limit == NULL || limit <= nm->code_end(), "in bounds");
|
||||
assert(begin == nullptr || begin >= nm->code_begin(), "in bounds");
|
||||
assert(limit == nullptr || limit <= nm->code_end(), "in bounds");
|
||||
set_limits(begin, limit);
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ RelocIterator::RelocIterator(CodeSection* cs, address begin, address limit) {
|
||||
_current = cs->locs_start()-1;
|
||||
_end = cs->locs_end();
|
||||
_addr = cs->start();
|
||||
_code = NULL; // Not cb->blob();
|
||||
_code = nullptr; // Not cb->blob();
|
||||
|
||||
CodeBuffer* cb = cs->outer();
|
||||
assert((int) SECT_LIMIT == CodeBuffer::SECT_LIMIT, "my copy must be equal");
|
||||
@ -165,8 +165,8 @@ RelocIterator::RelocIterator(CodeSection* cs, address begin, address limit) {
|
||||
|
||||
assert(!has_current(), "just checking");
|
||||
|
||||
assert(begin == NULL || begin >= cs->start(), "in bounds");
|
||||
assert(limit == NULL || limit <= cs->end(), "in bounds");
|
||||
assert(begin == nullptr || begin >= cs->start(), "in bounds");
|
||||
assert(limit == nullptr || limit <= cs->end(), "in bounds");
|
||||
set_limits(begin, limit);
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ void RelocIterator::set_limits(address begin, address limit) {
|
||||
_limit = limit;
|
||||
|
||||
// the limit affects this next stuff:
|
||||
if (begin != NULL) {
|
||||
if (begin != nullptr) {
|
||||
relocInfo* backup;
|
||||
address backup_addr;
|
||||
while (true) {
|
||||
@ -221,8 +221,8 @@ void RelocIterator::advance_over_prefix() {
|
||||
void RelocIterator::initialize_misc() {
|
||||
set_has_current(false);
|
||||
for (int i = (int) CodeBuffer::SECT_FIRST; i < (int) CodeBuffer::SECT_LIMIT; i++) {
|
||||
_section_start[i] = NULL; // these will be lazily computed, if needed
|
||||
_section_end [i] = NULL;
|
||||
_section_start[i] = nullptr; // these will be lazily computed, if needed
|
||||
_section_end [i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ RelocationHolder RelocationHolder::plus(int offset) const {
|
||||
// some relocations can compute their own values
|
||||
address Relocation::value() {
|
||||
ShouldNotReachHere();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -361,7 +361,7 @@ address Relocation::new_addr_for(address olda,
|
||||
int sect = CodeBuffer::SECT_NONE;
|
||||
// Look for olda in the source buffer, and all previous incarnations
|
||||
// if the source buffer has been expanded.
|
||||
for (; src != NULL; src = src->before_expand()) {
|
||||
for (; src != nullptr; src = src->before_expand()) {
|
||||
sect = src->section_index_of(olda);
|
||||
if (sect != CodeBuffer::SECT_NONE) break;
|
||||
}
|
||||
@ -373,7 +373,7 @@ address Relocation::new_addr_for(address olda,
|
||||
|
||||
void Relocation::normalize_address(address& addr, const CodeSection* dest, bool allow_other_sections) {
|
||||
address addr0 = addr;
|
||||
if (addr0 == NULL || dest->allocates2(addr0)) return;
|
||||
if (addr0 == nullptr || dest->allocates2(addr0)) return;
|
||||
CodeBuffer* cb = dest->outer();
|
||||
addr = new_addr_for(addr0, cb, cb);
|
||||
assert(allow_other_sections || dest->contains2(addr),
|
||||
@ -436,7 +436,7 @@ void virtual_call_Relocation::unpack_data() {
|
||||
jint x0 = 0;
|
||||
unpack_2_ints(x0, _method_index);
|
||||
address point = addr();
|
||||
_cached_value = x0==0? NULL: address_from_scaled_offset(x0, point);
|
||||
_cached_value = x0==0? nullptr: address_from_scaled_offset(x0, point);
|
||||
}
|
||||
|
||||
void runtime_call_w_cp_Relocation::pack_data_to(CodeSection * dest) {
|
||||
@ -508,7 +508,7 @@ void internal_word_Relocation::pack_data_to(CodeSection* dest) {
|
||||
// Check whether my target address is valid within this section.
|
||||
// If not, strengthen the relocation type to point to another section.
|
||||
int sindex = _section;
|
||||
if (sindex == CodeBuffer::SECT_NONE && _target != NULL
|
||||
if (sindex == CodeBuffer::SECT_NONE && _target != nullptr
|
||||
&& (!dest->allocates(_target) || _target == dest->locs_point())) {
|
||||
sindex = dest->outer()->section_index_of(_target);
|
||||
guarantee(sindex != CodeBuffer::SECT_NONE, "must belong somewhere");
|
||||
@ -524,12 +524,12 @@ void internal_word_Relocation::pack_data_to(CodeSection* dest) {
|
||||
|
||||
if (sindex == CodeBuffer::SECT_NONE) {
|
||||
assert(type() == relocInfo::internal_word_type, "must be base class");
|
||||
guarantee(_target == NULL || dest->allocates2(_target), "must be within the given code section");
|
||||
guarantee(_target == nullptr || dest->allocates2(_target), "must be within the given code section");
|
||||
jint x0 = scaled_offset_null_special(_target, dest->locs_point());
|
||||
assert(!(x0 == 0 && _target != NULL), "correct encoding of null target");
|
||||
assert(!(x0 == 0 && _target != nullptr), "correct encoding of null target");
|
||||
p = pack_1_int_to(p, x0);
|
||||
} else {
|
||||
assert(_target != NULL, "sanity");
|
||||
assert(_target != nullptr, "sanity");
|
||||
CodeSection* sect = dest->outer()->code_section(sindex);
|
||||
guarantee(sect->allocates2(_target), "must be in correct section");
|
||||
address base = sect->start();
|
||||
@ -545,7 +545,7 @@ void internal_word_Relocation::pack_data_to(CodeSection* dest) {
|
||||
|
||||
void internal_word_Relocation::unpack_data() {
|
||||
jint x0 = unpack_1_int();
|
||||
_target = x0==0? NULL: address_from_scaled_offset(x0, addr());
|
||||
_target = x0==0? nullptr: address_from_scaled_offset(x0, addr());
|
||||
_section = CodeBuffer::SECT_NONE;
|
||||
}
|
||||
|
||||
@ -576,7 +576,7 @@ oop* oop_Relocation::oop_addr() {
|
||||
oop oop_Relocation::oop_value() {
|
||||
// clean inline caches store a special pseudo-null
|
||||
if (Universe::contains_non_oop_word(oop_addr())) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
return *oop_addr();
|
||||
}
|
||||
@ -613,7 +613,7 @@ Metadata** metadata_Relocation::metadata_addr() {
|
||||
Metadata* metadata_Relocation::metadata_value() {
|
||||
Metadata* v = *metadata_addr();
|
||||
// clean inline caches store a special pseudo-null
|
||||
if (v == (Metadata*)Universe::non_oop_word()) v = NULL;
|
||||
if (v == (Metadata*)Universe::non_oop_word()) v = nullptr;
|
||||
return v;
|
||||
}
|
||||
|
||||
@ -626,16 +626,16 @@ void metadata_Relocation::fix_metadata_relocation() {
|
||||
}
|
||||
|
||||
address virtual_call_Relocation::cached_value() {
|
||||
assert(_cached_value != NULL && _cached_value < addr(), "must precede ic_call");
|
||||
assert(_cached_value != nullptr && _cached_value < addr(), "must precede ic_call");
|
||||
return _cached_value;
|
||||
}
|
||||
|
||||
Method* virtual_call_Relocation::method_value() {
|
||||
CompiledMethod* cm = code();
|
||||
if (cm == NULL) return (Method*)NULL;
|
||||
if (cm == nullptr) return (Method*)nullptr;
|
||||
Metadata* m = cm->metadata_at(_method_index);
|
||||
assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
|
||||
assert(m == NULL || m->is_method(), "not a method");
|
||||
assert(m != nullptr || _method_index == 0, "should be non-null for non-zero index");
|
||||
assert(m == nullptr || m->is_method(), "not a method");
|
||||
return (Method*)m;
|
||||
}
|
||||
|
||||
@ -660,10 +660,10 @@ void opt_virtual_call_Relocation::unpack_data() {
|
||||
|
||||
Method* opt_virtual_call_Relocation::method_value() {
|
||||
CompiledMethod* cm = code();
|
||||
if (cm == NULL) return (Method*)NULL;
|
||||
if (cm == nullptr) return (Method*)nullptr;
|
||||
Metadata* m = cm->metadata_at(_method_index);
|
||||
assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
|
||||
assert(m == NULL || m->is_method(), "not a method");
|
||||
assert(m != nullptr || _method_index == 0, "should be non-null for non-zero index");
|
||||
assert(m == nullptr || m->is_method(), "not a method");
|
||||
return (Method*)m;
|
||||
}
|
||||
|
||||
@ -693,15 +693,15 @@ address opt_virtual_call_Relocation::static_stub() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Method* static_call_Relocation::method_value() {
|
||||
CompiledMethod* cm = code();
|
||||
if (cm == NULL) return (Method*)NULL;
|
||||
if (cm == nullptr) return (Method*)nullptr;
|
||||
Metadata* m = cm->metadata_at(_method_index);
|
||||
assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
|
||||
assert(m == NULL || m->is_method(), "not a method");
|
||||
assert(m != nullptr || _method_index == 0, "should be non-null for non-zero index");
|
||||
assert(m == nullptr || m->is_method(), "not a method");
|
||||
return (Method*)m;
|
||||
}
|
||||
|
||||
@ -734,16 +734,16 @@ address static_call_Relocation::static_stub() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Finds the trampoline address for a call. If no trampoline stub is
|
||||
// found NULL is returned which can be handled by the caller.
|
||||
// found nullptr is returned which can be handled by the caller.
|
||||
address trampoline_stub_Relocation::get_trampoline_for(address call, nmethod* code) {
|
||||
// There are no relocations available when the code gets relocated
|
||||
// because of CodeBuffer expansion.
|
||||
if (code->relocation_size() == 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
RelocIterator iter(code, call);
|
||||
while (iter.next()) {
|
||||
@ -754,7 +754,7 @@ address trampoline_stub_Relocation::get_trampoline_for(address call, nmethod* co
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool static_stub_Relocation::clear_inline_cache() {
|
||||
@ -766,12 +766,12 @@ bool static_stub_Relocation::clear_inline_cache() {
|
||||
|
||||
|
||||
void external_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
|
||||
if (_target != NULL) {
|
||||
if (_target != nullptr) {
|
||||
// Probably this reference is absolute, not relative, so the following is
|
||||
// probably a no-op.
|
||||
set_value(_target);
|
||||
}
|
||||
// If target is NULL, this is an absolute embedded reference to an external
|
||||
// If target is nullptr, this is an absolute embedded reference to an external
|
||||
// location, which means there is nothing to fix here. In either case, the
|
||||
// resulting target should be an "external" address.
|
||||
postcond(src->section_index_of(target()) == CodeBuffer::SECT_NONE);
|
||||
@ -781,7 +781,7 @@ void external_word_Relocation::fix_relocation_after_move(const CodeBuffer* src,
|
||||
|
||||
address external_word_Relocation::target() {
|
||||
address target = _target;
|
||||
if (target == NULL) {
|
||||
if (target == nullptr) {
|
||||
target = pd_get_address_from_code();
|
||||
}
|
||||
return target;
|
||||
@ -790,7 +790,7 @@ address external_word_Relocation::target() {
|
||||
|
||||
void internal_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
|
||||
address target = _target;
|
||||
if (target == NULL) {
|
||||
if (target == nullptr) {
|
||||
target = new_addr_for(this->target(), src, dest);
|
||||
}
|
||||
set_value(target);
|
||||
@ -799,7 +799,7 @@ void internal_word_Relocation::fix_relocation_after_move(const CodeBuffer* src,
|
||||
|
||||
address internal_word_Relocation::target() {
|
||||
address target = _target;
|
||||
if (target == NULL) {
|
||||
if (target == nullptr) {
|
||||
if (addr_in_const()) {
|
||||
target = *(address*)addr();
|
||||
} else {
|
||||
@ -856,10 +856,10 @@ void RelocIterator::print_current() {
|
||||
case relocInfo::oop_type:
|
||||
{
|
||||
oop_Relocation* r = oop_reloc();
|
||||
oop* oop_addr = NULL;
|
||||
oop raw_oop = NULL;
|
||||
oop oop_value = NULL;
|
||||
if (code() != NULL || r->oop_is_immediate()) {
|
||||
oop* oop_addr = nullptr;
|
||||
oop raw_oop = nullptr;
|
||||
oop oop_value = nullptr;
|
||||
if (code() != nullptr || r->oop_is_immediate()) {
|
||||
oop_addr = r->oop_addr();
|
||||
raw_oop = *oop_addr;
|
||||
oop_value = r->oop_value();
|
||||
@ -868,7 +868,7 @@ void RelocIterator::print_current() {
|
||||
p2i(oop_addr), p2i(raw_oop), r->offset());
|
||||
// Do not print the oop by default--we want this routine to
|
||||
// work even during GC or other inconvenient times.
|
||||
if (WizardMode && oop_value != NULL) {
|
||||
if (WizardMode && oop_value != nullptr) {
|
||||
tty->print("oop_value=" INTPTR_FORMAT ": ", p2i(oop_value));
|
||||
if (oopDesc::is_oop(oop_value)) {
|
||||
oop_value->print_value_on(tty);
|
||||
@ -879,17 +879,17 @@ void RelocIterator::print_current() {
|
||||
case relocInfo::metadata_type:
|
||||
{
|
||||
metadata_Relocation* r = metadata_reloc();
|
||||
Metadata** metadata_addr = NULL;
|
||||
Metadata* raw_metadata = NULL;
|
||||
Metadata* metadata_value = NULL;
|
||||
if (code() != NULL || r->metadata_is_immediate()) {
|
||||
Metadata** metadata_addr = nullptr;
|
||||
Metadata* raw_metadata = nullptr;
|
||||
Metadata* metadata_value = nullptr;
|
||||
if (code() != nullptr || r->metadata_is_immediate()) {
|
||||
metadata_addr = r->metadata_addr();
|
||||
raw_metadata = *metadata_addr;
|
||||
metadata_value = r->metadata_value();
|
||||
}
|
||||
tty->print(" | [metadata_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT " offset=%d]",
|
||||
p2i(metadata_addr), p2i(raw_metadata), r->offset());
|
||||
if (metadata_value != NULL) {
|
||||
if (metadata_value != nullptr) {
|
||||
tty->print("metadata_value=" INTPTR_FORMAT ": ", p2i(metadata_value));
|
||||
metadata_value->print_value_on(tty);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -580,7 +580,7 @@ class RelocIterator : public StackObj {
|
||||
|
||||
void set_has_current(bool b) {
|
||||
_datalen = !b ? -1 : 0;
|
||||
debug_only(_data = NULL);
|
||||
debug_only(_data = nullptr);
|
||||
}
|
||||
void set_current(relocInfo& ri) {
|
||||
_current = &ri;
|
||||
@ -604,8 +604,8 @@ class RelocIterator : public StackObj {
|
||||
|
||||
public:
|
||||
// constructor
|
||||
RelocIterator(CompiledMethod* nm, address begin = NULL, address limit = NULL);
|
||||
RelocIterator(CodeSection* cb, address begin = NULL, address limit = NULL);
|
||||
RelocIterator(CompiledMethod* nm, address begin = nullptr, address limit = nullptr);
|
||||
RelocIterator(CodeSection* cb, address begin = nullptr, address limit = nullptr);
|
||||
|
||||
// get next reloc info, return !eos
|
||||
bool next() {
|
||||
@ -624,7 +624,7 @@ class RelocIterator : public StackObj {
|
||||
|
||||
_addr += _current->addr_offset();
|
||||
|
||||
if (_limit != NULL && _addr >= _limit) {
|
||||
if (_limit != nullptr && _addr >= _limit) {
|
||||
set_has_current(false);
|
||||
return false;
|
||||
}
|
||||
@ -689,16 +689,16 @@ class Relocation {
|
||||
|
||||
protected:
|
||||
RelocIterator* binding() const {
|
||||
assert(_binding != NULL, "must be bound");
|
||||
assert(_binding != nullptr, "must be bound");
|
||||
return _binding;
|
||||
}
|
||||
void set_binding(RelocIterator* b) {
|
||||
assert(_binding == NULL, "must be unbound");
|
||||
assert(_binding == nullptr, "must be unbound");
|
||||
_binding = b;
|
||||
assert(_binding != NULL, "must now be bound");
|
||||
assert(_binding != nullptr, "must now be bound");
|
||||
}
|
||||
|
||||
explicit Relocation(relocInfo::relocType rtype) : _binding(NULL), _rtype(rtype) { }
|
||||
explicit Relocation(relocInfo::relocType rtype) : _binding(nullptr), _rtype(rtype) { }
|
||||
|
||||
// Helper for copy_into functions for derived classes.
|
||||
// Forwards operation to RelocationHolder::copy_into_impl so that
|
||||
@ -788,7 +788,7 @@ class Relocation {
|
||||
// platform-dependent utilities for decoding and patching instructions
|
||||
void pd_set_data_value (address x, intptr_t off, bool verify_only = false); // a set or mem-ref
|
||||
void pd_verify_data_value (address x, intptr_t off) { pd_set_data_value(x, off, true); }
|
||||
address pd_call_destination (address orig_addr = NULL);
|
||||
address pd_call_destination (address orig_addr = nullptr);
|
||||
void pd_set_call_destination (address x);
|
||||
|
||||
// this extracts the address of an address in the code stream instead of the reloc data
|
||||
@ -805,9 +805,9 @@ class Relocation {
|
||||
return offset;
|
||||
}
|
||||
static jint scaled_offset_null_special(address x, address base) {
|
||||
// Some relocations treat offset=0 as meaning NULL.
|
||||
// Some relocations treat offset=0 as meaning nullptr.
|
||||
// Handle this extra convention carefully.
|
||||
if (x == NULL) return 0;
|
||||
if (x == nullptr) return 0;
|
||||
assert(x != base, "offset must not be zero");
|
||||
return scaled_offset(x, base);
|
||||
}
|
||||
@ -1020,7 +1020,7 @@ class oop_Relocation : public DataRelocation {
|
||||
|
||||
oop* oop_addr(); // addr or &pool[jint_data]
|
||||
oop oop_value(); // *oop_addr
|
||||
// Note: oop_value transparently converts Universe::non_oop_word to NULL.
|
||||
// Note: oop_value transparently converts Universe::non_oop_word to nullptr.
|
||||
};
|
||||
|
||||
|
||||
@ -1074,7 +1074,7 @@ class metadata_Relocation : public DataRelocation {
|
||||
|
||||
Metadata** metadata_addr(); // addr or &pool[jint_data]
|
||||
Metadata* metadata_value(); // *metadata_addr
|
||||
// Note: metadata_value transparently converts Universe::non_metadata_word to NULL.
|
||||
// Note: metadata_value transparently converts Universe::non_metadata_word to nullptr.
|
||||
};
|
||||
|
||||
|
||||
@ -1098,7 +1098,7 @@ class virtual_call_Relocation : public CallRelocation {
|
||||
: CallRelocation(relocInfo::virtual_call_type),
|
||||
_cached_value(cached_value),
|
||||
_method_index(method_index) {
|
||||
assert(cached_value != NULL, "first oop address must be specified");
|
||||
assert(cached_value != nullptr, "first oop address must be specified");
|
||||
}
|
||||
|
||||
friend class RelocationHolder;
|
||||
@ -1296,7 +1296,7 @@ class trampoline_stub_Relocation : public Relocation {
|
||||
class external_word_Relocation : public DataRelocation {
|
||||
public:
|
||||
static RelocationHolder spec(address target) {
|
||||
assert(target != NULL, "must not be null");
|
||||
assert(target != nullptr, "must not be null");
|
||||
return RelocationHolder::construct<external_word_Relocation>(target);
|
||||
}
|
||||
|
||||
@ -1311,8 +1311,8 @@ class external_word_Relocation : public DataRelocation {
|
||||
// Some address looking values aren't safe to treat as relocations
|
||||
// and should just be treated as constants.
|
||||
static bool can_be_relocated(address target) {
|
||||
assert(target == NULL || (uintptr_t)target >= (uintptr_t)OSInfo::vm_page_size(), INTPTR_FORMAT, (intptr_t)target);
|
||||
return target != NULL;
|
||||
assert(target == nullptr || (uintptr_t)target >= (uintptr_t)OSInfo::vm_page_size(), INTPTR_FORMAT, (intptr_t)target);
|
||||
return target != nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
@ -1328,13 +1328,13 @@ class external_word_Relocation : public DataRelocation {
|
||||
// data is packed as a well-known address in "1_int" format: [a] or [Aa]
|
||||
// The function runtime_address_to_index is used to turn full addresses
|
||||
// to short indexes, if they are pre-registered by the stub mechanism.
|
||||
// If the "a" value is 0 (i.e., _target is NULL), the address is stored
|
||||
// If the "a" value is 0 (i.e., _target is nullptr), the address is stored
|
||||
// in the code stream. See external_word_Relocation::target().
|
||||
void pack_data_to(CodeSection* dest) override;
|
||||
void unpack_data() override;
|
||||
|
||||
void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) override;
|
||||
address target(); // if _target==NULL, fetch addr from code stream
|
||||
address target(); // if _target==nullptr, fetch addr from code stream
|
||||
address value() override { return target(); }
|
||||
};
|
||||
|
||||
@ -1342,7 +1342,7 @@ class internal_word_Relocation : public DataRelocation {
|
||||
|
||||
public:
|
||||
static RelocationHolder spec(address target) {
|
||||
assert(target != NULL, "must not be null");
|
||||
assert(target != nullptr, "must not be null");
|
||||
return RelocationHolder::construct<internal_word_Relocation>(target);
|
||||
}
|
||||
|
||||
@ -1371,14 +1371,14 @@ class internal_word_Relocation : public DataRelocation {
|
||||
|
||||
public:
|
||||
// data is packed as a scaled offset in "1_int" format: [o] or [Oo]
|
||||
// If the "o" value is 0 (i.e., _target is NULL), the offset is stored
|
||||
// If the "o" value is 0 (i.e., _target is nullptr), the offset is stored
|
||||
// in the code stream. See internal_word_Relocation::target().
|
||||
// If _section is not -1, it is appended to the low bits of the offset.
|
||||
void pack_data_to(CodeSection* dest) override;
|
||||
void unpack_data() override;
|
||||
|
||||
void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) override;
|
||||
address target(); // if _target==NULL, fetch addr from code stream
|
||||
address target(); // if _target==nullptr, fetch addr from code stream
|
||||
int section() { return _section; }
|
||||
address value() override { return target(); }
|
||||
};
|
||||
@ -1393,7 +1393,7 @@ class section_word_Relocation : public internal_word_Relocation {
|
||||
|
||||
section_word_Relocation(address target, int section)
|
||||
: internal_word_Relocation(target, section, relocInfo::section_word_type) {
|
||||
assert(target != NULL, "must not be null");
|
||||
assert(target != nullptr, "must not be null");
|
||||
assert(section >= 0 && section < RelocIterator::SECT_LIMIT, "must be a valid section");
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -94,7 +94,7 @@ void ScopeDesc::decode_body() {
|
||||
|
||||
|
||||
GrowableArray<ScopeValue*>* ScopeDesc::decode_scope_values(int decode_offset) {
|
||||
if (decode_offset == DebugInformationRecorder::serialized_null) return NULL;
|
||||
if (decode_offset == DebugInformationRecorder::serialized_null) return nullptr;
|
||||
DebugInfoReadStream* stream = stream_at(decode_offset);
|
||||
int length = stream->read_int();
|
||||
GrowableArray<ScopeValue*>* result = new GrowableArray<ScopeValue*> (length);
|
||||
@ -105,7 +105,7 @@ GrowableArray<ScopeValue*>* ScopeDesc::decode_scope_values(int decode_offset) {
|
||||
}
|
||||
|
||||
GrowableArray<ScopeValue*>* ScopeDesc::decode_object_values(int decode_offset) {
|
||||
if (decode_offset == DebugInformationRecorder::serialized_null) return NULL;
|
||||
if (decode_offset == DebugInformationRecorder::serialized_null) return nullptr;
|
||||
GrowableArray<ScopeValue*>* result = new GrowableArray<ScopeValue*>();
|
||||
DebugInfoReadStream* stream = new DebugInfoReadStream(_code, decode_offset, result);
|
||||
int length = stream->read_int();
|
||||
@ -120,7 +120,7 @@ GrowableArray<ScopeValue*>* ScopeDesc::decode_object_values(int decode_offset) {
|
||||
|
||||
|
||||
GrowableArray<MonitorValue*>* ScopeDesc::decode_monitor_values(int decode_offset) {
|
||||
if (decode_offset == DebugInformationRecorder::serialized_null) return NULL;
|
||||
if (decode_offset == DebugInformationRecorder::serialized_null) return nullptr;
|
||||
DebugInfoReadStream* stream = stream_at(decode_offset);
|
||||
int length = stream->read_int();
|
||||
GrowableArray<MonitorValue*>* result = new GrowableArray<MonitorValue*> (length);
|
||||
@ -155,7 +155,7 @@ bool ScopeDesc::is_top() const {
|
||||
}
|
||||
|
||||
ScopeDesc* ScopeDesc::sender() const {
|
||||
if (is_top()) return NULL;
|
||||
if (is_top()) return nullptr;
|
||||
return new ScopeDesc(this);
|
||||
}
|
||||
|
||||
@ -178,12 +178,12 @@ void ScopeDesc::print_value_on(outputStream* st) const {
|
||||
}
|
||||
|
||||
void ScopeDesc::print_on(outputStream* st) const {
|
||||
print_on(st, NULL);
|
||||
print_on(st, nullptr);
|
||||
}
|
||||
|
||||
void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
|
||||
// header
|
||||
if (pd != NULL) {
|
||||
if (pd != nullptr) {
|
||||
st->print_cr("ScopeDesc(pc=" PTR_FORMAT " offset=%x):", p2i(pd->real_pc(_code)), pd->pc_offset());
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
|
||||
}
|
||||
// locals
|
||||
{ GrowableArray<ScopeValue*>* l = ((ScopeDesc*) this)->locals();
|
||||
if (l != NULL) {
|
||||
if (l != nullptr) {
|
||||
st->print_cr(" Locals");
|
||||
for (int index = 0; index < l->length(); index++) {
|
||||
st->print(" - l%d: ", index);
|
||||
@ -212,7 +212,7 @@ void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
|
||||
}
|
||||
// expressions
|
||||
{ GrowableArray<ScopeValue*>* l = ((ScopeDesc*) this)->expressions();
|
||||
if (l != NULL) {
|
||||
if (l != nullptr) {
|
||||
st->print_cr(" Expression stack");
|
||||
for (int index = 0; index < l->length(); index++) {
|
||||
st->print(" - @%d: ", index);
|
||||
@ -223,7 +223,7 @@ void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
|
||||
}
|
||||
// monitors
|
||||
{ GrowableArray<MonitorValue*>* l = ((ScopeDesc*) this)->monitors();
|
||||
if (l != NULL) {
|
||||
if (l != nullptr) {
|
||||
st->print_cr(" Monitor stack");
|
||||
for (int index = 0; index < l->length(); index++) {
|
||||
st->print(" - @%d: ", index);
|
||||
@ -234,7 +234,7 @@ void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
|
||||
}
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
if (NOT_JVMCI(DoEscapeAnalysis &&) is_top() && _objects != NULL) {
|
||||
if (NOT_JVMCI(DoEscapeAnalysis &&) is_top() && _objects != nullptr) {
|
||||
st->print_cr(" Objects");
|
||||
for (int i = 0; i < _objects->length(); i++) {
|
||||
ObjectValue* sv = (ObjectValue*) _objects->at(i);
|
||||
@ -257,7 +257,7 @@ void ScopeDesc::verify() {
|
||||
|
||||
// check if we have any illegal elements on the expression stack
|
||||
{ GrowableArray<ScopeValue*>* l = expressions();
|
||||
if (l != NULL) {
|
||||
if (l != nullptr) {
|
||||
for (int index = 0; index < l->length(); index++) {
|
||||
//guarantee(!l->at(index)->is_illegal(), "expression element cannot be illegal");
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -43,7 +43,7 @@ class SimpleScopeDesc : public StackObj {
|
||||
public:
|
||||
SimpleScopeDesc(CompiledMethod* code, address pc) {
|
||||
PcDesc* pc_desc = code->pc_desc_at(pc);
|
||||
assert(pc_desc != NULL, "Must be able to find matching PcDesc");
|
||||
assert(pc_desc != nullptr, "Must be able to find matching PcDesc");
|
||||
// save this here so we only have to look up the PcDesc once
|
||||
DebugInfoReadStream buffer(code, pc_desc->scope_decode_offset());
|
||||
int ignore_sender = buffer.read_int();
|
||||
@ -82,7 +82,7 @@ class ScopeDesc : public ResourceObj {
|
||||
GrowableArray<MonitorValue*>* monitors();
|
||||
GrowableArray<ScopeValue*>* objects();
|
||||
|
||||
// Stack walking, returns NULL if this is the outer most scope.
|
||||
// Stack walking, returns nullptr if this is the outer most scope.
|
||||
ScopeDesc* sender() const;
|
||||
|
||||
// Returns where the scope was decoded
|
||||
@ -90,7 +90,7 @@ class ScopeDesc : public ResourceObj {
|
||||
|
||||
int sender_decode_offset() const { return _sender_decode_offset; }
|
||||
|
||||
// Tells whether sender() returns NULL
|
||||
// Tells whether sender() returns nullptr
|
||||
bool is_top() const;
|
||||
|
||||
private:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -68,7 +68,7 @@ StubQueue::StubQueue(StubInterface* stub_interface, int buffer_size,
|
||||
Mutex* lock, const char* name) : _mutex(lock) {
|
||||
intptr_t size = align_up(buffer_size, 2*BytesPerWord);
|
||||
BufferBlob* blob = BufferBlob::create(name, size);
|
||||
if( blob == NULL) {
|
||||
if( blob == nullptr) {
|
||||
vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "CodeCache: no room for %s", name);
|
||||
}
|
||||
_stub_interface = stub_interface;
|
||||
@ -99,17 +99,17 @@ void StubQueue::deallocate_unused_tail() {
|
||||
|
||||
Stub* StubQueue::stub_containing(address pc) const {
|
||||
if (contains(pc)) {
|
||||
for (Stub* s = first(); s != NULL; s = next(s)) {
|
||||
for (Stub* s = first(); s != nullptr; s = next(s)) {
|
||||
if (stub_contains(s, pc)) return s;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Stub* StubQueue::request_committed(int code_size) {
|
||||
Stub* s = request(code_size);
|
||||
if (s != NULL) commit(code_size);
|
||||
if (s != nullptr) commit(code_size);
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ int StubQueue::compute_stub_size(Stub* stub, int code_size) {
|
||||
|
||||
Stub* StubQueue::request(int requested_code_size) {
|
||||
assert(requested_code_size > 0, "requested_code_size must be > 0");
|
||||
if (_mutex != NULL) _mutex->lock_without_safepoint_check();
|
||||
if (_mutex != nullptr) _mutex->lock_without_safepoint_check();
|
||||
Stub* s = current_stub();
|
||||
int requested_size = compute_stub_size(s, requested_code_size);
|
||||
if (requested_size <= available_space()) {
|
||||
@ -153,8 +153,8 @@ Stub* StubQueue::request(int requested_code_size) {
|
||||
return s;
|
||||
}
|
||||
// Not enough space left
|
||||
if (_mutex != NULL) _mutex->unlock();
|
||||
return NULL;
|
||||
if (_mutex != nullptr) _mutex->unlock();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -166,7 +166,7 @@ void StubQueue::commit(int committed_code_size) {
|
||||
stub_initialize(s, committed_size);
|
||||
_queue_end += committed_size;
|
||||
_number_of_stubs++;
|
||||
if (_mutex != NULL) _mutex->unlock();
|
||||
if (_mutex != nullptr) _mutex->unlock();
|
||||
debug_only(stub_verify(s);)
|
||||
}
|
||||
|
||||
@ -209,7 +209,7 @@ void StubQueue::remove_all(){
|
||||
|
||||
void StubQueue::verify() {
|
||||
// verify only if initialized
|
||||
if (_stub_buffer == NULL) return;
|
||||
if (_stub_buffer == nullptr) return;
|
||||
MutexLocker lock(_mutex, Mutex::_no_safepoint_check_flag);
|
||||
// verify index boundaries
|
||||
guarantee(0 <= _buffer_size, "buffer size must be positive");
|
||||
@ -227,7 +227,7 @@ void StubQueue::verify() {
|
||||
}
|
||||
// verify contents
|
||||
int n = 0;
|
||||
for (Stub* s = first(); s != NULL; s = next(s)) {
|
||||
for (Stub* s = first(); s != nullptr; s = next(s)) {
|
||||
stub_verify(s);
|
||||
n++;
|
||||
}
|
||||
@ -238,7 +238,7 @@ void StubQueue::verify() {
|
||||
|
||||
void StubQueue::print() {
|
||||
MutexLocker lock(_mutex, Mutex::_no_safepoint_check_flag);
|
||||
for (Stub* s = first(); s != NULL; s = next(s)) {
|
||||
for (Stub* s = first(); s != nullptr; s = next(s)) {
|
||||
stub_print(s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -68,8 +68,8 @@ class Stub {
|
||||
int size() const { ShouldNotCallThis(); return 0; } // must return the size provided by initialize
|
||||
|
||||
// Code info
|
||||
address code_begin() const { ShouldNotCallThis(); return NULL; } // points to the first byte of the code
|
||||
address code_end() const { ShouldNotCallThis(); return NULL; } // points to the first byte after the code
|
||||
address code_begin() const { ShouldNotCallThis(); return nullptr; } // points to the first byte of the code
|
||||
address code_end() const { ShouldNotCallThis(); return nullptr; } // points to the first byte after the code
|
||||
|
||||
// Debugging
|
||||
void verify() { ShouldNotCallThis(); } // verifies the Stub
|
||||
@ -201,11 +201,11 @@ class StubQueue: public CHeapObj<mtCode> {
|
||||
void deallocate_unused_tail(); // deallocate the unused tail of the underlying CodeBlob
|
||||
// only used from TemplateInterpreter::initialize()
|
||||
// Iteration
|
||||
Stub* first() const { return number_of_stubs() > 0 ? stub_at(_queue_begin) : NULL; }
|
||||
Stub* first() const { return number_of_stubs() > 0 ? stub_at(_queue_begin) : nullptr; }
|
||||
Stub* next(Stub* s) const { int i = index_of(s) + stub_size(s);
|
||||
// Only wrap around in the non-contiguous case (see stubss.cpp)
|
||||
if (i == _buffer_limit && _queue_end < _buffer_limit) i = 0;
|
||||
return (i == _queue_end) ? NULL : stub_at(i);
|
||||
return (i == _queue_end) ? nullptr : stub_at(i);
|
||||
}
|
||||
|
||||
// Debugging/printing
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -42,7 +42,7 @@ const char *VMRegImpl::regName[ConcreteRegisterImpl::number_of_registers];
|
||||
|
||||
void VMRegImpl::print_on(outputStream* st) const {
|
||||
if (is_reg()) {
|
||||
assert(VMRegImpl::regName[value()], "VMRegImpl::regName[" INTPTR_FORMAT "] returns NULL", value());
|
||||
assert(VMRegImpl::regName[value()], "VMRegImpl::regName[" INTPTR_FORMAT "] returns nullptr", value());
|
||||
st->print("%s",VMRegImpl::regName[value()]);
|
||||
} else if (is_stack()) {
|
||||
int stk = reg2stack();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -47,8 +47,8 @@
|
||||
// -----------------------------------------------------------------------------------------
|
||||
// Implementation of VtableStub
|
||||
|
||||
address VtableStub::_chunk = NULL;
|
||||
address VtableStub::_chunk_end = NULL;
|
||||
address VtableStub::_chunk = nullptr;
|
||||
address VtableStub::_chunk_end = nullptr;
|
||||
VMReg VtableStub::_receiver_location = VMRegImpl::Bad();
|
||||
|
||||
|
||||
@ -59,14 +59,14 @@ void* VtableStub::operator new(size_t size, int code_size) throw() {
|
||||
const int real_size = align_up(code_size + (int)sizeof(VtableStub), wordSize);
|
||||
// malloc them in chunks to minimize header overhead
|
||||
const int chunk_factor = 32;
|
||||
if (_chunk == NULL || _chunk + real_size > _chunk_end) {
|
||||
if (_chunk == nullptr || _chunk + real_size > _chunk_end) {
|
||||
const int bytes = chunk_factor * real_size + pd_code_alignment();
|
||||
|
||||
// There is a dependency on the name of the blob in src/share/vm/prims/jvmtiCodeBlobEvents.cpp
|
||||
// If changing the name, update the other file accordingly.
|
||||
VtableBlob* blob = VtableBlob::create("vtable chunks", bytes);
|
||||
if (blob == NULL) {
|
||||
return NULL;
|
||||
if (blob == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
_chunk = blob->content_begin();
|
||||
_chunk_end = _chunk + bytes;
|
||||
@ -132,7 +132,7 @@ void VtableStubs::initialize() {
|
||||
assert(_number_of_vtable_stubs == 0, "potential performance bug: VtableStubs initialized more than once");
|
||||
assert(is_power_of_2(int(N)), "N must be a power of 2");
|
||||
for (int i = 0; i < N; i++) {
|
||||
_table[i] = NULL;
|
||||
_table[i] = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -216,7 +216,7 @@ address VtableStubs::find_stub(bool is_vtable_stub, int vtable_index) {
|
||||
{
|
||||
MutexLocker ml(VtableStubs_lock, Mutex::_no_safepoint_check_flag);
|
||||
s = lookup(is_vtable_stub, vtable_index);
|
||||
if (s == NULL) {
|
||||
if (s == nullptr) {
|
||||
if (is_vtable_stub) {
|
||||
s = create_vtable_stub(vtable_index);
|
||||
} else {
|
||||
@ -224,8 +224,8 @@ address VtableStubs::find_stub(bool is_vtable_stub, int vtable_index) {
|
||||
}
|
||||
|
||||
// Creation of vtable or itable can fail if there is not enough free space in the code cache.
|
||||
if (s == NULL) {
|
||||
return NULL;
|
||||
if (s == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
enter(is_vtable_stub, vtable_index, s);
|
||||
@ -279,14 +279,14 @@ VtableStub* VtableStubs::entry_point(address pc) {
|
||||
VtableStub* stub = (VtableStub*)(pc - VtableStub::entry_offset());
|
||||
uint hash = VtableStubs::hash(stub->is_vtable_stub(), stub->index());
|
||||
VtableStub* s;
|
||||
for (s = _table[hash]; s != NULL && s != stub; s = s->next()) {}
|
||||
return (s == stub) ? s : NULL;
|
||||
for (s = _table[hash]; s != nullptr && s != stub; s = s->next()) {}
|
||||
return (s == stub) ? s : nullptr;
|
||||
}
|
||||
|
||||
bool VtableStubs::contains(address pc) {
|
||||
// simple solution for now - we may want to use
|
||||
// a faster way if this function is called often
|
||||
return stub_containing(pc) != NULL;
|
||||
return stub_containing(pc) != nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -295,11 +295,11 @@ VtableStub* VtableStubs::stub_containing(address pc) {
|
||||
// happens with an atomic store into it (we don't care about
|
||||
// consistency with the _number_of_vtable_stubs counter).
|
||||
for (int i = 0; i < N; i++) {
|
||||
for (VtableStub* s = _table[i]; s != NULL; s = s->next()) {
|
||||
for (VtableStub* s = _table[i]; s != nullptr; s = s->next()) {
|
||||
if (s->contains(pc)) return s;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void vtableStubs_init() {
|
||||
@ -308,7 +308,7 @@ void vtableStubs_init() {
|
||||
|
||||
void VtableStubs::vtable_stub_do(void f(VtableStub*)) {
|
||||
for (int i = 0; i < N; i++) {
|
||||
for (VtableStub* s = _table[i]; s != NULL; s = s->next()) {
|
||||
for (VtableStub* s = _table[i]; s != nullptr; s = s->next()) {
|
||||
f(s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -106,7 +106,7 @@ class VtableStubs : AllStatic {
|
||||
|
||||
static VtableStub* entry_point(address pc); // vtable stub entry point for a pc
|
||||
static bool contains(address pc); // is pc within any stub?
|
||||
static VtableStub* stub_containing(address pc); // stub containing pc or NULL
|
||||
static VtableStub* stub_containing(address pc); // stub containing pc or nullptr
|
||||
static int number_of_vtable_stubs() { return _number_of_vtable_stubs; }
|
||||
static void initialize();
|
||||
static void vtable_stub_do(void f(VtableStub*)); // iterates over all vtable stubs
|
||||
@ -131,7 +131,7 @@ class VtableStub {
|
||||
void* operator new(size_t size, int code_size) throw();
|
||||
|
||||
VtableStub(bool is_vtable_stub, int index)
|
||||
: _next(NULL), _index(index), _ame_offset(-1), _npe_offset(-1),
|
||||
: _next(nullptr), _index(index), _ame_offset(-1), _npe_offset(-1),
|
||||
_is_vtable_stub(is_vtable_stub) {}
|
||||
VtableStub* next() const { return _next; }
|
||||
int index() const { return _index; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user