@@ -521,10 +521,15 @@ void ConstantPool::archive_entries() {
521
521
}
522
522
}
523
523
524
- #if 0
525
- static const char* get_type(Klass* buffered_k) {
524
+ static const char * get_type (Klass* k) {
526
525
const char * type;
527
- Klass* src_k = ArchiveBuilder::current()->get_source_addr(buffered_k);
526
+ Klass* src_k;
527
+ if (ArchiveBuilder::is_active () && ArchiveBuilder::current ()->is_in_buffer_space (k)) {
528
+ src_k = ArchiveBuilder::current ()->get_source_addr (k);
529
+ } else {
530
+ src_k = k;
531
+ }
532
+
528
533
if (src_k->is_objArray_klass ()) {
529
534
src_k = ObjArrayKlass::cast (src_k)->bottom_klass ();
530
535
assert (!src_k->is_objArray_klass (), " sanity" );
@@ -549,7 +554,6 @@ static const char* get_type(Klass* buffered_k) {
549
554
550
555
return type;
551
556
}
552
- #endif
553
557
554
558
bool ConstantPool::maybe_archive_resolved_klass_at (int cp_index) {
555
559
assert (ArchiveBuilder::current ()->is_in_buffer_space (this ), " must be" );
@@ -573,18 +577,10 @@ bool ConstantPool::maybe_archive_resolved_klass_at(int cp_index) {
573
577
if (ClassPrelinker::can_archive_resolved_klass (src_cp, cp_index)) {
574
578
if (log_is_enabled (Debug, cds, resolve)) {
575
579
ResourceMark rm;
576
- #if 0
577
- // FIXME: get_type() fails with runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java
578
580
log_debug (cds, resolve)(" archived klass CP entry [%3d]: %s %s => %s %s%s" , cp_index,
579
- get_type(pool_holder()), pool_holder()->name()->as_C_string(),
580
- get_type(k), k->name()->as_C_string(),
581
- pool_holder()->is_subtype_of(k) ? "" : " (not supertype)");
582
- #else
583
- log_debug (cds, resolve)(" archived klass CP entry [%3d]: %s => %s%s" , cp_index,
584
- pool_holder ()->name ()->as_C_string (),
585
- k->name ()->as_C_string (),
581
+ pool_holder ()->name ()->as_C_string (), get_type (pool_holder ()),
582
+ k->name ()->as_C_string (), get_type (k),
586
583
pool_holder ()->is_subtype_of (k) ? " " : " (not supertype)" );
587
- #endif
588
584
}
589
585
return true ;
590
586
}
0 commit comments