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

Use correct query to get RAM Method for remote compilations #6911

Merged
merged 1 commit into from
Oct 1, 2019

Conversation

dchopra001
Copy link
Contributor

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

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

Could you please address my inline comment?

uintptrj_t ramMethod = (uintptr_t)methodSymbol->getMethodAddress();
// For remote compiles we do direct calls through snippets. However the method we're calling might already be compiled.
// In such a case we can't use getMethodAddress() to get the RAM Method because it returns the compiled code's entry point instead of the RAM Method.
uintptrj_t ramMethod = comp->getPersistentInfo()->getRemoteCompilationMode() == JITServer::SERVER && !methodSymbol->isInterpreted() ? (uintptrj_t)methodSymRef->getSymbol()->castToResolvedMethodSymbol()->getResolvedMethod()->getPersistentIdentifier() : (uintptrj_t)methodSymbol->getMethodAddress();
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be wrong if we don't check whether the method is interpreted and always use getPersistentIdentifier()?
Also, to identify server size compilations comp->isOutOfProcessCompilation() is preferable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to clarify, are you proposing the following change?

uintptrj_t ramMethod = ..getPersistentIdentifier();

Or something like this:

uintptrj_t ramMethod = comp->isOutOfProcessCompilation() ? ..getPersistentIdentifier() : (uintptrj_t)methodSymbol->getMethodAddress();

Copy link
Contributor

Choose a reason for hiding this comment

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

I was suggesting the latter, but now that you mentioned it, why is the first variation wrong? If all we want is the j9method, then getPersistentIdentifier() will us that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's why I was clarifying. I think getPersistentIdentifier() by itself should be sufficient. However I'd like to test it on JITServer as well as master. I'll report back once I have the results. If good, then we can make this change directly in the master branch.

@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Sep 4, 2019
@mpirvu mpirvu added the arch:z label Sep 4, 2019
@mpirvu mpirvu self-assigned this Sep 4, 2019
@dchopra001
Copy link
Contributor Author

Currently testing this in the master branch as well as my jitserver branch.

@dchopra001
Copy link
Contributor Author

JITServer build looks good. Still waiting on the master build.

This query is better than calling getMethodAddress
as it will return the correct data even in remote compilations.

Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
@dchopra001 dchopra001 changed the base branch from jitaas to master September 30, 2019 19:25
@dchopra001
Copy link
Contributor Author

@mpirvu Both builds passed. I have repurposed this PR to target the master branch. This should be good to merge now.

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

mpirvu commented Sep 30, 2019

Jenkins test sanity zlinux jdk8,jdk11

@mpirvu
Copy link
Contributor

mpirvu commented Oct 1, 2019

Tests have passed, hence merging.

@mpirvu mpirvu merged commit cac1561 into eclipse-openj9:master Oct 1, 2019
@dchopra001 dchopra001 deleted the ramMethodRemote 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