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

Get special-case invokeinterface receiver early #5500

Merged
merged 1 commit into from
Apr 25, 2019

Conversation

jdmpapin
Copy link
Contributor

In 7295e2c the JIT compiler was modified so that it could generate IL for "improper" invokeinterface bytecode instructions, i.e. those targeting private methods or methods of Object. For these invocations, the dispatch does not naturally perform the type check required for invokeinterface, so an explicit type check is generated ahead of the call. This type check needs the receiver of the call, which until now has been read from the resulting call node. The problem is that it's possible that the node is no longer a call by the time the type check is generated, e.g. in the case of a call to Object.getClass(), the call becomes aloadi <javaLangClassFromClass> during genInvokeDirect().

The receiver is now read from the stack before calling genInvokeDirect() or genInvokeWithVFTChild() so that the type check will be unaffected by any such transformations.

In 7295e2c the JIT compiler was modified so that it could generate IL
for "improper" invokeinterface bytecode instructions, i.e. those
targeting private methods or methods of Object. For these invocations,
the dispatch does not naturally perform the type check required for
invokeinterface, so an explicit type check is generated ahead of the
call. This type check needs the receiver of the call, which until now
has been read from the resulting call node. The problem is that it's
possible that the node is no longer a call by the time the type check is
generated, e.g. in the case of a call to Object.getClass(), the call
becomes aloadi <javaLangClassFromClass> during genInvokeDirect().

The receiver is now read from the stack before calling genInvokeDirect()
or genInvokeWithVFTChild() so that the type check will be unaffected by
any such transformations.

Signed-off-by: Devin Papineau <devinmp@ca.ibm.com>
@DanHeidinga
Copy link
Member

@andrewcraik @cathyzhyi Can one of you review this?

@cathyzhyi
Copy link
Contributor

LGTM

@DanHeidinga
Copy link
Member

Jenkins test sanity zlinux jdk8

@DanHeidinga
Copy link
Member

Jenkins test extended win jdk11

@DanHeidinga
Copy link
Member

Jenkins test sanity osx jdk12

@jdmpapin
Copy link
Contributor Author

Is this ok to merge now?

@DanHeidinga
Copy link
Member

@fjeremic Can you give this a second set of eyes and merge it? @cathyzhyi has already reviewed and approved it.

@fjeremic fjeremic self-assigned this Apr 25, 2019
@fjeremic fjeremic merged commit 7c2e053 into eclipse-openj9:master Apr 25, 2019
@jdmpapin jdmpapin deleted the invokeinterface-getclass branch April 9, 2021 21:51
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