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) {
1326 st->print(" - "); st->print("%d elements;", _secondary_supers->length());
1327 st->print_cr(" bitmap: " UINTX_FORMAT_X_0, _secondary_supers_bitmap);
1328 if (_secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_EMPTY &&
1329 _secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_FULL) {
1330 st->print(" - "); print_positive_lookup_stats(secondary_supers(),
1331 _secondary_supers_bitmap, st); st->cr();
1332 st->print(" - "); print_negative_lookup_stats(_secondary_supers_bitmap, st); st->cr();
1333 }
1334 } else {
1335 st->print("null");
1336 }
1337 }
1338
1339 void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, bool linear_result, bool table_result, const char* msg) {
1340 ResourceMark rm;
1341 super->print();
1342 sub->print();
1343 fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
1344 msg, sub->external_name(), super->external_name(), linear_result, table_result);
1345 }
|
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) {
1327 st->print(" - "); st->print("%d elements;", _secondary_supers->length());
1328 st->print_cr(" bitmap: " UINTX_FORMAT_X_0, _secondary_supers_bitmap);
1329 if (_secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_EMPTY &&
1330 _secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_FULL) {
1331 st->print(" - "); print_positive_lookup_stats(secondary_supers(),
1332 _secondary_supers_bitmap, st); st->cr();
1333 st->print(" - "); print_negative_lookup_stats(_secondary_supers_bitmap, st); st->cr();
1334 }
1335 } else {
1336 st->print("null");
1337 }
1338 }
1339
1340 void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, bool linear_result, bool table_result, const char* msg) {
1341 ResourceMark rm;
1342 super->print();
1343 sub->print();
1344 fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
1345 msg, sub->external_name(), super->external_name(), linear_result, table_result);
1346 }
1347
1348 static int expanded = 0;
1349 static int not_expanded = 0;
1350 static NumberSeq seq = NumberSeq();
1351
1352 bool Klass::expand_for_hash(oop obj, markWord m) const {
1353 assert(UseCompactObjectHeaders, "only with compact i-hash");
1354 {
1355 ResourceMark rm;
1356 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());
1357 }
1358 return obj->base_size_given_klass(m, this) * HeapWordSize - hash_offset_in_bytes(obj, m) < (int)sizeof(uint32_t);
1359 }
|