mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8257563: Remove excessive include of klass.inline.hpp
Reviewed-by: dholmes, stuefe, stefank
This commit is contained in:
parent
cc1915b3b3
commit
02a0a027f4
85 changed files with 209 additions and 96 deletions
|
@ -25,17 +25,94 @@
|
|||
#ifndef SHARE_OOPS_INSTANCEKLASS_INLINE_HPP
|
||||
#define SHARE_OOPS_INSTANCEKLASS_INLINE_HPP
|
||||
|
||||
#include "classfile/javaClasses.hpp"
|
||||
#include "classfile/vmSymbols.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/instanceKlass.hpp"
|
||||
#include "oops/klass.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
inline InstanceKlass* InstanceKlass::unsafe_anonymous_host() const {
|
||||
InstanceKlass** hk = adr_unsafe_anonymous_host();
|
||||
if (hk == NULL) {
|
||||
assert(!is_unsafe_anonymous(), "Unsafe anonymous classes have host klasses");
|
||||
return NULL;
|
||||
} else {
|
||||
assert(*hk != NULL, "host klass should always be set if the address is not null");
|
||||
assert(is_unsafe_anonymous(), "Only unsafe anonymous classes have host klasses");
|
||||
return *hk;
|
||||
}
|
||||
}
|
||||
|
||||
inline void InstanceKlass::set_unsafe_anonymous_host(const InstanceKlass* host) {
|
||||
assert(is_unsafe_anonymous(), "not unsafe anonymous");
|
||||
const InstanceKlass** addr = (const InstanceKlass **)adr_unsafe_anonymous_host();
|
||||
assert(addr != NULL, "no reversed space");
|
||||
if (addr != NULL) {
|
||||
*addr = host;
|
||||
}
|
||||
}
|
||||
|
||||
inline intptr_t* InstanceKlass::start_of_itable() const { return (intptr_t*)start_of_vtable() + vtable_length(); }
|
||||
inline intptr_t* InstanceKlass::end_of_itable() const { return start_of_itable() + itable_length(); }
|
||||
|
||||
inline int InstanceKlass::itable_offset_in_words() const { return start_of_itable() - (intptr_t*)this; }
|
||||
|
||||
inline oop InstanceKlass::static_field_base_raw() { return java_mirror(); }
|
||||
|
||||
inline OopMapBlock* InstanceKlass::start_of_nonstatic_oop_maps() const {
|
||||
return (OopMapBlock*)(start_of_itable() + itable_length());
|
||||
}
|
||||
|
||||
inline Klass** InstanceKlass::end_of_nonstatic_oop_maps() const {
|
||||
return (Klass**)(start_of_nonstatic_oop_maps() +
|
||||
nonstatic_oop_map_count());
|
||||
}
|
||||
|
||||
inline Klass* volatile* InstanceKlass::adr_implementor() const {
|
||||
if (is_interface()) {
|
||||
return (Klass* volatile*)end_of_nonstatic_oop_maps();
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
inline InstanceKlass** InstanceKlass::adr_unsafe_anonymous_host() const {
|
||||
if (is_unsafe_anonymous()) {
|
||||
InstanceKlass** adr_impl = (InstanceKlass**)adr_implementor();
|
||||
if (adr_impl != NULL) {
|
||||
return adr_impl + 1;
|
||||
} else {
|
||||
return (InstanceKlass **)end_of_nonstatic_oop_maps();
|
||||
}
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
inline address InstanceKlass::adr_fingerprint() const {
|
||||
if (has_stored_fingerprint()) {
|
||||
InstanceKlass** adr_host = adr_unsafe_anonymous_host();
|
||||
if (adr_host != NULL) {
|
||||
return (address)(adr_host + 1);
|
||||
}
|
||||
|
||||
Klass* volatile* adr_impl = adr_implementor();
|
||||
if (adr_impl != NULL) {
|
||||
return (address)(adr_impl + 1);
|
||||
}
|
||||
|
||||
return (address)end_of_nonstatic_oop_maps();
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
inline ObjArrayKlass* InstanceKlass::array_klasses_acquire() const {
|
||||
return Atomic::load_acquire(&_array_klasses);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue