Skip to content
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

Merged
merged 1 commit into from
Sep 24, 2019
Merged

Thunk related fixes #6907

merged 1 commit into from
Sep 24, 2019

Conversation

dchopra001
Copy link
Contributor

-Regenerate thunks for remote compilations
-Use front-end query to add invokeExactJ2IThunk

Signed-off-by: Dhruv Chopra Dhruv.C.Chopra@ibm.com

@dchopra001 dchopra001 mentioned this pull request Aug 30, 2019
32 tasks
}
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.
Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Contributor

@mpirvu mpirvu left a 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.

@dchopra001 dchopra001 changed the base branch from jitaas to master September 24, 2019 17:49
@dchopra001 dchopra001 changed the base branch from master to jitaas September 24, 2019 17:50
-Use front-end query to add invokeExactJ2IThunk

Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
@dchopra001
Copy link
Contributor Author

@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 JITaaS branch vs the master branch. Since the merge for the x86 side will happen soon, this change can propagate at that time as well.

Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mpirvu mpirvu self-assigned this Sep 24, 2019
@mpirvu mpirvu added comp:jitserver Artifacts related to JIT-as-a-Service project arch:z labels Sep 24, 2019
@mpirvu
Copy link
Contributor

mpirvu commented Sep 24, 2019

PR JITServer testing cannot be done on Z at the moment, hence merging

@mpirvu mpirvu merged commit 9b8803d into eclipse-openj9:jitaas Sep 24, 2019
@dchopra001 dchopra001 deleted the thunk branch July 13, 2021 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch:z comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants