< prev index next >

src/hotspot/share/oops/klass.inline.hpp

Print this page

 35 // This loads and keeps the klass's loader alive.
 36 inline oop Klass::klass_holder() const {
 37   return class_loader_data()->holder();
 38 }
 39 
 40 inline bool Klass::is_non_strong_hidden() const {
 41   return is_hidden() && class_loader_data()->has_class_mirror_holder();
 42 }
 43 
 44 // Iff the class loader (or mirror for non-strong hidden classes) is alive the
 45 // Klass is considered alive. This is safe to call before the CLD is marked as
 46 // unloading, and hence during concurrent class unloading.
 47 // This returns false if the Klass is unloaded, or about to be unloaded because the holder of
 48 // the CLD is no longer strongly reachable.
 49 // The return value of this function may change from true to false after a safepoint. So the caller
 50 // of this function must ensure that a safepoint doesn't happen while interpreting the return value.
 51 inline bool Klass::is_loader_alive() const {
 52   return class_loader_data()->is_alive();
 53 }
 54 


















 55 inline oop Klass::java_mirror() const {
 56   return _java_mirror.resolve();
 57 }
 58 
 59 inline oop Klass::java_mirror_no_keepalive() const {
 60   return _java_mirror.peek();
 61 }
 62 
 63 inline klassVtable Klass::vtable() const {
 64   return klassVtable(const_cast<Klass*>(this), start_of_vtable(), vtable_length() / vtableEntry::size());
 65 }
 66 
 67 inline oop Klass::class_loader() const {
 68   return class_loader_data()->class_loader();
 69 }
 70 
 71 inline vtableEntry* Klass::start_of_vtable() const {
 72   return (vtableEntry*) ((address)this + in_bytes(vtable_start_offset()));
 73 }
 74 

 35 // This loads and keeps the klass's loader alive.
 36 inline oop Klass::klass_holder() const {
 37   return class_loader_data()->holder();
 38 }
 39 
 40 inline bool Klass::is_non_strong_hidden() const {
 41   return is_hidden() && class_loader_data()->has_class_mirror_holder();
 42 }
 43 
 44 // Iff the class loader (or mirror for non-strong hidden classes) is alive the
 45 // Klass is considered alive. This is safe to call before the CLD is marked as
 46 // unloading, and hence during concurrent class unloading.
 47 // This returns false if the Klass is unloaded, or about to be unloaded because the holder of
 48 // the CLD is no longer strongly reachable.
 49 // The return value of this function may change from true to false after a safepoint. So the caller
 50 // of this function must ensure that a safepoint doesn't happen while interpreting the return value.
 51 inline bool Klass::is_loader_alive() const {
 52   return class_loader_data()->is_alive();
 53 }
 54 
 55 inline void Klass::set_prototype_header(markWord header) {
 56   assert(!is_inline_klass() || header.is_inline_type(), "Unexpected prototype");
 57   assert(_prototype_header.value() == 0 || _prototype_header == markWord::prototype(),
 58          "Prototype already set");
 59 #ifdef _LP64
 60     assert(header == markWord::prototype() ||
 61            header.is_inline_type() ||
 62            header.is_flat_array() ||
 63            header.is_null_free_array(),
 64            "unknown prototype header");
 65 #else
 66     assert(header == markWord::prototype() ||
 67            header.is_inline_type(),
 68            "unknown prototype header");
 69 #endif
 70   _prototype_header = header;
 71 }
 72 
 73 inline oop Klass::java_mirror() const {
 74   return _java_mirror.resolve();
 75 }
 76 
 77 inline oop Klass::java_mirror_no_keepalive() const {
 78   return _java_mirror.peek();
 79 }
 80 
 81 inline klassVtable Klass::vtable() const {
 82   return klassVtable(const_cast<Klass*>(this), start_of_vtable(), vtable_length() / vtableEntry::size());
 83 }
 84 
 85 inline oop Klass::class_loader() const {
 86   return class_loader_data()->class_loader();
 87 }
 88 
 89 inline vtableEntry* Klass::start_of_vtable() const {
 90   return (vtableEntry*) ((address)this + in_bytes(vtable_start_offset()));
 91 }
 92 
< prev index next >