Skip to content

Commit f714d73

Browse files
authored
Merge pull request #20961 from mpirvu/faninfix
Fixes to IProfiler fanin data collection
2 parents c1949d7 + 8282e0f commit f714d73

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

runtime/compiler/runtime/IProfiler.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4313,18 +4313,20 @@ UDATA TR_IProfiler::parseBuffer(J9VMThread * vmThread, const U_8* dataStart, UDA
43134313
if (fanInDisabled)
43144314
break;
43154315
J9ConstantPool* ramCP = J9_CP_FROM_METHOD(caller);
4316-
uint16_t cpIndex = readU16(pc + 1);
4316+
// Read the cpIndex (or the index into the split table) and extend it to UDATA.
4317+
// The extension is needed because J9_STATIC_SPLIT_TABLE_INDEX_FLAG and
4318+
// J9_SPECIAL_SPLIT_TABLE_INDEX_FLAG do not fit on 16 bits.
4319+
UDATA cpIndex = readU16(pc + 1);
43174320

4318-
if (JBinvokestaticsplit == cpIndex)
4321+
// For split bytecodes, the cpIndex is actually the index into the split table.
4322+
if (JBinvokestaticsplit == *pc)
43194323
cpIndex |= J9_STATIC_SPLIT_TABLE_INDEX_FLAG;
4320-
if (JBinvokespecialsplit == cpIndex)
4324+
if (JBinvokespecialsplit == *pc)
43214325
cpIndex |= J9_SPECIAL_SPLIT_TABLE_INDEX_FLAG;
4322-
J9Method * callee = jitGetJ9MethodUsingIndex(vmThread, ramCP, cpIndex);
4326+
J9Method *callee = jitGetJ9MethodUsingIndex(vmThread, ramCP, cpIndex);
43234327

4324-
if (callee == NULL)
4325-
{
4328+
if (!callee)
43264329
break;
4327-
}
43284330

43294331
uint32_t offset = (uint32_t) (pc - caller->bytecodes);
43304332
findOrCreateMethodEntry(caller, callee , true ,offset);

0 commit comments

Comments
 (0)