< prev index next >

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

Print this page

 77   _prototype_header = header;
 78 }
 79 
 80 // Loading the java_mirror does not keep its holder alive. See Klass::keep_alive().
 81 inline oop Klass::java_mirror() const {
 82   return _java_mirror.resolve();
 83 }
 84 
 85 inline oop Klass::java_mirror_no_keepalive() const {
 86   return _java_mirror.peek();
 87 }
 88 
 89 inline klassVtable Klass::vtable() const {
 90   return klassVtable(const_cast<Klass*>(this), start_of_vtable(), vtable_length() / vtableEntry::size());
 91 }
 92 
 93 inline oop Klass::class_loader() const {
 94   return class_loader_data()->class_loader();
 95 }
 96 




 97 inline vtableEntry* Klass::start_of_vtable() const {
 98   return (vtableEntry*) ((address)this + in_bytes(vtable_start_offset()));
 99 }
100 
101 inline ByteSize Klass::vtable_start_offset() {
102   return in_ByteSize(InstanceKlass::header_size() * wordSize);
103 }
104 
105 // subtype check: true if is_subclass_of, or if k is interface and receiver implements it
106 inline bool Klass::is_subtype_of(Klass* k) const {
107   assert(secondary_supers() != nullptr, "must be");
108   const juint off = k->super_check_offset();
109   const juint secondary_offset = in_bytes(secondary_super_cache_offset());
110   if (off == secondary_offset) {
111     return search_secondary_supers(k);
112   } else {
113     Klass* sup = *(Klass**)( (address)this + off );
114     return (sup == k);
115   }
116 }

 77   _prototype_header = header;
 78 }
 79 
 80 // Loading the java_mirror does not keep its holder alive. See Klass::keep_alive().
 81 inline oop Klass::java_mirror() const {
 82   return _java_mirror.resolve();
 83 }
 84 
 85 inline oop Klass::java_mirror_no_keepalive() const {
 86   return _java_mirror.peek();
 87 }
 88 
 89 inline klassVtable Klass::vtable() const {
 90   return klassVtable(const_cast<Klass*>(this), start_of_vtable(), vtable_length() / vtableEntry::size());
 91 }
 92 
 93 inline oop Klass::class_loader() const {
 94   return class_loader_data()->class_loader();
 95 }
 96 
 97 inline Symbol* Klass::class_loader_name_and_id() const {
 98   return class_loader_data()->name_and_id();
 99 }
100 
101 inline vtableEntry* Klass::start_of_vtable() const {
102   return (vtableEntry*) ((address)this + in_bytes(vtable_start_offset()));
103 }
104 
105 inline ByteSize Klass::vtable_start_offset() {
106   return in_ByteSize(InstanceKlass::header_size() * wordSize);
107 }
108 
109 // subtype check: true if is_subclass_of, or if k is interface and receiver implements it
110 inline bool Klass::is_subtype_of(Klass* k) const {
111   assert(secondary_supers() != nullptr, "must be");
112   const juint off = k->super_check_offset();
113   const juint secondary_offset = in_bytes(secondary_super_cache_offset());
114   if (off == secondary_offset) {
115     return search_secondary_supers(k);
116   } else {
117     Klass* sup = *(Klass**)( (address)this + off );
118     return (sup == k);
119   }
120 }
< prev index next >