38 #include "gc/shared/collectedHeap.inline.hpp"
39 #include "jvm_io.h"
40 #include "logging/log.hpp"
41 #include "memory/metadataFactory.hpp"
42 #include "memory/metaspaceClosure.hpp"
43 #include "memory/oopFactory.hpp"
44 #include "memory/resourceArea.hpp"
45 #include "memory/universe.hpp"
46 #include "oops/compressedKlass.inline.hpp"
47 #include "oops/compressedOops.inline.hpp"
48 #include "oops/instanceKlass.hpp"
49 #include "oops/klass.inline.hpp"
50 #include "oops/objArrayKlass.hpp"
51 #include "oops/oop.inline.hpp"
52 #include "oops/oopHandle.inline.hpp"
53 #include "prims/jvmtiExport.hpp"
54 #include "runtime/atomic.hpp"
55 #include "runtime/handles.inline.hpp"
56 #include "runtime/perfData.hpp"
57 #include "utilities/macros.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) {
1307 st->print(" - "); st->print("%d elements;", _secondary_supers->length());
1308 st->print_cr(" bitmap: " UINTX_FORMAT_X_0 ";", _secondary_supers_bitmap);
1309 if (_secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_EMPTY &&
1310 _secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_FULL) {
1311 st->print(" - "); print_positive_lookup_stats(secondary_supers(),
1312 _secondary_supers_bitmap, st); st->cr();
1313 st->print(" - "); print_negative_lookup_stats(_secondary_supers_bitmap, st); st->cr();
1314 }
1315 } else {
1316 st->print("null");
1317 }
1318 }
1319
1320 void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, bool linear_result, bool table_result, const char* msg) {
1321 ResourceMark rm;
1322 super->print();
1323 sub->print();
1324 fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
1325 msg, sub->external_name(), super->external_name(), linear_result, table_result);
1326 }
|
38 #include "gc/shared/collectedHeap.inline.hpp"
39 #include "jvm_io.h"
40 #include "logging/log.hpp"
41 #include "memory/metadataFactory.hpp"
42 #include "memory/metaspaceClosure.hpp"
43 #include "memory/oopFactory.hpp"
44 #include "memory/resourceArea.hpp"
45 #include "memory/universe.hpp"
46 #include "oops/compressedKlass.inline.hpp"
47 #include "oops/compressedOops.inline.hpp"
48 #include "oops/instanceKlass.hpp"
49 #include "oops/klass.inline.hpp"
50 #include "oops/objArrayKlass.hpp"
51 #include "oops/oop.inline.hpp"
52 #include "oops/oopHandle.inline.hpp"
53 #include "prims/jvmtiExport.hpp"
54 #include "runtime/atomic.hpp"
55 #include "runtime/handles.inline.hpp"
56 #include "runtime/perfData.hpp"
57 #include "utilities/macros.hpp"
58 #include "utilities/numberSeq.hpp"
59 #include "utilities/powerOfTwo.hpp"
60 #include "utilities/rotate_bits.hpp"
61 #include "utilities/stack.inline.hpp"
62
63 void Klass::set_java_mirror(Handle m) {
64 assert(!m.is_null(), "New mirror should never be null.");
65 assert(_java_mirror.is_empty(), "should only be used to initialize mirror");
66 _java_mirror = class_loader_data()->add_handle(m);
67 }
68
69 bool Klass::is_cloneable() const {
70 return _misc_flags.is_cloneable_fast() ||
71 is_subtype_of(vmClasses::Cloneable_klass());
72 }
73
74 void Klass::set_is_cloneable() {
75 if (name() == vmSymbols::java_lang_invoke_MemberName()) {
76 assert(is_final(), "no subclasses allowed");
77 // MemberName cloning should not be intrinsified and always happen in JVM_Clone.
78 } else if (is_instance_klass() && InstanceKlass::cast(this)->reference_type() != REF_NONE) {
1308 st->print(" - "); st->print("%d elements;", _secondary_supers->length());
1309 st->print_cr(" bitmap: " UINTX_FORMAT_X_0 ";", _secondary_supers_bitmap);
1310 if (_secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_EMPTY &&
1311 _secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_FULL) {
1312 st->print(" - "); print_positive_lookup_stats(secondary_supers(),
1313 _secondary_supers_bitmap, st); st->cr();
1314 st->print(" - "); print_negative_lookup_stats(_secondary_supers_bitmap, st); st->cr();
1315 }
1316 } else {
1317 st->print("null");
1318 }
1319 }
1320
1321 void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, bool linear_result, bool table_result, const char* msg) {
1322 ResourceMark rm;
1323 super->print();
1324 sub->print();
1325 fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
1326 msg, sub->external_name(), super->external_name(), linear_result, table_result);
1327 }
1328
1329 static int expanded = 0;
1330 static int not_expanded = 0;
1331 static NumberSeq seq = NumberSeq();
1332
1333 bool Klass::expand_for_hash(oop obj) const {
1334 assert(UseCompactObjectHeaders, "only with compact i-hash");
1335 assert((size_t)hash_offset_in_bytes(obj) <= (obj->base_size_given_klass(obj->mark(), this) * HeapWordSize), "hash offset must be eq or lt base size: hash offset: %d, base size: " SIZE_FORMAT, hash_offset_in_bytes(obj), obj->base_size_given_klass(obj->mark(), this) * HeapWordSize);
1336 return obj->base_size_given_klass(obj->mark(), this) * HeapWordSize - hash_offset_in_bytes(obj) < (int)sizeof(uint32_t);
1337 }
|