Platform ports that use this RelocInfo kind need to implement
set_target_internal_reference accordingly to distinguish between
INTERNAL_REFERENCE and INTERNAL_REFERENCE_ENCODED.
R=svenpanne@chromium.org
Review URL: https://codereview.chromium.org/
1000373003
Cr-Commit-Position: refs/heads/master@{#27177}
return "external reference";
case RelocInfo::INTERNAL_REFERENCE:
return "internal reference";
+ case RelocInfo::INTERNAL_REFERENCE_ENCODED:
+ return "encoded internal reference";
case RelocInfo::DEOPT_REASON:
return "deopt reason";
case RelocInfo::CONST_POOL:
case STATEMENT_POSITION:
case EXTERNAL_REFERENCE:
case INTERNAL_REFERENCE:
+ case INTERNAL_REFERENCE_ENCODED:
case DEOPT_REASON:
case CONST_POOL:
case VENEER_POOL:
EXTERNAL_REFERENCE, // The address of an external C++ function.
INTERNAL_REFERENCE, // An address inside the same function.
+ // Encoded internal reference, used only on MIPS, MIPS64 and PPC.
+ INTERNAL_REFERENCE_ENCODED,
+
// Marks constant and veneer pools. Only used on ARM and ARM64.
// They use a custom noncompact encoding.
CONST_POOL,
CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by
// code aging.
- // Encoded internal reference, used only on MIPS and MIPS64.
- // Re-uses previous ARM-only encoding, to fit in RealRelocMode space.
- INTERNAL_REFERENCE_ENCODED = CONST_POOL,
-
FIRST_REAL_RELOC_MODE = CODE_TARGET,
LAST_REAL_RELOC_MODE = VENEER_POOL,
FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE,
// Turn internal references encoded as offsets back to absolute addresses.
Code* code = Code::cast(obj);
Address entry = code->entry();
- int mode_mask = RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE);
+ int mode_mask = RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
+ RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE_ENCODED);
for (RelocIterator it(code, mode_mask); !it.done(); it.next()) {
RelocInfo* rinfo = it.rinfo();
intptr_t offset =
RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY) |
- RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE);
+ RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
+ RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE_ENCODED);
for (RelocIterator it(code, mode_mask); !it.done(); it.next()) {
RelocInfo* rinfo = it.rinfo();
- if (RelocInfo::IsInternalReference(rinfo->rmode())) {
+ RelocInfo::Mode rmode = rinfo->rmode();
+ if (RelocInfo::IsInternalReference(rmode) ||
+ RelocInfo::IsInternalReferenceEncoded(rmode)) {
// Convert internal references to relative offsets.
Address target = rinfo->target_internal_reference();
intptr_t offset = target - entry;