37 #include "gc/shared/collectedHeap.inline.hpp"
38 #include "jvm_io.h"
39 #include "logging/log.hpp"
40 #include "memory/metadataFactory.hpp"
41 #include "memory/metaspaceClosure.hpp"
42 #include "memory/oopFactory.hpp"
43 #include "memory/resourceArea.hpp"
44 #include "memory/universe.hpp"
45 #include "oops/compressedKlass.inline.hpp"
46 #include "oops/compressedOops.inline.hpp"
47 #include "oops/instanceKlass.hpp"
48 #include "oops/klass.inline.hpp"
49 #include "oops/objArrayKlass.hpp"
50 #include "oops/oop.inline.hpp"
51 #include "oops/oopHandle.inline.hpp"
52 #include "prims/jvmtiExport.hpp"
53 #include "runtime/atomic.hpp"
54 #include "runtime/handles.inline.hpp"
55 #include "runtime/perfData.hpp"
56 #include "utilities/macros.hpp"
57 #include "utilities/powerOfTwo.hpp"
58 #include "utilities/rotate_bits.hpp"
59 #include "utilities/stack.inline.hpp"
60
61 void Klass::set_java_mirror(Handle m) {
62 assert(!m.is_null(), "New mirror should never be null.");
63 assert(_java_mirror.is_empty(), "should only be used to initialize mirror");
64 _java_mirror = class_loader_data()->add_handle(m);
65 }
66
67 bool Klass::is_cloneable() const {
68 return _misc_flags.is_cloneable_fast() ||
69 is_subtype_of(vmClasses::Cloneable_klass());
70 }
71
72 void Klass::set_is_cloneable() {
73 if (name() == vmSymbols::java_lang_invoke_MemberName()) {
74 assert(is_final(), "no subclasses allowed");
75 // MemberName cloning should not be intrinsified and always happen in JVM_Clone.
76 } else if (is_instance_klass() && InstanceKlass::cast(this)->reference_type() != REF_NONE) {
1342 st->print(" - "); st->print("%d elements;", _secondary_supers->length());
1343 st->print_cr(" bitmap: " UINTX_FORMAT_X_0, _secondary_supers_bitmap);
1344 if (_secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_EMPTY &&
1345 _secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_FULL) {
1346 st->print(" - "); print_positive_lookup_stats(secondary_supers(),
1347 _secondary_supers_bitmap, st); st->cr();
1348 st->print(" - "); print_negative_lookup_stats(_secondary_supers_bitmap, st); st->cr();
1349 }
1350 } else {
1351 st->print("null");
1352 }
1353 }
1354
1355 void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, bool linear_result, bool table_result, const char* msg) {
1356 ResourceMark rm;
1357 super->print();
1358 sub->print();
1359 fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
1360 msg, sub->external_name(), super->external_name(), linear_result, table_result);
1361 }
|
37 #include "gc/shared/collectedHeap.inline.hpp"
38 #include "jvm_io.h"
39 #include "logging/log.hpp"
40 #include "memory/metadataFactory.hpp"
41 #include "memory/metaspaceClosure.hpp"
42 #include "memory/oopFactory.hpp"
43 #include "memory/resourceArea.hpp"
44 #include "memory/universe.hpp"
45 #include "oops/compressedKlass.inline.hpp"
46 #include "oops/compressedOops.inline.hpp"
47 #include "oops/instanceKlass.hpp"
48 #include "oops/klass.inline.hpp"
49 #include "oops/objArrayKlass.hpp"
50 #include "oops/oop.inline.hpp"
51 #include "oops/oopHandle.inline.hpp"
52 #include "prims/jvmtiExport.hpp"
53 #include "runtime/atomic.hpp"
54 #include "runtime/handles.inline.hpp"
55 #include "runtime/perfData.hpp"
56 #include "utilities/macros.hpp"
57 #include "utilities/numberSeq.hpp"
58 #include "utilities/powerOfTwo.hpp"
59 #include "utilities/rotate_bits.hpp"
60 #include "utilities/stack.inline.hpp"
61
62 void Klass::set_java_mirror(Handle m) {
63 assert(!m.is_null(), "New mirror should never be null.");
64 assert(_java_mirror.is_empty(), "should only be used to initialize mirror");
65 _java_mirror = class_loader_data()->add_handle(m);
66 }
67
68 bool Klass::is_cloneable() const {
69 return _misc_flags.is_cloneable_fast() ||
70 is_subtype_of(vmClasses::Cloneable_klass());
71 }
72
73 void Klass::set_is_cloneable() {
74 if (name() == vmSymbols::java_lang_invoke_MemberName()) {
75 assert(is_final(), "no subclasses allowed");
76 // MemberName cloning should not be intrinsified and always happen in JVM_Clone.
77 } else if (is_instance_klass() && InstanceKlass::cast(this)->reference_type() != REF_NONE) {
1343 st->print(" - "); st->print("%d elements;", _secondary_supers->length());
1344 st->print_cr(" bitmap: " UINTX_FORMAT_X_0, _secondary_supers_bitmap);
1345 if (_secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_EMPTY &&
1346 _secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_FULL) {
1347 st->print(" - "); print_positive_lookup_stats(secondary_supers(),
1348 _secondary_supers_bitmap, st); st->cr();
1349 st->print(" - "); print_negative_lookup_stats(_secondary_supers_bitmap, st); st->cr();
1350 }
1351 } else {
1352 st->print("null");
1353 }
1354 }
1355
1356 void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, bool linear_result, bool table_result, const char* msg) {
1357 ResourceMark rm;
1358 super->print();
1359 sub->print();
1360 fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
1361 msg, sub->external_name(), super->external_name(), linear_result, table_result);
1362 }
1363
1364 static int expanded = 0;
1365 static int not_expanded = 0;
1366 static NumberSeq seq = NumberSeq();
1367
1368 bool Klass::expand_for_hash(oop obj, markWord m) const {
1369 assert(UseCompactObjectHeaders, "only with compact i-hash");
1370 {
1371 ResourceMark rm;
1372 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());
1373 }
1374 return obj->base_size_given_klass(m, this) * HeapWordSize - hash_offset_in_bytes(obj, m) < (int)sizeof(uint32_t);
1375 }
|