Community
Participate
Working Groups
This will be the master bug for this project.
Created attachment 229162 [details] Work in progress Working, but a bit rough: - ConstantPool sections for MethodHandles, MethodType, InvokeDynamic (but lacks caching) - Attribute section for BootStrapMethods - Adding of InnerClass reference for MethodHandles.Lookup - Implementation generateCode for ReferenceExpression And it actually runs, as shown in the supplied test. Yes, I know it lacks comment/disclaimer work. Also lacks performance/polish in putting together InvokeDynamic constants from code generation.
Created attachment 229192 [details] Improved work in progress Should cover all cases of reference expressions, static/non-static, with/without receiver.
Created attachment 229224 [details] Patch with functioning constructor references and generics I'll leave this for now, as plumbing for lambda is needed anyway, and the design needs review.
After being mystified and wasting quite a few hours tearing my hair out, I learnt that javap does not show the lambda method bodies unless invoked with -private. It truly looked like magic that things would work at all without the lambda method bodies being there in the class file :)
(In reply to comment #4) > After being mystified and wasting quite a few hours tearing my hair out, > I learnt that javap does not show the lambda method bodies unless invoked > with -private. It truly looked like magic that things would work at all > without the lambda method bodies being there in the class file :) Magic it is - I had to read up on invokedynamic a lot, too. You also need -v to get the BootStrapMethod attribute from javap.
Please do not post patches here anymore. Let us use this as the umbrella bug for tracking code generation project and to hold high level discussions. Patches should be attached to individual leaf level bugs that are blockers for the current bug.
This is mostly cooked except for varargs and serialization support. Jesper, if I prepare a cumulative patch, are you willing to review and do some white box testing ? TIA,
This umbrella bug has served its purpose. Resolving even though a couple of work items are still open - they are tracked on their own ticket.