Skip to content

Commit 2d480d1

Browse files
authored
Merge pull request #21866 from mpirvu/replay-cleanout
Delete unused IProfiler code related to comp replay
2 parents d8c2445 + 8aa5ac9 commit 2d480d1

File tree

2 files changed

+0
-90
lines changed

2 files changed

+0
-90
lines changed

runtime/compiler/runtime/IProfiler.cpp

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -3512,93 +3512,6 @@ TR_IProfiler::countEntries()
35123512
return count;
35133513
}
35143514

3515-
3516-
// helper functions for replay
3517-
//
3518-
void TR_IProfiler::setupEntriesInHashTable(TR_IProfiler *ip)
3519-
{
3520-
for (int32_t bucket = 0; bucket < TR::Options::_iProfilerBcHashTableSize; bucket++)
3521-
{
3522-
TR_IPBytecodeHashTableEntry *entry = _bcHashTable[bucket], *prevEntry = NULL;
3523-
3524-
while (entry)
3525-
{
3526-
uintptr_t pc = entry->getPC();
3527-
3528-
if (pc == 0 ||
3529-
pc == 0xffffffff)
3530-
{
3531-
printf("invalid pc for entry %p %#" OMR_PRIxPTR "\n", entry, pc);
3532-
fflush(stdout);
3533-
prevEntry = entry;
3534-
entry = entry->getNext();
3535-
continue;
3536-
}
3537-
3538-
3539-
TR_IPBytecodeHashTableEntry *newEntry = ip->findOrCreateEntry(bucket, pc, true);
3540-
// check for entries corresponding to
3541-
// unloaded methods, findOrCreateEntry will
3542-
// return NULL above. its ok to ignore these entries
3543-
// as they are invalid anyway
3544-
//
3545-
if (newEntry)
3546-
ip->copyDataFromEntry(entry, newEntry, NULL);
3547-
prevEntry = entry;
3548-
entry = entry->getNext();
3549-
}
3550-
}
3551-
printf("Finished adding entries from core to new iprofiler\n");
3552-
}
3553-
3554-
void TR_IProfiler::copyDataFromEntry(TR_IPBytecodeHashTableEntry *oldEntry, TR_IPBytecodeHashTableEntry *newEntry, TR_IProfiler *ip)
3555-
{
3556-
U_8 *oldEntryPC = (U_8*)oldEntry->getPC();
3557-
U_8 byteCodeType = *(oldEntryPC);
3558-
if (isSwitch(byteCodeType))
3559-
{
3560-
;// FIXME: dont care about switches at the moment
3561-
}
3562-
else
3563-
{
3564-
// isCompact(byteCodeType) or callGraph entries
3565-
//
3566-
printf("populating entry for pc %p newentrypc %p\n", oldEntryPC, (U_8*)newEntry->getPC());
3567-
// vft entries for whacking
3568-
//
3569-
void *oldVft = *(void**)(oldEntry);
3570-
void *newVft = *(void**)(newEntry);
3571-
*(void**)(oldEntry) = newVft;
3572-
if (isCompact(byteCodeType))
3573-
{
3574-
uintptr_t data = oldEntry->getData();
3575-
//printf("got oldvft = %p newvft = %p data %p\n", oldvft, newvft, data);
3576-
newEntry->setData(data);
3577-
}
3578-
else
3579-
{
3580-
// callGraph entry
3581-
//
3582-
CallSiteProfileInfo *oldCSInfo = ((TR_IPBCDataCallGraph*)(oldEntry))->getCGData();
3583-
CallSiteProfileInfo *newCSInfo = ((TR_IPBCDataCallGraph*)(newEntry))->getCGData();
3584-
printf("got oldCSInfo %p\n", oldCSInfo);
3585-
3586-
if (oldCSInfo)
3587-
{
3588-
for (int32_t i = 0; i < NUM_CS_SLOTS; i++)
3589-
{
3590-
printf("got clazz %#" OMR_PRIxPTR " weight %d\n", oldCSInfo->getClazz(i), oldCSInfo->_weight[i]);
3591-
newCSInfo->setClazz(i, oldCSInfo->getClazz(i));
3592-
newCSInfo->_weight[i] = oldCSInfo->_weight[i];
3593-
}
3594-
}
3595-
3596-
if (((TR_IPBCDataCallGraph*)oldEntry)->isWarmCallGraphTooBig())
3597-
((TR_IPBCDataCallGraph*)newEntry)->setWarmCallGraphTooBig();
3598-
}
3599-
}
3600-
}
3601-
36023515
void TR_IProfiler::checkMethodHashTable()
36033516
{
36043517
static char *fname = feGetEnv("TR_PrintMethodHashTableFileName");

runtime/compiler/runtime/IProfiler.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,6 @@ class TR_IProfiler : public TR_ExternalProfiler
683683
uint32_t *getAllocationProfilingDataPointer(TR_ByteCodeInfo &bcInfo, TR_OpaqueClassBlock *clazz, TR_OpaqueMethodBlock *method, TR::Compilation *comp);
684684
uint32_t *getGlobalAllocationDataPointer(bool isAOT);
685685
TR_ExternalProfiler * canProduceBlockFrequencyInfo(TR::Compilation& comp);
686-
void setupEntriesInHashTable(TR_IProfiler *ip);
687686

688687
TR_IPMethodHashTableEntry *findOrCreateMethodEntry(J9Method *, J9Method *, bool addIt, uint32_t pcIndex = ~0);
689688
// Returns the number of entries released, and also stores the number of
@@ -762,8 +761,6 @@ class TR_IProfiler : public TR_ExternalProfiler
762761
virtual int32_t getFlatSwitchProfileCounts (TR::Node *node, TR::Compilation *comp);
763762
virtual bool isSwitchProfileFlat (TR::Node *node, TR::Compilation *comp);
764763
int32_t getSamplingCount( TR_IPBytecodeHashTableEntry *entry, TR::Compilation *comp);
765-
// for replay
766-
void copyDataFromEntry(TR_IPBytecodeHashTableEntry *oldEntry, TR_IPBytecodeHashTableEntry *newEntry, TR_IProfiler *ip);
767764

768765
TR_IPBCDataStorageHeader *getJ9SharedDataDescriptorForMethod(J9SharedDataDescriptor * descriptor, unsigned char * buffer, uint32_t length, TR_OpaqueMethodBlock * method, TR::Compilation *comp);
769766

0 commit comments

Comments
 (0)