mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8178351: Simplify MetaspaceShared::is_in_shared_space and MetaspaceObj::is_shared
Use a single range check with MetaspaceObj::_shared_metaspace_{base,top} Reviewed-by: jiangli, redestad, shade
This commit is contained in:
parent
dcb4e73a38
commit
a3cb6e9204
15 changed files with 93 additions and 90 deletions
|
@ -2229,7 +2229,7 @@ void InstanceKlass::release_C_heap_structures() {
|
|||
}
|
||||
|
||||
// deallocate the cached class file
|
||||
if (_cached_class_file != NULL && !MetaspaceShared::is_in_shared_space(_cached_class_file)) {
|
||||
if (_cached_class_file != NULL && !MetaspaceShared::is_in_shared_metaspace(_cached_class_file)) {
|
||||
os::free(_cached_class_file);
|
||||
_cached_class_file = NULL;
|
||||
}
|
||||
|
@ -3732,7 +3732,7 @@ Method* InstanceKlass::method_with_orig_idnum(int idnum, int version) {
|
|||
|
||||
#if INCLUDE_JVMTI
|
||||
JvmtiCachedClassFileData* InstanceKlass::get_cached_class_file() {
|
||||
if (MetaspaceShared::is_in_shared_space(_cached_class_file)) {
|
||||
if (MetaspaceShared::is_in_shared_metaspace(_cached_class_file)) {
|
||||
// Ignore the archived class stream data
|
||||
return NULL;
|
||||
} else {
|
||||
|
@ -3754,7 +3754,7 @@ JvmtiCachedClassFileData* InstanceKlass::get_archived_class_data() {
|
|||
return _cached_class_file;
|
||||
} else {
|
||||
assert(this->is_shared(), "class should be shared");
|
||||
if (MetaspaceShared::is_in_shared_space(_cached_class_file)) {
|
||||
if (MetaspaceShared::is_in_shared_metaspace(_cached_class_file)) {
|
||||
return _cached_class_file;
|
||||
} else {
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue