Skip to content

Commit

Permalink
Add the correct address as ClassUnloading PicSite in POWER LE
Browse files Browse the repository at this point in the history
POWER patches class unload constants by `address |= 1` of a 32bit
value given it might be an instruction, to correctly invalidate the
constant we offset the `acursor` differently for LE and BE to
overwrite the least-significant bit in the constant.

Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
  • Loading branch information
rmnattas committed Oct 10, 2024
1 parent 61b10e6 commit d2883d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/p/codegen/OMRConstantDataSnippet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,11 @@ OMR::ConstantDataSnippet::emitAddressConstant(PPCConstant<intptr_t> *acursor, ui
{
// Register an unload assumption on the lower 32bit of the class constant.
// The patching code thinks it's low bit tagging an instruction not a class pointer!!
int PICOffset = 0; // For LE or BE 32-bit
if (cg()->comp()->target().cpu.isBigEndian() && cg()->comp()->target().is64Bit())
PICOffset = 4;
cg()->
jitAddPicToPatchOnClassUnload((void *)acursor->getConstantValue(), (void *)(codeCursor+((cg()->comp()->target().is64Bit())?4:0)) );
jitAddPicToPatchOnClassUnload((void *)acursor->getConstantValue(), (void *)(codeCursor+PICOffset));
}
}

Expand Down

0 comments on commit d2883d3

Please sign in to comment.