Skip to content

Commit

Permalink
AArch64: Change ConstantDataSnippet to use targetaddress2 for non-aco…
Browse files Browse the repository at this point in the history
…nst node

Change ConstantDataSnippet to use targetaddress2 parameter to
constructors of `TR_ExternalRelocation` class if the node is not `aconst`
because some evaluators in downstream projects would use ConstantDataSnippet for loading
address constant with non-aconst node.

Signed-off-by: Akira Saitoh <saiaki@jp.ibm.com>
  • Loading branch information
Akira Saitoh committed Oct 19, 2020
1 parent d2cc022 commit fdded35
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions compiler/aarch64/codegen/ConstantDataSnippet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,17 @@ TR::ARM64ConstantDataSnippet::addMetaDataForCodeAddress(uint8_t *cursor)
}
else
{
cg()->addExternalRelocation(new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor,
reinterpret_cast<uint8_t *>(node),
reloType,
cg()),
__FILE__, __LINE__,
node);
TR::Relocation *relo;
//for optimizations where we are trying to relocate either profiled j9class or getfrom signature we can't use node to get the target address
//so we need to pass it to relocation in targetaddress2 for now
uint8_t * targetAdress2 = NULL;
if (getNode()->getOpCodeValue() != TR::aconst)
{
targetAdress2 = reinterpret_cast<uint8_t *>(*(reinterpret_cast<uint64_t*>(cursor)));
}
relo = new (cg()->trHeapMemory()) TR::ExternalRelocation(cursor, reinterpret_cast<uint8_t *>(node),
targetAdress2, reloType, cg());
cg()->addExternalRelocation(relo, __FILE__, __LINE__, node);
}
break;

Expand Down

0 comments on commit fdded35

Please sign in to comment.