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

Correct usage of x86 directCallRequiresTrampoline() API #15024

Merged
merged 2 commits into from
May 10, 2022

Conversation

0xdaryl
Copy link
Contributor

@0xdaryl 0xdaryl commented May 6, 2022

  • Correct usage of x86 directCallRequiresTrampoline() API
  • Replace Z NEEDS_TRAMPOLINE macro with function call

Calls to `directCallRequiresTrampoline()` should be passed the address
of the start of the call instruction.  Failing to do so may lead to
incorrect branch displacements being computed.

Signed-off-by: Daryl Maier <maier@ca.ibm.com>
There is not really a benefit to hiding the call to `directCallRequiresTrampoline()`
behind a macro.  Call the function directly.

Signed-off-by: Daryl Maier <maier@ca.ibm.com>
@0xdaryl
Copy link
Contributor Author

0xdaryl commented May 6, 2022

Depends eclipse/omr#6503

@0xdaryl
Copy link
Contributor Author

0xdaryl commented May 6, 2022

Jenkins test sanity xlinux,win,osx,zlinux,zos jdk17 depends eclipse/omr#6503

Edit: For the record, all builds and tests succeeded.

@0xdaryl
Copy link
Contributor Author

0xdaryl commented May 9, 2022

Jenkins test sanity all jdk8,jdk11 depends eclipse/omr#6503

@0xdaryl
Copy link
Contributor Author

0xdaryl commented May 9, 2022

@ymanton : would you mind reviewing this and its dependent PR in OMR (eclipse/omr#6503) please?

There is a common codegen API directCallRequiresTrampoline() that each platform must implement that is defined to expect the absolute address of the call instruction as its second parameter. However, on x86 there was an inconsistency where the address of the next instruction was passed instead, leading to incorrect behaviour (a crash). This pair of PRs corrects that and adds a bit of documentation.

@JamesKingdon FYI

@0xdaryl
Copy link
Contributor Author

0xdaryl commented May 9, 2022

This will require a coordinated merge. I chose to implement it with that dependence to eliminate excessive churn. Once @ymanton has approved perhaps @dsouzai you could take care of the merge.

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.

Copy link
Contributor

@dsouzai dsouzai left a comment

Choose a reason for hiding this comment

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

Couple of questions.

@dsouzai dsouzai merged commit f7ab2c6 into eclipse-openj9:master May 10, 2022
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.

None yet

3 participants