< prev index next >

src/hotspot/share/oops/klass.cpp

Print this page

  36 #include "gc/shared/collectedHeap.inline.hpp"
  37 #include "jvm_io.h"
  38 #include "logging/log.hpp"
  39 #include "memory/metadataFactory.hpp"
  40 #include "memory/metaspaceClosure.hpp"
  41 #include "memory/oopFactory.hpp"
  42 #include "memory/resourceArea.hpp"
  43 #include "memory/universe.hpp"
  44 #include "oops/compressedKlass.inline.hpp"
  45 #include "oops/compressedOops.inline.hpp"
  46 #include "oops/instanceKlass.hpp"
  47 #include "oops/klass.inline.hpp"
  48 #include "oops/objArrayKlass.hpp"
  49 #include "oops/oop.inline.hpp"
  50 #include "oops/oopHandle.inline.hpp"
  51 #include "prims/jvmtiExport.hpp"
  52 #include "runtime/atomicAccess.hpp"
  53 #include "runtime/handles.inline.hpp"
  54 #include "runtime/perfData.hpp"
  55 #include "utilities/macros.hpp"

  56 #include "utilities/powerOfTwo.hpp"
  57 #include "utilities/rotate_bits.hpp"
  58 #include "utilities/stack.inline.hpp"
  59 
  60 #if INCLUDE_JFR
  61 #include "jfr/jfr.hpp"
  62 #endif
  63 
  64 void Klass::set_java_mirror(Handle m) {
  65   assert(!m.is_null(), "New mirror should never be null.");
  66   assert(_java_mirror.is_empty(), "should only be used to initialize mirror");
  67   _java_mirror = class_loader_data()->add_handle(m);
  68 }
  69 
  70 bool Klass::is_cloneable() const {
  71   return _misc_flags.is_cloneable_fast() ||
  72          is_subtype_of(vmClasses::Cloneable_klass());
  73 }
  74 
  75 uint8_t Klass::compute_hash_slot(Symbol* n) {

1332     st->print("  - "); st->print("%d elements;", _secondary_supers->length());
1333     st->print_cr(" bitmap: " UINTX_FORMAT_X_0, _secondary_supers_bitmap);
1334     if (_secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_EMPTY &&
1335         _secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_FULL) {
1336       st->print("  - "); print_positive_lookup_stats(secondary_supers(),
1337                                                      _secondary_supers_bitmap, st); st->cr();
1338       st->print("  - "); print_negative_lookup_stats(_secondary_supers_bitmap, st); st->cr();
1339     }
1340   } else {
1341     st->print("null");
1342   }
1343 }
1344 
1345 void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, bool linear_result, bool table_result, const char* msg) {
1346   ResourceMark rm;
1347   super->print();
1348   sub->print();
1349   fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
1350         msg, sub->external_name(), super->external_name(), linear_result, table_result);
1351 }














  36 #include "gc/shared/collectedHeap.inline.hpp"
  37 #include "jvm_io.h"
  38 #include "logging/log.hpp"
  39 #include "memory/metadataFactory.hpp"
  40 #include "memory/metaspaceClosure.hpp"
  41 #include "memory/oopFactory.hpp"
  42 #include "memory/resourceArea.hpp"
  43 #include "memory/universe.hpp"
  44 #include "oops/compressedKlass.inline.hpp"
  45 #include "oops/compressedOops.inline.hpp"
  46 #include "oops/instanceKlass.hpp"
  47 #include "oops/klass.inline.hpp"
  48 #include "oops/objArrayKlass.hpp"
  49 #include "oops/oop.inline.hpp"
  50 #include "oops/oopHandle.inline.hpp"
  51 #include "prims/jvmtiExport.hpp"
  52 #include "runtime/atomicAccess.hpp"
  53 #include "runtime/handles.inline.hpp"
  54 #include "runtime/perfData.hpp"
  55 #include "utilities/macros.hpp"
  56 #include "utilities/numberSeq.hpp"
  57 #include "utilities/powerOfTwo.hpp"
  58 #include "utilities/rotate_bits.hpp"
  59 #include "utilities/stack.inline.hpp"
  60 
  61 #if INCLUDE_JFR
  62 #include "jfr/jfr.hpp"
  63 #endif
  64 
  65 void Klass::set_java_mirror(Handle m) {
  66   assert(!m.is_null(), "New mirror should never be null.");
  67   assert(_java_mirror.is_empty(), "should only be used to initialize mirror");
  68   _java_mirror = class_loader_data()->add_handle(m);
  69 }
  70 
  71 bool Klass::is_cloneable() const {
  72   return _misc_flags.is_cloneable_fast() ||
  73          is_subtype_of(vmClasses::Cloneable_klass());
  74 }
  75 
  76 uint8_t Klass::compute_hash_slot(Symbol* n) {

1333     st->print("  - "); st->print("%d elements;", _secondary_supers->length());
1334     st->print_cr(" bitmap: " UINTX_FORMAT_X_0, _secondary_supers_bitmap);
1335     if (_secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_EMPTY &&
1336         _secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_FULL) {
1337       st->print("  - "); print_positive_lookup_stats(secondary_supers(),
1338                                                      _secondary_supers_bitmap, st); st->cr();
1339       st->print("  - "); print_negative_lookup_stats(_secondary_supers_bitmap, st); st->cr();
1340     }
1341   } else {
1342     st->print("null");
1343   }
1344 }
1345 
1346 void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, bool linear_result, bool table_result, const char* msg) {
1347   ResourceMark rm;
1348   super->print();
1349   sub->print();
1350   fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
1351         msg, sub->external_name(), super->external_name(), linear_result, table_result);
1352 }
1353 
1354 static int expanded = 0;
1355 static int not_expanded = 0;
1356 static NumberSeq seq = NumberSeq();
1357 
1358 bool Klass::expand_for_hash(oop obj, markWord m) const {
1359   assert(UseCompactObjectHeaders, "only with compact i-hash");
1360   {
1361     ResourceMark rm;
1362     assert((size_t)hash_offset_in_bytes(obj,m ) <= (obj->base_size_given_klass(m, this) * HeapWordSize), "hash offset must be eq or lt base size: hash offset: %d, base size: %zu, class-name: %s", hash_offset_in_bytes(obj, m), obj->base_size_given_klass(m, this) * HeapWordSize, external_name());
1363   }
1364   return obj->base_size_given_klass(m, this) * HeapWordSize - hash_offset_in_bytes(obj, m) < (int)sizeof(uint32_t);
1365 }
< prev index next >