@@ -525,7 +525,7 @@ void CodeBuffer::finalize_oop_references(const methodHandle& mh) {
525
525
for (int n = (int ) SECT_FIRST; n < (int ) SECT_LIMIT; n++) {
526
526
// pull code out of each section
527
527
CodeSection* cs = code_section (n);
528
- if (cs->is_empty () || ! cs->has_locs ( )) continue ; // skip trivial section
528
+ if (cs->is_empty () || ( cs->locs_count () == 0 )) continue ; // skip trivial section
529
529
RelocIterator iter (cs);
530
530
while (iter.next ()) {
531
531
if (iter.type () == relocInfo::metadata_type) {
@@ -791,10 +791,8 @@ void CodeBuffer::relocate_code_to(CodeBuffer* dest) const {
791
791
// call) is relocated. Stubs are placed behind the main code
792
792
// section, so that section has to be copied before relocating.
793
793
for (int n = (int ) SECT_FIRST; n < (int )SECT_LIMIT; n++) {
794
- // pull code out of each section
795
- const CodeSection* cs = code_section (n);
796
- if (cs->is_empty () || !cs->has_locs ()) continue ; // skip trivial section
797
794
CodeSection* dest_cs = dest->code_section (n);
795
+ if (dest_cs->is_empty () || (dest_cs->locs_count () == 0 )) continue ; // skip trivial section
798
796
{ // Repair the pc relative information in the code after the move
799
797
RelocIterator iter (dest_cs);
800
798
while (iter.next ()) {
@@ -1057,7 +1055,7 @@ void CodeSection::print(const char* name) {
1057
1055
name, p2i (start ()), p2i (end ()), p2i (limit ()), size (), capacity ());
1058
1056
tty->print_cr (" %7s.locs = " PTR_FORMAT " : " PTR_FORMAT " : " PTR_FORMAT " (%d of %d) point=%d" ,
1059
1057
name, p2i (locs_start ()), p2i (locs_end ()), p2i (locs_limit ()), locs_size, locs_capacity (), locs_point_off ());
1060
- if (PrintRelocations) {
1058
+ if (PrintRelocations && (locs_size != 0 ) ) {
1061
1059
RelocIterator iter (this );
1062
1060
iter.print ();
1063
1061
}
0 commit comments