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

Relocate the J2I thunk in PIC data on Power #2882

Merged
merged 1 commit into from
Sep 19, 2018

Conversation

IBMJimmyk
Copy link
Contributor

The J2I Thunk in the PIC data for PPCVirtualUnresolvedSnippet and
PPCInterfaceCallSnippet needs to be relocateable for AOT compiles.

emitSnippetBody was modified for both to add support for this using the
new TR_J2IVirtualThunkPointer type of relocation.

Signed-off-by: jimmyk jimmyk@ca.ibm.com

@IBMJimmyk
Copy link
Contributor Author

Currently marked WIP because it depends on #2874 (which depends on eclipse-omr/omr#2965 ).

@gita-omr Do you want to take a look at this?

info->data2 = callNode ? callNode->getInlinedSiteIndex() : (uintptr_t)-1;

// data3 = distance in bytes from Constant Pool Pointer to J2I Thunk
info->data3 = 3 * TR::Compiler->om.sizeofReferenceAddress();
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally, I'd be happier if this offset was computed from the generated code addresses...something like (cursorForThunkAddress - cursorForConstantPoolPointer) so that, even if the layout changes, nobody has to remember to change this 3 or the other 8. Yeah, I know that means you'll have to "remember" more locations so that you can generate the relocation later on, but I think it's a better approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At that point in the code cursor and j2iThunkRelocationPoint already have the values I need so I replaced it with cursor - j2iThunkRelocationPoint.

@mstoodle
Copy link
Contributor

Ok, the change looks good to me now. @IBMJimmyk would you please squash the two commits ?

We will only need to test this PR on POWER (because it only changes one file in the POWER codegen) once #2874 is merged.

@IBMJimmyk
Copy link
Contributor Author

I squashed the commits.

The J2I Thunk in the PIC data for PPCVirtualUnresolvedSnippet and
PPCInterfaceCallSnippet needs to be relocateable for AOT compiles.

emitSnippetBody was modified for both to add support for this using the
new TR_J2IVirtualThunkPointer type of relocation.

Signed-off-by: jimmyk <jimmyk@ca.ibm.com>
@IBMJimmyk IBMJimmyk changed the title WIP: Relocate the J2I thunk in PIC data on Power Relocate the J2I thunk in PIC data on Power Sep 18, 2018
@IBMJimmyk
Copy link
Contributor Author

I removed the WIP tag since #2874 has been merged.

Copy link
Contributor

@mstoodle mstoodle left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @IBMJimmyk

@mstoodle
Copy link
Contributor

jenkins test sanity plinux jdk8

@mstoodle
Copy link
Contributor

only needs testing on POWER because only affects p codegen

jenkins test sanity aix jdk8

@mstoodle mstoodle merged commit 20fa2ca into eclipse-openj9:master Sep 19, 2018
@mstoodle mstoodle self-assigned this Sep 19, 2018
@mstoodle
Copy link
Contributor

With apologies to @gita-omr (who I know is away this week) for merging before she has had a chance to review; this PR is needed for our 0.10 release.

@gita-omr
Copy link
Contributor

With apologies to @gita-omr (who I know is away this week) for merging before she has had a chance to review; this PR is needed for our 0.10 release.

Thanks @mstoodle, that's what I was hoping you would do :)

@IBMJimmyk IBMJimmyk deleted the aot-nestmates branch April 5, 2019 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants