Skip to content

Commit

Permalink
Add relocation header and debug info for IsClassVisibleRecord
Browse files Browse the repository at this point in the history
This commit adds relocation header info for `IsClassVisibleRecord`
to `J9::AheadOfTimeCompile::initializeCommonAOTRelocationHeader`
and debug info to `J9::AheadOfTimeCompile::dumpRelocationHeaderData`

Issue: eclipse-openj9#4765
Signed-off-by: Dylan Tuttle <[email protected]>
  • Loading branch information
dylanjtuttle committed Oct 4, 2022
1 parent 355c320 commit 3cac491
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions runtime/compiler/codegen/J9AheadOfTimeCompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,18 @@ J9::AheadOfTimeCompile::initializeCommonAOTRelocationHeader(TR::IteratedExternal
}
break;

case TR_ValidateIsClassVisible:
{
TR_RelocationRecordValidateIsClassVisible *icvRecord = reinterpret_cast<TR_RelocationRecordValidateIsClassVisible *>(reloRecord);

TR::IsClassVisibleRecord *svmRecord = reinterpret_cast<TR::IsClassVisibleRecord *>(relocation->getTargetAddress());

icvRecord->setSourceClassID(reloTarget, symValManager->getSymbolIDFromValue(svmRecord->_sourceClass));
icvRecord->setDestClassID(reloTarget, symValManager->getSymbolIDFromValue(svmRecord->_destClass));
icvRecord->setIsVisible(reloTarget, svmRecord->_isVisible);
}
break;

default:
TR_ASSERT(false, "Unknown relo type %d!\n", kind);
comp->failCompilation<J9::AOTRelocationRecordGenerationFailure>("Unknown relo type %d!\n", kind);
Expand Down Expand Up @@ -2215,6 +2227,23 @@ J9::AheadOfTimeCompile::dumpRelocationHeaderData(uint8_t *cursor, bool isVerbose
}
break;

case TR_ValidateIsClassVisible:
{
TR_RelocationRecordValidateIsClassVisible *icvRecord = reinterpret_cast<TR_RelocationRecordValidateIsClassVisible *>(reloRecord);

self()->traceRelocationOffsets(startOfOffsets, offsetSize, endOfCurrentRecord, orderedPair);
if (isVerbose)
{
traceMsg(
self()->comp(),
"\n Validate Is Class Visible: sourceClassID=%d, destClassID=%d, isVisible=%s ",
(uint32_t)icvRecord->sourceClassID(reloTarget),
(uint32_t)icvRecord->destClassID(reloTarget),
icvRecord->isVisible(reloTarget) ? "true" : "false");
}
}
break;

default:
TR_ASSERT_FATAL(false, "dumpRelocationHeaderData: unknown relo kind %d\n", kind);
}
Expand Down

0 comments on commit 3cac491

Please sign in to comment.