Skip to content

Commit

Permalink
Merge pull request #20730 from cjjdespres/other-dep
Browse files Browse the repository at this point in the history
Ensure inlined method classes are dependencies
  • Loading branch information
mpirvu authored Dec 7, 2024
2 parents 81ab91c + d892d0a commit 5808d05
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion runtime/compiler/arm/codegen/J9AheadOfTimeCompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ J9::ARM::AheadOfTimeCompile::initializePlatformSpecificAOTRelocationHeader(TR::I
acaRecord->setInlinedSiteIndex(reloTarget, inlinedSiteIndex);
acaRecord->setClassChainIdentifyingLoaderOffsetInSharedCache(reloTarget, classChainIdentifyingLoaderOffsetInSharedCache,
self(), classChainRecord);
acaRecord->setClassChainForInlinedMethod(reloTarget, classChainOffsetInSharedCache, self(), classChainRecord);
acaRecord->setClassChainForInlinedMethod(reloTarget, classChainOffsetInSharedCache, self(), classChainRecord, j9class);
}
break;

Expand Down
8 changes: 4 additions & 4 deletions runtime/compiler/codegen/J9AheadOfTimeCompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ J9::AheadOfTimeCompile::initializeCommonAOTRelocationHeader(TR::IteratedExternal
pRecord->setRomClassOffsetInSharedCache(reloTarget, romClassOffsetInSharedCache, self(), inlinedCodeClass, classChainRecord);
pRecord->setClassChainIdentifyingLoaderOffsetInSharedCache(reloTarget, classChainIdentifyingLoaderOffsetInSharedCache,
self(), classChainRecord);
pRecord->setClassChainForInlinedMethod(reloTarget, classChainOffsetInSharedCache, self(), classChainRecord);
pRecord->setClassChainForInlinedMethod(reloTarget, classChainOffsetInSharedCache, self(), classChainRecord, inlinedCodeClass);
pRecord->setMethodIndex(reloTarget, methodIndex);
}
break;
Expand All @@ -698,7 +698,7 @@ J9::AheadOfTimeCompile::initializeCommonAOTRelocationHeader(TR::IteratedExternal

mpRecord->setInlinedSiteIndex(reloTarget, inlinedSiteIndex);
mpRecord->setClassChainForInlinedMethod(reloTarget, classChainForInlinedMethodOffsetInSharedCache,
self(), classChainRecord);
self(), classChainRecord, j9class);
mpRecord->setClassChainIdentifyingLoaderOffsetInSharedCache(reloTarget, classChainOffsetOfCLInSharedCache,
self(), classChainRecord);
mpRecord->setVTableSlot(reloTarget, vTableOffset);
Expand Down Expand Up @@ -739,7 +739,7 @@ J9::AheadOfTimeCompile::initializeCommonAOTRelocationHeader(TR::IteratedExternal

cpRecord->setInlinedSiteIndex(reloTarget, inlinedSiteIndex);
cpRecord->setClassChainForInlinedMethod(reloTarget, classChainForInlinedMethodOffsetInSharedCache,
self(), classChainRecord);
self(), classChainRecord, j9class);
cpRecord->setClassChainIdentifyingLoaderOffsetInSharedCache(reloTarget, classChainOffsetOfCLInSharedCache,
self(), classChainRecord);
}
Expand Down Expand Up @@ -1224,7 +1224,7 @@ J9::AheadOfTimeCompile::initializeCommonAOTRelocationHeader(TR::IteratedExternal
acaRecord->setInlinedSiteIndex(reloTarget, inlinedSiteIndex);
acaRecord->setClassChainIdentifyingLoaderOffsetInSharedCache(reloTarget, classChainIdentifyingLoaderOffsetInSharedCache,
self(), classChainRecord);
acaRecord->setClassChainForInlinedMethod(reloTarget, classChainOffsetInSharedCache, self(), classChainRecord);
acaRecord->setClassChainForInlinedMethod(reloTarget, classChainOffsetInSharedCache, self(), classChainRecord, j9class);
}
break;

Expand Down
2 changes: 1 addition & 1 deletion runtime/compiler/p/codegen/J9AheadOfTimeCompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ J9::Power::AheadOfTimeCompile::initializePlatformSpecificAOTRelocationHeader(TR:
acaRecord->setInlinedSiteIndex(reloTarget, inlinedSiteIndex);
acaRecord->setClassChainIdentifyingLoaderOffsetInSharedCache(reloTarget, classChainIdentifyingLoaderOffsetInSharedCache,
self(), classChainRecord);
acaRecord->setClassChainForInlinedMethod(reloTarget, classChainOffsetInSharedCache, self(), classChainRecord);
acaRecord->setClassChainForInlinedMethod(reloTarget, classChainOffsetInSharedCache, self(), classChainRecord, j9class);
}
break;

