-
Notifications
You must be signed in to change notification settings - Fork 738
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
Conversation
I should mention that this routine adds relocation records for |
There was a problem hiding this 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()) |
There was a problem hiding this comment.
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 OR
s 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.
There was a problem hiding this comment.
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>
a746af6
to
dbd29ed
Compare
There was a problem hiding this 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.
[skip ci]
Signed-off-by: Dhruv Chopra Dhruv.C.Chopra@ibm.com