< prev index next >

src/hotspot/share/code/relocInfo.cpp

Print this page

   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"

  26 #include "code/codeCache.hpp"
  27 #include "code/compiledIC.hpp"
  28 #include "code/nmethod.hpp"
  29 #include "code/relocInfo.hpp"

  30 #include "memory/resourceArea.hpp"
  31 #include "memory/universe.hpp"
  32 #include "oops/compressedOops.inline.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "runtime/flags/flagSetting.hpp"
  35 #include "runtime/stubCodeGenerator.hpp"
  36 #include "utilities/align.hpp"
  37 #include "utilities/checkedCast.hpp"
  38 #include "utilities/copy.hpp"
  39 
  40 #include <new>
  41 #include <type_traits>
  42 
  43 const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
  44 
  45 
  46 // Implementation of relocInfo
  47 
  48 #ifdef ASSERT
  49 relocInfo::relocType relocInfo::check_relocType(relocType type) {

 157   _addr    = cs->start();
 158   _code    = nullptr; // Not cb->blob();
 159 
 160   CodeBuffer* cb = cs->outer();
 161   assert((int) SECT_LIMIT == CodeBuffer::SECT_LIMIT, "my copy must be equal");
 162   for (int n = (int) CodeBuffer::SECT_FIRST; n < (int) CodeBuffer::SECT_LIMIT; n++) {
 163     CodeSection* cs = cb->code_section(n);
 164     _section_start[n] = cs->start();
 165     _section_end  [n] = cs->end();
 166   }
 167 
 168   assert(!has_current(), "just checking");
 169 
 170   assert(begin == nullptr || begin >= cs->start(), "in bounds");
 171   assert(limit == nullptr || limit <= cs->end(),   "in bounds");
 172   set_limits(begin, limit);
 173 }
 174 
 175 bool RelocIterator::addr_in_const() const {
 176   const int n = CodeBuffer::SECT_CONSTS;



 177   return section_start(n) <= addr() && addr() < section_end(n);
 178 }
 179 
 180 
 181 void RelocIterator::set_limits(address begin, address limit) {
 182   _limit = limit;
 183 
 184   // the limit affects this next stuff:
 185   if (begin != nullptr) {
 186     relocInfo* backup;
 187     address    backup_addr;
 188     while (true) {
 189       backup      = _current;
 190       backup_addr = _addr;
 191       if (!next() || addr() >= begin) break;
 192     }
 193     // At this point, either we are at the first matching record,
 194     // or else there is no such record, and !has_current().
 195     // In either case, revert to the immediately preceding state.
 196     _current = backup;

 460 
 461 void static_stub_Relocation::unpack_data() {
 462   address base = binding()->section_start(CodeBuffer::SECT_INSTS);
 463   jint offset = unpack_1_int();
 464   _static_call = address_from_scaled_offset(offset, base);
 465 }
 466 
 467 void trampoline_stub_Relocation::pack_data_to(CodeSection* dest ) {
 468   short* p = (short*) dest->locs_end();
 469   CodeSection* insts = dest->outer()->insts();
 470   normalize_address(_owner, insts);
 471   p = pack_1_int_to(p, scaled_offset(_owner, insts->start()));
 472   dest->set_locs_end((relocInfo*) p);
 473 }
 474 
 475 void trampoline_stub_Relocation::unpack_data() {
 476   address base = binding()->section_start(CodeBuffer::SECT_INSTS);
 477   _owner = address_from_scaled_offset(unpack_1_int(), base);
 478 }
 479 
 480 void external_word_Relocation::pack_data_to(CodeSection* dest) {
 481   short* p = (short*) dest->locs_end();
 482 #ifndef _LP64
 483   p = pack_1_int_to(p, (int32_t) (intptr_t)_target);
 484 #else
 485   jlong t = (jlong) _target;
 486   int32_t lo = low(t);
 487   int32_t hi = high(t);
 488   p = pack_2_ints_to(p, lo, hi);
 489 #endif /* _LP64 */
 490   dest->set_locs_end((relocInfo*) p);
 491 }
 492 




 493 
 494 void external_word_Relocation::unpack_data() {
 495 #ifndef _LP64
 496   _target = (address) (intptr_t)unpack_1_int();
 497 #else
 498   jint lo, hi;
 499   unpack_2_ints(lo, hi);
 500   jlong t = jlong_from(hi, lo);;
 501   _target = (address) t;
 502 #endif /* _LP64 */
 503 }
 504 
 505 
 506 void internal_word_Relocation::pack_data_to(CodeSection* dest) {
 507   short* p = (short*) dest->locs_end();
 508   normalize_address(_target, dest, true);
 509 
 510   // Check whether my target address is valid within this section.
 511   // If not, strengthen the relocation type to point to another section.
 512   int sindex = _section;

 748 
 749   return nullptr;
 750 }
 751 
 752 void static_stub_Relocation::clear_inline_cache() {
 753   // Call stub is only used when calling the interpreted code.
 754   // It does not really need to be cleared, except that we want to clean out the methodoop.
 755   CompiledDirectCall::set_stub_to_clean(this);
 756 }
 757 
 758 
 759 void external_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
 760   if (_target != nullptr) {
 761     // Probably this reference is absolute,  not relative, so the following is
 762     // probably a no-op.
 763     set_value(_target);
 764   }
 765   // If target is nullptr, this is  an absolute embedded reference to an external
 766   // location, which means  there is nothing to fix here.  In either case, the
 767   // resulting target should be an "external" address.








 768   postcond(src->section_index_of(target()) == CodeBuffer::SECT_NONE);
 769   postcond(dest->section_index_of(target()) == CodeBuffer::SECT_NONE);
 770 }
 771 
 772 
 773 address external_word_Relocation::target() {
 774   address target = _target;
 775   if (target == nullptr) {
 776     target = pd_get_address_from_code();
 777   }
 778   return target;
 779 }
 780 
 781 
 782 void internal_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
 783   address target = _target;
 784   if (target == nullptr) {
 785     target = new_addr_for(this->target(), src, dest);
 786   }
 787   set_value(target);

 838   } else if (datalen() > 0) {
 839     tty->print(" data={");
 840     for (int i = 0; i < datalen(); i++) {
 841       tty->print("%04x", data()[i] & 0xFFFF);
 842     }
 843     tty->print("}");
 844   }
 845   tty->print("]");
 846   switch (type()) {
 847   case relocInfo::oop_type:
 848     {
 849       oop_Relocation* r = oop_reloc();
 850       oop* oop_addr  = nullptr;
 851       oop  raw_oop   = nullptr;
 852       oop  oop_value = nullptr;
 853       if (code() != nullptr || r->oop_is_immediate()) {
 854         oop_addr  = r->oop_addr();
 855         raw_oop   = *oop_addr;
 856         oop_value = r->oop_value();
 857       }
 858       tty->print(" | [oop_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT " offset=%d]",
 859                  p2i(oop_addr), p2i(raw_oop), r->offset());
 860       // Do not print the oop by default--we want this routine to
 861       // work even during GC or other inconvenient times.
 862       if (WizardMode && oop_value != nullptr) {
 863         tty->print("oop_value=" INTPTR_FORMAT ": ", p2i(oop_value));
 864         if (oopDesc::is_oop(oop_value)) {
 865           oop_value->print_value_on(tty);
 866         }
 867       }
 868       break;
 869     }
 870   case relocInfo::metadata_type:
 871     {
 872       metadata_Relocation* r = metadata_reloc();
 873       Metadata** metadata_addr  = nullptr;
 874       Metadata*    raw_metadata   = nullptr;
 875       Metadata*    metadata_value = nullptr;
 876       if (code() != nullptr || r->metadata_is_immediate()) {
 877         metadata_addr  = r->metadata_addr();
 878         raw_metadata   = *metadata_addr;
 879         metadata_value = r->metadata_value();
 880       }
 881       tty->print(" | [metadata_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT " offset=%d]",
 882                  p2i(metadata_addr), p2i(raw_metadata), r->offset());
 883       if (metadata_value != nullptr) {
 884         tty->print("metadata_value=" INTPTR_FORMAT ": ", p2i(metadata_value));
 885         metadata_value->print_value_on(tty);
 886       }
 887       break;
 888     }
 889   case relocInfo::external_word_type:
 890   case relocInfo::internal_word_type:
 891   case relocInfo::section_word_type:
 892     {
 893       DataRelocation* r = (DataRelocation*) reloc();
 894       tty->print(" | [target=" INTPTR_FORMAT "]", p2i(r->value())); //value==target
 895       break;
 896     }
 897   case relocInfo::static_call_type:
 898     {
 899       static_call_Relocation* r = (static_call_Relocation*) reloc();
 900       tty->print(" | [destination=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
 901                  p2i(r->destination()), p2i(r->method_value()));




 902       break;
 903     }
 904   case relocInfo::runtime_call_type:
 905   case relocInfo::runtime_call_w_cp_type:
 906     {
 907       CallRelocation* r = (CallRelocation*) reloc();
 908       tty->print(" | [destination=" INTPTR_FORMAT "]", p2i(r->destination()));


























 909       break;
 910     }
 911   case relocInfo::virtual_call_type:
 912     {
 913       virtual_call_Relocation* r = (virtual_call_Relocation*) reloc();
 914       tty->print(" | [destination=" INTPTR_FORMAT " cached_value=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
 915                  p2i(r->destination()), p2i(r->cached_value()), p2i(r->method_value()));




 916       break;
 917     }
 918   case relocInfo::static_stub_type:
 919     {
 920       static_stub_Relocation* r = (static_stub_Relocation*) reloc();
 921       tty->print(" | [static_call=" INTPTR_FORMAT "]", p2i(r->static_call()));
 922       break;
 923     }
 924   case relocInfo::trampoline_stub_type:
 925     {
 926       trampoline_stub_Relocation* r = (trampoline_stub_Relocation*) reloc();
 927       tty->print(" | [trampoline owner=" INTPTR_FORMAT "]", p2i(r->owner()));
 928       break;
 929     }
 930   case relocInfo::opt_virtual_call_type:
 931     {
 932       opt_virtual_call_Relocation* r = (opt_virtual_call_Relocation*) reloc();
 933       tty->print(" | [destination=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
 934                  p2i(r->destination()), p2i(r->method_value()));




 935       break;
 936     }
 937   default:
 938     break;
 939   }
 940   tty->cr();
 941 }
 942 
 943 
 944 void RelocIterator::print() {
 945   RelocIterator save_this = (*this);
 946   relocInfo* scan = _current;
 947   if (!has_current())  scan += 1;  // nothing to scan here!
 948 
 949   bool skip_next = has_current();
 950   bool got_next;
 951   while (true) {
 952     got_next = (skip_next || next());
 953     skip_next = false;
 954 

   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/ciUtilities.hpp"
  27 #include "code/codeCache.hpp"
  28 #include "code/compiledIC.hpp"
  29 #include "code/nmethod.hpp"
  30 #include "code/relocInfo.hpp"
  31 #include "code/SCCache.hpp"
  32 #include "memory/resourceArea.hpp"
  33 #include "memory/universe.hpp"
  34 #include "oops/compressedOops.inline.hpp"
  35 #include "oops/oop.inline.hpp"
  36 #include "runtime/flags/flagSetting.hpp"
  37 #include "runtime/stubCodeGenerator.hpp"
  38 #include "utilities/align.hpp"
  39 #include "utilities/checkedCast.hpp"
  40 #include "utilities/copy.hpp"
  41 
  42 #include <new>
  43 #include <type_traits>
  44 
  45 const RelocationHolder RelocationHolder::none; // its type is relocInfo::none
  46 
  47 
  48 // Implementation of relocInfo
  49 
  50 #ifdef ASSERT
  51 relocInfo::relocType relocInfo::check_relocType(relocType type) {

 159   _addr    = cs->start();
 160   _code    = nullptr; // Not cb->blob();
 161 
 162   CodeBuffer* cb = cs->outer();
 163   assert((int) SECT_LIMIT == CodeBuffer::SECT_LIMIT, "my copy must be equal");
 164   for (int n = (int) CodeBuffer::SECT_FIRST; n < (int) CodeBuffer::SECT_LIMIT; n++) {
 165     CodeSection* cs = cb->code_section(n);
 166     _section_start[n] = cs->start();
 167     _section_end  [n] = cs->end();
 168   }
 169 
 170   assert(!has_current(), "just checking");
 171 
 172   assert(begin == nullptr || begin >= cs->start(), "in bounds");
 173   assert(limit == nullptr || limit <= cs->end(),   "in bounds");
 174   set_limits(begin, limit);
 175 }
 176 
 177 bool RelocIterator::addr_in_const() const {
 178   const int n = CodeBuffer::SECT_CONSTS;
 179   if (_section_start[n] == nullptr) {
 180     return false;
 181   }
 182   return section_start(n) <= addr() && addr() < section_end(n);
 183 }
 184 
 185 
 186 void RelocIterator::set_limits(address begin, address limit) {
 187   _limit = limit;
 188 
 189   // the limit affects this next stuff:
 190   if (begin != nullptr) {
 191     relocInfo* backup;
 192     address    backup_addr;
 193     while (true) {
 194       backup      = _current;
 195       backup_addr = _addr;
 196       if (!next() || addr() >= begin) break;
 197     }
 198     // At this point, either we are at the first matching record,
 199     // or else there is no such record, and !has_current().
 200     // In either case, revert to the immediately preceding state.
 201     _current = backup;

 465 
 466 void static_stub_Relocation::unpack_data() {
 467   address base = binding()->section_start(CodeBuffer::SECT_INSTS);
 468   jint offset = unpack_1_int();
 469   _static_call = address_from_scaled_offset(offset, base);
 470 }
 471 
 472 void trampoline_stub_Relocation::pack_data_to(CodeSection* dest ) {
 473   short* p = (short*) dest->locs_end();
 474   CodeSection* insts = dest->outer()->insts();
 475   normalize_address(_owner, insts);
 476   p = pack_1_int_to(p, scaled_offset(_owner, insts->start()));
 477   dest->set_locs_end((relocInfo*) p);
 478 }
 479 
 480 void trampoline_stub_Relocation::unpack_data() {
 481   address base = binding()->section_start(CodeBuffer::SECT_INSTS);
 482   _owner = address_from_scaled_offset(unpack_1_int(), base);
 483 }
 484 
 485 short* external_word_Relocation::pack_data_to(short* p) {

 486 #ifndef _LP64
 487   return pack_1_int_to(p, (int32_t) (intptr_t)_target);
 488 #else
 489   jlong t = (jlong) _target;
 490   int32_t lo = low(t);
 491   int32_t hi = high(t);
 492   return pack_2_ints_to(p, lo, hi);
 493 #endif /* _LP64 */

 494 }
 495 
 496 void external_word_Relocation::pack_data_to(CodeSection* dest) {
 497   short* p = (short*) dest->locs_end();
 498   dest->set_locs_end((relocInfo*)pack_data_to(p));
 499 }
 500 
 501 void external_word_Relocation::unpack_data() {
 502 #ifndef _LP64
 503   _target = (address) (intptr_t)unpack_1_int();
 504 #else
 505   jint lo, hi;
 506   unpack_2_ints(lo, hi);
 507   jlong t = jlong_from(hi, lo);;
 508   _target = (address) t;
 509 #endif /* _LP64 */
 510 }
 511 
 512 
 513 void internal_word_Relocation::pack_data_to(CodeSection* dest) {
 514   short* p = (short*) dest->locs_end();
 515   normalize_address(_target, dest, true);
 516 
 517   // Check whether my target address is valid within this section.
 518   // If not, strengthen the relocation type to point to another section.
 519   int sindex = _section;

 755 
 756   return nullptr;
 757 }
 758 
 759 void static_stub_Relocation::clear_inline_cache() {
 760   // Call stub is only used when calling the interpreted code.
 761   // It does not really need to be cleared, except that we want to clean out the methodoop.
 762   CompiledDirectCall::set_stub_to_clean(this);
 763 }
 764 
 765 
 766 void external_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
 767   if (_target != nullptr) {
 768     // Probably this reference is absolute,  not relative, so the following is
 769     // probably a no-op.
 770     set_value(_target);
 771   }
 772   // If target is nullptr, this is  an absolute embedded reference to an external
 773   // location, which means  there is nothing to fix here.  In either case, the
 774   // resulting target should be an "external" address.
 775 #ifdef ASSERT
 776   if (SCCache::is_on()) {
 777     // SCA needs relocation info for card table base which may point to CodeCache
 778     if (is_card_table_address(target())) {
 779       return;
 780     }
 781   }
 782 #endif
 783   postcond(src->section_index_of(target()) == CodeBuffer::SECT_NONE);
 784   postcond(dest->section_index_of(target()) == CodeBuffer::SECT_NONE);
 785 }
 786 
 787 
 788 address external_word_Relocation::target() {
 789   address target = _target;
 790   if (target == nullptr) {
 791     target = pd_get_address_from_code();
 792   }
 793   return target;
 794 }
 795 
 796 
 797 void internal_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
 798   address target = _target;
 799   if (target == nullptr) {
 800     target = new_addr_for(this->target(), src, dest);
 801   }
 802   set_value(target);

 853   } else if (datalen() > 0) {
 854     tty->print(" data={");
 855     for (int i = 0; i < datalen(); i++) {
 856       tty->print("%04x", data()[i] & 0xFFFF);
 857     }
 858     tty->print("}");
 859   }
 860   tty->print("]");
 861   switch (type()) {
 862   case relocInfo::oop_type:
 863     {
 864       oop_Relocation* r = oop_reloc();
 865       oop* oop_addr  = nullptr;
 866       oop  raw_oop   = nullptr;
 867       oop  oop_value = nullptr;
 868       if (code() != nullptr || r->oop_is_immediate()) {
 869         oop_addr  = r->oop_addr();
 870         raw_oop   = *oop_addr;
 871         oop_value = r->oop_value();
 872       }
 873       tty->print(" | [oop_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT " index=%d offset=%d]",
 874                  p2i(oop_addr), p2i(raw_oop), r->oop_index(), r->offset());
 875       // Do not print the oop by default--we want this routine to
 876       // work even during GC or other inconvenient times.
 877       if (WizardMode && oop_value != nullptr) {
 878         tty->print("oop_value=" INTPTR_FORMAT ": ", p2i(oop_value));
 879         if (oopDesc::is_oop(oop_value)) {
 880           oop_value->print_value_on(tty);
 881         }
 882       }
 883       break;
 884     }
 885   case relocInfo::metadata_type:
 886     {
 887       metadata_Relocation* r = metadata_reloc();
 888       Metadata** metadata_addr  = nullptr;
 889       Metadata*    raw_metadata   = nullptr;
 890       Metadata*    metadata_value = nullptr;
 891       if (code() != nullptr || r->metadata_is_immediate()) {
 892         metadata_addr  = r->metadata_addr();
 893         raw_metadata   = *metadata_addr;
 894         metadata_value = r->metadata_value();
 895       }
 896       tty->print(" | [metadata_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT " index=%d offset=%d]",
 897                  p2i(metadata_addr), p2i(raw_metadata), r->metadata_index(), r->offset());
 898       if (metadata_value != nullptr) {
 899         tty->print("metadata_value=" INTPTR_FORMAT ": ", p2i(metadata_value));
 900         metadata_value->print_value_on(tty);
 901       }
 902       break;
 903     }
 904   case relocInfo::external_word_type:
 905   case relocInfo::internal_word_type:
 906   case relocInfo::section_word_type:
 907     {
 908       DataRelocation* r = (DataRelocation*) reloc();
 909       tty->print(" | [target=" INTPTR_FORMAT "]", p2i(r->value())); //value==target
 910       break;
 911     }
 912   case relocInfo::static_call_type:
 913     {
 914       static_call_Relocation* r = (static_call_Relocation*) reloc();
 915       tty->print(" | [destination=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
 916                  p2i(r->destination()), p2i(r->method_value()));
 917       CodeBlob* cb = CodeCache::find_blob(r->destination());
 918       if (cb != nullptr) {
 919         tty->print(" Blob::%s", cb->name());
 920       }
 921       break;
 922     }
 923   case relocInfo::runtime_call_type:
 924   case relocInfo::runtime_call_w_cp_type:
 925     {
 926       CallRelocation* r = (CallRelocation*) reloc();
 927       address dest = r->destination();
 928       tty->print(" | [destination=" INTPTR_FORMAT "]", p2i(dest));
 929       if (StubRoutines::contains(dest)) {
 930         StubCodeDesc* desc = StubCodeDesc::desc_for(dest);
 931         if (desc == nullptr) {
 932           desc = StubCodeDesc::desc_for(dest + frame::pc_return_offset);
 933         }
 934         if (desc != nullptr) {
 935           tty->print(" Stub::%s", desc->name());
 936         }
 937       } else {
 938         CodeBlob* cb = CodeCache::find_blob(dest);
 939         if (cb != nullptr) {
 940           tty->print(" Blob::%s", cb->name());
 941         } else {
 942           ResourceMark rm;
 943           const int buflen = 1024;
 944           char* buf = NEW_RESOURCE_ARRAY(char, buflen);
 945           int offset;
 946           if (os::dll_address_to_function_name(dest, buf, buflen, &offset)) {
 947             tty->print(" %s", buf);
 948             if (offset != 0) {
 949               tty->print("+%d", offset);
 950             }
 951           }
 952         }
 953       }
 954       break;
 955     }
 956   case relocInfo::virtual_call_type:
 957     {
 958       virtual_call_Relocation* r = (virtual_call_Relocation*) reloc();
 959       tty->print(" | [destination=" INTPTR_FORMAT " cached_value=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
 960                  p2i(r->destination()), p2i(r->cached_value()), p2i(r->method_value()));
 961       CodeBlob* cb = CodeCache::find_blob(r->destination());
 962       if (cb != nullptr) {
 963         tty->print(" Blob::%s", cb->name());
 964       }
 965       break;
 966     }
 967   case relocInfo::static_stub_type:
 968     {
 969       static_stub_Relocation* r = (static_stub_Relocation*) reloc();
 970       tty->print(" | [static_call=" INTPTR_FORMAT "]", p2i(r->static_call()));
 971       break;
 972     }
 973   case relocInfo::trampoline_stub_type:
 974     {
 975       trampoline_stub_Relocation* r = (trampoline_stub_Relocation*) reloc();
 976       tty->print(" | [trampoline owner=" INTPTR_FORMAT "]", p2i(r->owner()));
 977       break;
 978     }
 979   case relocInfo::opt_virtual_call_type:
 980     {
 981       opt_virtual_call_Relocation* r = (opt_virtual_call_Relocation*) reloc();
 982       tty->print(" | [destination=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]",
 983                  p2i(r->destination()), p2i(r->method_value()));
 984       CodeBlob* cb = CodeCache::find_blob(r->destination());
 985       if (cb != nullptr) {
 986         tty->print(" Blob::%s", cb->name());
 987       }
 988       break;
 989     }
 990   default:
 991     break;
 992   }
 993   tty->cr();
 994 }
 995 
 996 
 997 void RelocIterator::print() {
 998   RelocIterator save_this = (*this);
 999   relocInfo* scan = _current;
1000   if (!has_current())  scan += 1;  // nothing to scan here!
1001 
1002   bool skip_next = has_current();
1003   bool got_next;
1004   while (true) {
1005     got_next = (skip_next || next());
1006     skip_next = false;
1007 
< prev index next >