Expand Down
8 changes: 6 additions & 2 deletions runtime/compiler/runtime/RelocationRecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3261,11 +3261,13 @@ TR_RelocationRecordProfiledInlinedMethod::classChainIdentifyingLoaderOffsetInSha
void
TR_RelocationRecordProfiledInlinedMethod::setClassChainForInlinedMethod(
TR_RelocationTarget *reloTarget, uintptr_t classChainForInlinedMethod,
TR::AheadOfTimeCompile *aotCompile, const AOTCacheClassChainRecord *classChainRecord
TR::AheadOfTimeCompile *aotCompile, const AOTCacheClassChainRecord *classChainRecord,
TR_OpaqueClassBlock *classForInlinedMethod
)
{
uintptr_t *addr = &((TR_RelocationRecordProfiledInlinedMethodBinaryTemplate *)_record)->_classChainForInlinedMethod;
reloTarget->storeRelocationRecordValue(classChainForInlinedMethod, addr);
aotCompile->comp()->addAOTMethodDependency(classForInlinedMethod, classChainForInlinedMethod);
#if defined(J9VM_OPT_JITSERVER)
aotCompile->addClassChainSerializationRecord(classChainRecord, addr);
#endif /* defined(J9VM_OPT_JITSERVER) */
Expand Down Expand Up @@ -5887,11 +5889,13 @@ TR_RelocationRecordPointer::classChainIdentifyingLoaderOffsetInSharedCache(TR_Re
void
TR_RelocationRecordPointer::setClassChainForInlinedMethod(
TR_RelocationTarget *reloTarget, uintptr_t classChainForInlinedMethod,
TR::AheadOfTimeCompile *aotCompile, const AOTCacheClassChainRecord *classChainRecord
TR::AheadOfTimeCompile *aotCompile, const AOTCacheClassChainRecord *classChainRecord,
TR_OpaqueClassBlock *classForInlinedMethod
)
{
uintptr_t *addr = &((TR_RelocationRecordPointerBinaryTemplate *)_record)->_classChainForInlinedMethod;
reloTarget->storeRelocationRecordValue(classChainForInlinedMethod, addr);
aotCompile->comp()->addAOTMethodDependency(classForInlinedMethod, classChainForInlinedMethod);
#if defined(J9VM_OPT_JITSERVER)
aotCompile->addClassChainSerializationRecord(classChainRecord, addr);
#endif /* defined(J9VM_OPT_JITSERVER) */
Expand Down
6 changes: 4 additions & 2 deletions runtime/compiler/runtime/RelocationRecord.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,8 @@ class TR_RelocationRecordProfiledInlinedMethod : public TR_RelocationRecordInlin
uintptr_t classChainIdentifyingLoaderOffsetInSharedCache(TR_RelocationTarget *reloTarget);

void setClassChainForInlinedMethod(TR_RelocationTarget *reloTarget, uintptr_t classChainForInlinedMethod,
TR::AheadOfTimeCompile *aotCompile, const AOTCacheClassChainRecord *classChainRecord);
TR::AheadOfTimeCompile *aotCompile, const AOTCacheClassChainRecord *classChainRecord,
TR_OpaqueClassBlock *classForInlinedMethod);
uintptr_t classChainForInlinedMethod(TR_RelocationTarget *reloTarget);

void setMethodIndex(TR_RelocationTarget *reloTarget, uintptr_t methodIndex);
Expand Down Expand Up @@ -1806,7 +1807,8 @@ class TR_RelocationRecordPointer : public TR_RelocationRecordWithInlinedSiteInde
uintptr_t classChainIdentifyingLoaderOffsetInSharedCache(TR_RelocationTarget *reloTarget);

void setClassChainForInlinedMethod(TR_RelocationTarget *reloTarget, uintptr_t classChainOffsetInSharedCache,
TR::AheadOfTimeCompile *aotCompile, const AOTCacheClassChainRecord *classChainRecord);
TR::AheadOfTimeCompile *aotCompile, const AOTCacheClassChainRecord *classChainRecord,
TR_OpaqueClassBlock *classForInlinedMethod);
uintptr_t classChainForInlinedMethod(TR_RelocationTarget *reloTarget);

virtual TR_RelocationRecordAction action(TR_RelocationRuntime *reloRuntime);
Expand Down

0 comments on commit 5808d05

Please sign in to comment.