-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thunk related fixes #6907
Thunk related fixes #6907
Conversation
} | ||
break; | ||
} | ||
} | ||
else | ||
{ | ||
virtualThunk = fej9->getJ2IThunk(methodSymbol->getMethod(), comp()); | ||
if (!virtualThunk) | ||
// For remote compilations we always need to regenerate the thunk inside the code cache for this compilation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On x86 the code is like this:
{
virtualThunk = fej9->getJ2IThunk(methodSymbol->getMethod(), comp());
// in server mode, we always need to regenerate the thunk inside the code cache for this compilation
if (!virtualThunk)
virtualThunk = fej9->setJ2IThunk(methodSymbol->getMethod(), generateVirtualIndirectThunk(callNode), comp());
}
The check for comp()->getPersistentInfo()->getRemoteCompilationMode() == JITServer::SERVER
has gone away which makes the code exactly the same as the old one. No change needed!
@@ -1531,7 +1531,8 @@ TR::S390PrivateLinkage::buildVirtualDispatch(TR::Node * callNode, TR::RegisterDe | |||
char *j2iSignature = fej9->getJ2IThunkSignatureForDispatchVirtual(methodSymbol->getMethod()->signatureChars(), methodSymbol->getMethod()->signatureLength(), comp()); | |||
int32_t signatureLen = strlen(j2iSignature); | |||
virtualThunk = fej9->getJ2IThunk(j2iSignature, signatureLen, comp()); | |||
if (!virtualThunk) | |||
// For remote compilations we always need to regenerate the thunk inside the code cache for this compilation. | |||
if (!virtualThunk || comp()->getPersistentInfo()->getRemoteCompilationMode() == JITServer::SERVER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test for comp()->getPersistentInfo()->getRemoteCompilationMode() == JITServer::SERVER
is gone on x86 so we can completely eliminate this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could implement this change directly into the master branch, by creating the new frontend query:
void
TR_J9VMBase::setInvokeExactJ2IThunk(void *thunkptr, TR::Compilation *comp)
{
comp->getPersistentInfo()->getInvokeExactJ2IThunkTable()->addThunk((TR_J2IThunk*) thunkptr, this);
}
and use it like you proposed below in J9S390PrivateLInkage.cpp lines 1545-1549
Of course this needs to be done on all platforms.
-Use front-end query to add invokeExactJ2IThunk Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
@mpirvu I have addressed the changes regarding the JITServer checks. So this is ready for another review. Note: As discussed offline, we won't add the new query here because this will create an inconsistency issue with how x86 has implemented this change in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR JITServer testing cannot be done on Z at the moment, hence merging |
-Regenerate thunks for remote compilations
-Use front-end query to add invokeExactJ2IThunk
Signed-off-by: Dhruv Chopra Dhruv.C.Chopra@ibm.com