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) {
1313 st->print(" - "); st->print("%d elements;", _secondary_supers->length());
1314 st->print_cr(" bitmap: " UINTX_FORMAT_X_0, _secondary_supers_bitmap);
1315 if (_secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_EMPTY &&
1316 _secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_FULL) {
1317 st->print(" - "); print_positive_lookup_stats(secondary_supers(),
1318 _secondary_supers_bitmap, st); st->cr();
1319 st->print(" - "); print_negative_lookup_stats(_secondary_supers_bitmap, st); st->cr();
1320 }
1321 } else {
1322 st->print("null");
1323 }
1324 }
1325
1326 void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, bool linear_result, bool table_result, const char* msg) {
1327 ResourceMark rm;
1328 super->print();
1329 sub->print();
1330 fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
1331 msg, sub->external_name(), super->external_name(), linear_result, table_result);
1332 }
|
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) {
1314 st->print(" - "); st->print("%d elements;", _secondary_supers->length());
1315 st->print_cr(" bitmap: " UINTX_FORMAT_X_0, _secondary_supers_bitmap);
1316 if (_secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_EMPTY &&
1317 _secondary_supers_bitmap != SECONDARY_SUPERS_BITMAP_FULL) {
1318 st->print(" - "); print_positive_lookup_stats(secondary_supers(),
1319 _secondary_supers_bitmap, st); st->cr();
1320 st->print(" - "); print_negative_lookup_stats(_secondary_supers_bitmap, st); st->cr();
1321 }
1322 } else {
1323 st->print("null");
1324 }
1325 }
1326
1327 void Klass::on_secondary_supers_verification_failure(Klass* super, Klass* sub, bool linear_result, bool table_result, const char* msg) {
1328 ResourceMark rm;
1329 super->print();
1330 sub->print();
1331 fatal("%s: %s implements %s: linear_search: %d; table_lookup: %d",
1332 msg, sub->external_name(), super->external_name(), linear_result, table_result);
1333 }
1334
1335 static int expanded = 0;
1336 static int not_expanded = 0;
1337 static NumberSeq seq = NumberSeq();
1338
1339 bool Klass::expand_for_hash(oop obj) const {
1340 assert(UseCompactObjectHeaders, "only with compact i-hash");
1341 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: %zu", hash_offset_in_bytes(obj), obj->base_size_given_klass(obj->mark(), this) * HeapWordSize);
1342 return obj->base_size_given_klass(obj->mark(), this) * HeapWordSize - hash_offset_in_bytes(obj) < (int)sizeof(uint32_t);
1343 }
|