Skip to content

Commit bfa3cfd

Browse files
authored
Merge pull request #20091 from jdmpapin/vTableSlot-cpIndex
Remove unused cpIndex parameter of vTableSlot(), virtualCallSelector()
2 parents 92fefdf + 4f864fe commit bfa3cfd

File tree

4 files changed

+12
-24
lines changed

4 files changed

+12
-24
lines changed

runtime/compiler/control/JITClientCompilationThread.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes
17711771
case TR_ResolvedMethodType::VirtualFromCP:
17721772
{
17731773
resolvedMethod = static_cast<TR_ResolvedJ9Method *>(owningMethod->getResolvedPossiblyPrivateVirtualMethod(comp, cpIndex, true, &unresolvedInCP));
1774-
vTableOffset = resolvedMethod ? resolvedMethod->vTableSlot(cpIndex) : 0;
1774+
vTableOffset = resolvedMethod ? resolvedMethod->vTableSlot() : 0;
17751775
break;
17761776
}
17771777
case TR_ResolvedMethodType::Static:
@@ -1787,7 +1787,7 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes
17871787
case TR_ResolvedMethodType::ImproperInterface:
17881788
{
17891789
resolvedMethod = static_cast<TR_ResolvedJ9Method *>(owningMethod->getResolvedImproperInterfaceMethod(comp, cpIndex));
1790-
vTableOffset = resolvedMethod ? resolvedMethod->vTableSlot(cpIndex) : 0;
1790+
vTableOffset = resolvedMethod ? resolvedMethod->vTableSlot() : 0;
17911791
break;
17921792
}
17931793
default:

runtime/compiler/env/j9method.cpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,15 +1024,6 @@ TR_ResolvedRelocatableJ9Method::TR_ResolvedRelocatableJ9Method(TR_OpaqueMethodBl
10241024
setRecognizedMethod(TR::unknownMethod);
10251025
}
10261026
}
1027-
1028-
1029-
}
1030-
1031-
int32_t
1032-
TR_ResolvedRelocatableJ9Method::virtualCallSelector(U_32 cpIndex)
1033-
{
1034-
return TR_ResolvedJ9Method::virtualCallSelector(cpIndex);
1035-
//return -1;
10361027
}
10371028

10381029
bool
@@ -5487,9 +5478,9 @@ TR_ResolvedJ9Method::getExistingJittedBodyInfo()
54875478
}
54885479

54895480
int32_t
5490-
TR_ResolvedJ9Method::virtualCallSelector(U_32 cpIndex)
5481+
TR_ResolvedJ9Method::virtualCallSelector()
54915482
{
5492-
return -(int32_t)(vTableSlot(cpIndex) - TR::Compiler->vm.getInterpreterVTableOffset());
5483+
return -(int32_t)(vTableSlot() - TR::Compiler->vm.getInterpreterVTableOffset());
54935484
}
54945485

54955486
bool
@@ -6487,10 +6478,8 @@ TR_ResolvedJ9Method::startAddressForJNIMethod(TR::Compilation * comp)
64876478
}
64886479

64896480
U_32
6490-
TR_ResolvedJ9Method::vTableSlot(U_32 cpIndex)
6481+
TR_ResolvedJ9Method::vTableSlot()
64916482
{
6492-
TR_ASSERT(cpIndex != -1, "cpIndex shouldn't be -1");
6493-
//UDATA vTableSlot = ((J9RAMVirtualMethodRef *)literals())[cpIndex].methodIndexAndArgCount >> 8;
64946483
return _vTableSlot;
64956484
}
64966485

runtime/compiler/env/j9method.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ class TR_ResolvedJ9Method : public TR_J9Method, public TR_ResolvedJ9MethodBase
441441
virtual uint32_t classCPIndexOfMethod(uint32_t methodCPIndex);
442442
virtual void * & addressOfClassOfMethod();
443443

444-
virtual uint32_t vTableSlot(uint32_t);
444+
virtual uint32_t vTableSlot();
445445

446446
virtual bool isCompilable(TR_Memory *);
447447

@@ -474,7 +474,7 @@ class TR_ResolvedJ9Method : public TR_J9Method, public TR_ResolvedJ9MethodBase
474474
virtual bool virtualMethodIsOverridden();
475475
virtual void setVirtualMethodIsOverridden();
476476
virtual void * addressContainingIsOverriddenBit();
477-
virtual int32_t virtualCallSelector(uint32_t cpIndex);
477+
virtual int32_t virtualCallSelector();
478478

479479
virtual int32_t exceptionData(int32_t exceptionNumber, int32_t * startIndex, int32_t * endIndex, int32_t * catchType);
480480
virtual uint32_t numberOfExceptionHandlers();
@@ -611,7 +611,6 @@ class TR_ResolvedRelocatableJ9Method : public TR_ResolvedJ9Method
611611

