Skip to content

Commit

Permalink
Merge pull request #11409 from liqunl/badProfileClass-v0.24.0
Browse files Browse the repository at this point in the history
Only load initialized class from SCC into iprofiler data (v0.24.0)
  • Loading branch information
dsouzai committed Dec 8, 2020
2 parents c144b7c + ba7298e commit 5fa3c2f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion runtime/compiler/runtime/IProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3153,7 +3153,13 @@ TR_IPBCDataCallGraph::loadFromPersistentCopy(TR_IPBCDataStorageHeader * storage,
if (comp->fej9()->sharedCache()->isROMClassOffsetInSharedCache(csInfoClazzOffset, &romClass))
ramClass = ((TR_J9VM *)comp->fej9())->matchRAMclassFromROMclass((J9ROMClass *)romClass, comp);

if (ramClass)
// Optimizer and the codegen assume receiver classes of a call from profiling data are initialized,
// otherwise they shouldn't show up in the profile. But classes from iprofiling data from last run
// may be uninitialized in load time, as the program behavior may change in the second run. Thus
// we need to verify that a class is initialized, otherwise optimizer or codegen will make wrong
// transformation based on invalid assumption.
//
if (ramClass && comp->fej9()->isClassInitialized((TR_OpaqueClassBlock*)ramClass))
{
_csInfo.setClazz(i, (uintptr_t)ramClass);
_csInfo._weight[i] = store->_csInfo._weight[i];
Expand Down

0 comments on commit 5fa3c2f

Please sign in to comment.