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

Look for right caller method when handling OSR in context of inliner #4177

Merged
merged 1 commit into from
Jul 31, 2019

Conversation

hzongaro
Copy link
Contributor

In many places, OSR-related code in the inliner is calling getOwningMethodSymbol() on a symbol reference in order to access information about the calling method. However, the owning method for a symbol reference is not necessarily the calling method.

Instead, code should call getInlinedResolvedMethodSymbol() on the TR::Compilation object for the bytecode's caller index or, if the caller index is -1, call getMethodSymbol().

Signed-off-by: Henry Zongaro zongaro@ca.ibm.com

@hzongaro
Copy link
Contributor Author

hzongaro commented Jul 30, 2019

I have marked this pull request as a work in progress as it interacts with OpenJ9 pull request #6626, which makes the same change in OSR-related inliner code in OpenJ9. Andrew Craik @andrewcraik , who advised me on this fix, indicated that the way the calling method is found should be kept consistent.

So, I'm wondering whether I should protect the change in OMR under some OpenJ9-specific macro, and mark the OpenJ9 pull request dependent on this OMR pull request, so that the change in OMR is only enabled when the change in OpenJ9 is available and enabled.

Once both pull requests were merged, I would then submit new pull requests so that the changes would no longer be protected by a macro.

@andrewcraik
Copy link
Contributor

The 'correct' answer would be to protect the condition change and make J9 cause that macro to be defined. If there is an easy way to do this then that would simplify the merge. Otherwise we will have to sequence the delivery with the corresponding OpenJ9 change to avoid the problematic intermediate state.

@andrewcraik
Copy link
Contributor

looks like the right change - I'll approve once we know the delivery plan

In many places, OSR-related code in the inliner is calling
getOwningMethodSymbol() on a symbol reference in order to access
information about the calling method.  However, the owning method for
a symbol reference is not necessarily the calling method.

Instead, code should call getInlinedResolvedMethodSymbol() on the
TR::Compilation object for the bytecode's caller index or, if the caller
index is -1, call getMethodSymbol().

These changes are guarded by #if defined(INLINER_OSR_CALLING_METHOD)
so that they can enabled together with corresponding changes in
downstream components.  Once the downstream components have changed,
a definition of INLINER_OSR_CALLING_METHOD will be added, and then
the guards subsequently removed.

Signed-off-by:  Henry Zongaro <zongaro@ca.ibm.com>
@hzongaro
Copy link
Contributor Author

I've put the changes under #if defined(INLINER_OSR_CALLING_METHOD) so that they can be enabled at the same time with corresponding changes in downstream components. Removed the WIP prefix from this pull request.

I will submit subsequent pull requests to enable the change and then to make them unconditional

@hzongaro hzongaro changed the title WIP: Look for right caller method when handling OSR in context of inliner Look for right caller method when handling OSR in context of inliner Jul 31, 2019
@andrewcraik
Copy link
Contributor

@genie-omr build all

@andrewcraik andrewcraik self-assigned this Jul 31, 2019
@andrewcraik andrewcraik merged commit ff25aea into eclipse-omr:master Jul 31, 2019
@hzongaro hzongaro deleted the inliner-osr-calling-method branch July 31, 2019 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants