mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8199272: Broken assertion in ClassLoaderData::remove_handle
Added new ClassLoaderData::ChunkList::contains(oop*) function for OopHandle rather than oop. Reviewed-by: stefank, hseigel
This commit is contained in:
parent
7621378c0b
commit
29cb168550
2 changed files with 15 additions and 1 deletions
|
@ -222,6 +222,19 @@ bool ClassLoaderData::ChunkedHandleList::contains(oop p) {
|
|||
return cl.found();
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
bool ClassLoaderData::ChunkedHandleList::owner_of(oop* oop_handle) {
|
||||
Chunk* chunk = _head;
|
||||
while (chunk != NULL) {
|
||||
if (&(chunk->_data[0]) <= oop_handle && oop_handle < &(chunk->_data[chunk->_size])) {
|
||||
return true;
|
||||
}
|
||||
chunk = chunk->_next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // PRODUCT
|
||||
|
||||
bool ClassLoaderData::claim() {
|
||||
if (_claimed == 1) {
|
||||
return false;
|
||||
|
@ -759,7 +772,7 @@ void ClassLoaderData::remove_handle(OopHandle h) {
|
|||
assert(!is_unloading(), "Do not remove a handle for a CLD that is unloading");
|
||||
oop* ptr = h.ptr_raw();
|
||||
if (ptr != NULL) {
|
||||
assert(_handles.contains(*ptr), "Got unexpected handle " PTR_FORMAT, p2i(ptr));
|
||||
assert(_handles.owner_of(ptr), "Got unexpected handle " PTR_FORMAT, p2i(ptr));
|
||||
// This root is not walked in safepoints, and hence requires an appropriate
|
||||
// decorator that e.g. maintains the SATB invariant in SATB collectors.
|
||||
RootAccess<IN_CONCURRENT_ROOT>::oop_store(ptr, oop(NULL));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue