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:
Ioi Lam 2018-01-16 16:57:53 -08:00
parent dcb4e73a38
commit a3cb6e9204
15 changed files with 93 additions and 90 deletions

View file

@ -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;