< prev index next >

src/hotspot/share/code/relocInfo.cpp

Print this page
*** 20,10 ***
--- 20,12 ---
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   *
   */
  
+ #include "ci/ciUtilities.hpp"
+ #include "code/aotCodeCache.hpp"
  #include "code/codeCache.hpp"
  #include "code/compiledIC.hpp"
  #include "code/nmethod.hpp"
  #include "code/relocInfo.hpp"
  #include "memory/resourceArea.hpp"

*** 153,11 ***
    assert(begin == nullptr || begin >= nm->code_begin(), "in bounds");
    assert(limit == nullptr || limit <= nm->code_end(),   "in bounds");
    set_limits(begin, limit);
  }
  
- 
  RelocIterator::RelocIterator(CodeSection* cs, address begin, address limit) {
    initialize_misc();
    assert(((cs->locs_start() != nullptr) && (cs->locs_end() != nullptr)), "valid start and end pointer");
    _current = cs->locs_start() - 1;
    _end     = cs->locs_end();
--- 155,10 ---

*** 498,11 ***
    // updating relocations in AOTCodeReader::read_relocations().
    p = add_jint(p, index);
    dest->set_locs_end((relocInfo*) p);
  }
  
- 
  void external_word_Relocation::unpack_data() {
    int index = unpack_1_int();
    _target = ExternalsRecorder::at(index);
  }
  
--- 499,10 ---

*** 767,10 ***
--- 767,18 ---
      set_value(_target);
    }
    // If target is nullptr, this is  an absolute embedded reference to an external
    // location, which means  there is nothing to fix here.  In either case, the
    // resulting target should be an "external" address.
+ #ifdef ASSERT
+   if (AOTCodeCache::is_on()) {
+     // AOTCode needs relocation info for card table base which may point to CodeCache
+     if (is_card_table_address(target())) {
+       return;
+     }
+   }
+ #endif
    postcond(src->section_index_of(target()) == CodeBuffer::SECT_NONE);
    postcond(dest->section_index_of(target()) == CodeBuffer::SECT_NONE);
  }
  
  

*** 828,10 ***
--- 836,11 ---
    default:
      return "UNKNOWN RELOC TYPE";
    }
  }
  
+ 
  void RelocIterator::print_current_on(outputStream* st) {
    if (!has_current()) {
      st->print_cr("(no relocs)");
      return;
    }

*** 859,12 ***
        if (code() != nullptr || r->oop_is_immediate()) {
          oop_addr  = r->oop_addr();
          raw_oop   = *oop_addr;
          oop_value = r->oop_value();
        }
!       st->print(" | [oop_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT "]",
!                  p2i(oop_addr), p2i(raw_oop));
        // Do not print the oop by default--we want this routine to
        // work even during GC or other inconvenient times.
        if (WizardMode && oop_value != nullptr) {
          st->print("oop_value=" INTPTR_FORMAT ": ", p2i(oop_value));
          if (oopDesc::is_oop(oop_value)) {
--- 868,12 ---
        if (code() != nullptr || r->oop_is_immediate()) {
          oop_addr  = r->oop_addr();
          raw_oop   = *oop_addr;
          oop_value = r->oop_value();
        }
!       st->print(" | [oop_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT " index=%d]",
!                  p2i(oop_addr), p2i(raw_oop), r->oop_index());
        // Do not print the oop by default--we want this routine to
        // work even during GC or other inconvenient times.
        if (WizardMode && oop_value != nullptr) {
          st->print("oop_value=" INTPTR_FORMAT ": ", p2i(oop_value));
          if (oopDesc::is_oop(oop_value)) {

*** 882,12 ***
        if (code() != nullptr || r->metadata_is_immediate()) {
          metadata_addr  = r->metadata_addr();
          raw_metadata   = *metadata_addr;
          metadata_value = r->metadata_value();
        }
!       st->print(" | [metadata_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT "]",
!                  p2i(metadata_addr), p2i(raw_metadata));
        if (metadata_value != nullptr) {
          st->print("metadata_value=" INTPTR_FORMAT ": ", p2i(metadata_value));
          metadata_value->print_value_on(st);
        }
        break;
--- 891,12 ---
        if (code() != nullptr || r->metadata_is_immediate()) {
          metadata_addr  = r->metadata_addr();
          raw_metadata   = *metadata_addr;
          metadata_value = r->metadata_value();
        }
!       st->print(" | [metadata_addr=" INTPTR_FORMAT " *=" INTPTR_FORMAT " index=%d]",
!                  p2i(metadata_addr), p2i(raw_metadata), r->metadata_index());
        if (metadata_value != nullptr) {
          st->print("metadata_value=" INTPTR_FORMAT ": ", p2i(metadata_value));
          metadata_value->print_value_on(st);
        }
        break;

*** 926,11 ***
            st->print(" Stub::%s", desc->name());
          }
        } else {
          CodeBlob* cb = CodeCache::find_blob(dest);
          if (cb != nullptr) {
!           st->print(" %s", cb->name());
          } else {
            ResourceMark rm;
            const int buflen = 1024;
            char* buf = NEW_RESOURCE_ARRAY(char, buflen);
            int offset;
--- 935,11 ---
            st->print(" Stub::%s", desc->name());
          }
        } else {
          CodeBlob* cb = CodeCache::find_blob(dest);
          if (cb != nullptr) {
!           st->print(" Blob::%s", cb->name());
          } else {
            ResourceMark rm;
            const int buflen = 1024;
            char* buf = NEW_RESOURCE_ARRAY(char, buflen);
            int offset;
< prev index next >