Android has now a non-complete implementation of invokedynamic/java.lang.invoke by Google
Remi Forax
forax at univ-mlv.fr
Thu Mar 30 10:18:03 UTC 2017
Hi all,
looking for something unrelated in the source of the 'O' release of Android,
i've spotted these new opcodes:
https://android.googlesource.com/platform/libcore/+/ef44626d0ee0e65f949287932f90688dad3a97ff%5E2..ef44626d0ee0e65f949287932f90688dad3a97ff/
which correspond to invokeExact and invokeDynamic.
The meat of the MethodHandle implementation is here:
https://android.googlesource.com/platform/libcore/+/168dfc7fcb7594933af3bd4a66651f1eb2f09f7f/ojluni/src/main/java/java/lang/invoke/Transformers.java
As far as i understand, it's implemented by reifying things like a StackFrame and stack reader/writer in Java (somewhat similar to the StackWalker implementation of JDK 9).
The varargs collector/invoke (invokeGeneric) doesn't seem to be implemented (yet) and there is no trusted lookup.
cheers,
Rémi
More information about the mlvm-dev
mailing list