"However, the key thing about invokedynamic is that it's essentially a JVM-level macro that defers lambda translation strategy to LambdaMetaFactory which is a library class. If Java 9 or 10 gets more direct (and performant) support for lambdas that won't require classes and object allocations then it can swap implementation of LambdaMetaFactory and all _existing_ code written for Java 8 will get performance boost. That is the brilliance of using invokedynamic in context of translating lambdas. We'll have to wait for future versions of Java to experience those benefits, though."
So unless I'm missing something, please be specific.
http://cr.openjdk.java.net/~briangoetz/lambda/lambda-transla...
1. A method in its parent class. 2. An invokedynamic instruction at the call site.
The invokedynamic instruction calls LambdaMetafactory, which compiles an anonymous class at runtime that calls method #1. So the only benefit of using invokedynamic is fewer class files, by deferring generating them until runtime.
Have you checked this talk at Java ONE?
http://parleys.com/play/5251c164e4b0a43ac1212459/about
Some older slides also available
http://www.slideshare.net/jaxlondon2012/lambda-a-peek-under-...
I assume other certified JVMs would follow similar design approaches.
The implementation can be optimised at any point.
Default support of ART or Java 8?
If Java 8, how do you know this? Citation needed ;)
Arguing whether Java 8 will be completely supported or not ignores the nature of the Android API. Android doesn't even support 100% of Java 6 because it is not a desktop JDK and does not intend to replicate everything.
However, the Android team has actively been adding default support of Java 7 features piece by piece in recent months. They intend to handle Java 8 in the same manner. It's not clear which features will be supported in what version of Android, but lambdas are clearly a priority and can already be used today by early adopters using retrolambda.
http://tools.android.com/tech-docs/new-build-system/user-gui...
http://zserge.com/blog/android-lambda.html