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

Normalization does not support invokedynamic #34

Open
fweimer opened this issue Aug 4, 2014 · 3 comments
Open

Normalization does not support invokedynamic #34

fweimer opened this issue Aug 4, 2014 · 3 comments

Comments

@fweimer
Copy link
Contributor

fweimer commented Aug 4, 2014

The large switch on bytecode instructions does not list invokedynamic, and the constant type related to invokedynamic is not supported, either. This is mostly an issue for Java 8 and code containing lambdas because before this version, javac does not emit the instruction.

@fweimer
Copy link
Contributor Author

fweimer commented Aug 4, 2014

BCEL throws this exception for a class compiled using javac which contains a lambda:

    Exception in thread "main" org.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18

Unfortunately, BCEL appears to be dead upstream, and there hasn't been a release with full support for JDK 7, so it is probably best to switch to ASM or your own class file parser.

@abn
Copy link
Member

abn commented Aug 9, 2014

This needs to be discussed a bit further. I do agree that we need add support for newer bytecode instructions.

@fweimer
Copy link
Contributor Author

fweimer commented Aug 11, 2014

invokedynamic has the same instruction format as invokeinterface, so the only thing needed is support for the new constant pool entry types.
I have rewritten the normalization from scratch, without any external dependencies, eliminating the BCEL dependency. Adding invokedynamic support to this should be really easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants