< prev index next >

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

Print this page

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


















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

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