< prev index next > src/hotspot/share/code/relocInfo.cpp
Print this page
* 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"
assert(limit == nullptr || limit <= cs->end(), "in bounds");
set_limits(begin, limit);
}
RelocIterator::RelocIterator(CodeBlob* cb) {
- initialize_misc();
if (cb->is_nmethod()) {
! _code = cb->as_nmethod();
! } else {
- _code = nullptr;
}
_current = cb->relocation_begin() - 1;
_end = cb->relocation_end();
_addr = cb->content_begin();
_section_start[CodeBuffer::SECT_CONSTS] = cb->content_begin();
assert(limit == nullptr || limit <= cs->end(), "in bounds");
set_limits(begin, limit);
}
RelocIterator::RelocIterator(CodeBlob* cb) {
if (cb->is_nmethod()) {
! initialize(cb->as_nmethod(), nullptr, nullptr);
! return;
}
+ initialize_misc();
+ _code = nullptr;
_current = cb->relocation_begin() - 1;
_end = cb->relocation_end();
_addr = cb->content_begin();
_section_start[CodeBuffer::SECT_CONSTS] = cb->content_begin();
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);
}
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)) {
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)) {
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;
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;
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;
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 >