612612
virtual TR_OpaqueClassBlock * definingClassFromCPFieldRef(TR::Compilation *comp, int32_t cpIndex, bool isStatic, TR_OpaqueClassBlock** fromResolvedJ9Method = NULL);
613613

614-
virtual int32_t virtualCallSelector(uint32_t cpIndex);
615614
virtual char * fieldSignatureChars(int32_t cpIndex, int32_t & len);
616615
virtual char * staticSignatureChars(int32_t cpIndex, int32_t & len);
617616

runtime/compiler/optimizer/InterpreterEmulator.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,7 +1591,7 @@ InterpreterEmulator::visitInvokevirtual()
15911591
{
15921592
TR_J9MutableCallSite *inlinerMcs = new (comp()->trHeapMemory()) TR_J9MutableCallSite(_calltarget->_calleeMethod, callNodeTreeTop, parent,
15931593
callNode, interfaceMethod, _currentCallMethod->classOfMethod(),
1594-
(int32_t) _currentCallMethod->virtualCallSelector(cpIndex), cpIndex, _currentCallMethod,
1594+
-1, cpIndex, _currentCallMethod,
15951595
resolvedSymbol, isIndirectCall, isInterface, *_newBCInfo, comp(),
15961596
_recursionDepth, allconsts);
15971597
if (_currentCallMethod->getRecognizedMethod() == TR::java_lang_invoke_MethodHandle_invokeBasic)
@@ -1621,7 +1621,7 @@ InterpreterEmulator::visitInvokevirtual()
16211621
{
16221622
callsite = new (comp()->trHeapMemory()) TR_J9VirtualCallSite(_calltarget->_calleeMethod, callNodeTreeTop, parent,
16231623
callNode, interfaceMethod, _currentCallMethod->classOfMethod(),
1624-
(int32_t) _currentCallMethod->virtualCallSelector(cpIndex), cpIndex, _currentCallMethod,
1624+
(int32_t) _currentCallMethod->virtualCallSelector(), cpIndex, _currentCallMethod,
16251625
resolvedSymbol, isIndirectCall, isInterface, *_newBCInfo, comp(),
16261626
_recursionDepth, allconsts);
16271627

@@ -1736,7 +1736,7 @@ InterpreterEmulator::visitInvokestatic()
17361736
{
17371737
TR_J9MutableCallSite *mcs = new (comp()->trHeapMemory()) TR_J9MutableCallSite( _calltarget->_calleeMethod, callNodeTreeTop, parent,
17381738
callNode, interfaceMethod, receiverClass,
1739-
(int32_t) _currentCallMethod->virtualCallSelector(cpIndex), cpIndex, _currentCallMethod,
1739+
-1, cpIndex, _currentCallMethod,
17401740
resolvedSymbol, isIndirectCall, isInterface, *_newBCInfo, comp(),
17411741
_recursionDepth, allconsts);
17421742
if (mcsIndex != TR::KnownObjectTable::UNKNOWN)
@@ -1751,7 +1751,7 @@ InterpreterEmulator::visitInvokestatic()
17511751
int32_t noCPIndex = -1; // The method is not referenced via the constant pool
17521752
callsite = new (comp()->trHeapMemory()) TR_J9VirtualCallSite(
17531753
_calltarget->_calleeMethod, callNodeTreeTop, parent, callNode,
1754-
interfaceMethod, receiverClass, (int32_t) _currentCallMethod->virtualCallSelector(cpIndex), noCPIndex,
1754+
interfaceMethod, receiverClass, (int32_t) _currentCallMethod->virtualCallSelector(), noCPIndex,
17551755
_currentCallMethod, resolvedSymbol, isIndirectCall, isInterface,
17561756
*_newBCInfo, comp(), _recursionDepth, allconsts);
17571757
}
@@ -1817,7 +1817,7 @@ InterpreterEmulator::visitInvokeinterface()
18171817
{
18181818
callsite = new (comp()->trHeapMemory()) TR_J9VirtualCallSite(
18191819
_calltarget->_calleeMethod, callNodeTreeTop, parent, callNode,
1820-
interfaceMethod, _currentCallMethod->classOfMethod(), (int32_t) _currentCallMethod->virtualCallSelector(cpIndex), cpIndex,
1820+
interfaceMethod, _currentCallMethod->classOfMethod(), (int32_t) _currentCallMethod->virtualCallSelector(), cpIndex,
18211821
_currentCallMethod, resolvedSymbol, isIndirectCall, isInterface,
18221822
*_newBCInfo, comp(), _recursionDepth, allconsts);
18231823
}

0 commit comments

Comments
 (0)