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

Add support for signature polymorphic methods #106

Merged
merged 2 commits into from
Jun 19, 2016
Merged

Conversation

uschindler
Copy link
Member

@uschindler uschindler commented Jun 15, 2016

This PR adds support for detecting signature polymorphic methods (like MethodHandle.invoke).

The code detects those methods while populating the ClassSignature class (using the Java VM spec). The method names are recorded in a set per class.

The VM spec says:

  • fixed descriptor: Type.getMethodDescriptor(Type.getType(Object.class), Type.getType(Object[].class));
  • access flags: ACC_VARARGS and ACC_NATIVE
  • class is below java.lang.invoke (this is a slight change to spec, to also catch varhandles -> asked on OpenJDK ML)

On forbidden checks it looks up every method name in this set, and if it exists, it replaces the signature by the polymorphic one for the lookup.

@uschindler uschindler merged commit 9bb6aba into master Jun 19, 2016
@uschindler uschindler deleted the issues/105 branch June 19, 2016 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant