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

(0.28.0) Refine linkToVirtual to a direct call when no vtable entry exists #13505

Merged

Conversation

nbhuiyan
Copy link
Member

MethodHandleTransformer refines linkToVirtual calls to the target
method when MemberName is known. The call kind of the refined
linkToVirtual call target was always treated as Virtual.
However, for private virtual methods and java/lang/Object;
type virtual methods, there is no corresponding entry in the vtable,
and for such methods the interpreter vtable index is set as 0.
The dispatch is not performed through the vtable entry, but instead
it is a direct call to the target method obtained from MemberName.

By checking if jitVtableOffset is positive, we can determine if
a call needs to be dispatched through the vTable. Otherwise, we
can handle it similar to linkToStatic.

Contributed to master branch via #13474

Signed-off-by: Nazim Bhuiyan nubhuiyan@ibm.com

MethodHandleTransformer refines linkToVirtual calls to the target
method when MemberName is known. The call kind of the refined
linkToVirtual call target was always treated as Virtual.
However, for private virtual methods and java/lang/Object;
type virtual methods, there is no corresponding entry in the vtable,
and for such methods the interpreter vtable index is set as 0.
The dispatch is not performed through the vtable entry, but instead
it is a direct call to the target method obtained from MemberName.

By checking if jitVtableOffset is positive, we can determine if
a call needs to be dispatched through the vTable. Otherwise, we
can handle it similar to linkToStatic.

Signed-off-by: Nazim Bhuiyan <nubhuiyan@ibm.com>
@nbhuiyan
Copy link
Member Author

@0xdaryl

@pshipton pshipton changed the title Refine linkToVirtual to a direct call when no vtable entry exists (0.28.0) Refine linkToVirtual to a direct call when no vtable entry exists Sep 13, 2021
@pshipton pshipton added this to the Release 0.28 (Java 17) milestone Sep 13, 2021
@0xdaryl 0xdaryl self-assigned this Sep 14, 2021
@0xdaryl 0xdaryl merged commit 23fa69d into eclipse-openj9:v0.28.0-release Sep 14, 2021
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.

None yet

3 participants