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 JITServer check to create a relocation record for interface calls on Power #7386

Merged
merged 1 commit into from
Oct 23, 2019

Conversation

dchopra001
Copy link
Contributor

[skip ci]
Signed-off-by: Dhruv Chopra Dhruv.C.Chopra@ibm.com

@dchopra001
Copy link
Contributor Author

I should mention that this routine adds relocation records for TR_J2IVirtualThunkPointer as well. But only if comp->compileRelocatableCode() returns true. Do we need to augment this check to check for comp->isOutOfProcessCompilation() as well? I did not see any failures related to this, but I do see that in the Z codegen this relo record is always added unconditionally.

@dchopra001 dchopra001 mentioned this pull request Oct 8, 2019
17 tasks
@fjeremic fjeremic added arch:power comp:jitserver Artifacts related to JIT-as-a-Service project labels Oct 8, 2019
Copy link
Member

@ymanton ymanton left a comment

Choose a reason for hiding this comment

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

I should mention that this routine adds relocation records for TR_J2IVirtualThunkPointer as well. But only if comp->compileRelocatableCode() returns true. Do we need to augment this check to check for comp->isOutOfProcessCompilation() as well? I did not see any failures related to this, but I do see that in the Z codegen this relo record is always added unconditionally.

No, we shouldn't need to relocate thunk pointers, they should be valid client-side pointers at this point for non-AOT JITServer compilations.

It probably doesn't hurt to emit relocations on Z because when the client applies the reloc it will just overwrite the thunk address with the same value. The same is probably true on P, but we already found out that relocs aren't applied the same way on every platform so lets just leave it be until there's reason to do otherwise.

@@ -719,7 +719,7 @@ uint8_t *TR::PPCInterfaceCallSnippet::emitSnippetBody()
{
int32_t *patchAddr = (int32_t *)getLowerInstruction()->getBinaryEncoding();
intptrj_t addrValue = (intptrj_t)cursor;
if (!comp->compileRelocatableCode())
if (!comp->compileRelocatableCode() && !comp->isOutOfProcessCompilation())
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment on the else path here that explains to the reader that the immediate fields of the instructions being patched need to be clear for AOT and JITServer because the relocation ORs the relocated address into the fields and therefore can't tolerate any unexpectedly set bits? It will save someone a lot of grief in the future if they ever have to visit this part of the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done: dbd29ed

[skip ci]
Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
Copy link
Member

@ymanton ymanton left a comment

Choose a reason for hiding this comment

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

LGTM. Can't do PR testing on Power and this code is not built on x86, hence merging as-is.

@ymanton ymanton merged commit de14912 into eclipse-openj9:jitaas Oct 23, 2019
@dchopra001 dchopra001 deleted the interfaceCalls branch July 13, 2021 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch:power comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants