Projects, which use JSR292
forax at univ-mlv.fr
Tue Feb 15 09:53:18 PST 2011
On 02/15/2011 06:13 PM, John Rose wrote:
> On Feb 15, 2011, at 6:50 AM, Kirill Shirokov wrote:
>> - JRuby by Charles Oliver Nutter
>> - PHP.reboot by Remi Forax
>> - Smalltalk implementation by Mark Roos (in progress)
And Java lambda in JDK8.
The current prototype already use JSR 292.
> I think this recent thread is about an OCaml implementation by Xavier Clerc:
I have also a metaclass core prototype named Gru (as a possible core for
but it's far from being usable by anybody.
And a not yet finished implementation of JSR 292 on Android.
As an implementer, the first benefit of JSR 292 is to greatly simplify
of several common patterns:
- invokedynamic+CallSite.setTarget() allows to easily implement any kind
of inlining caches
(one element cache or bymorphic cache, tree of decision, etc.)
which are the mothers of all optimizations of any dynamic languages.
- MutableCallSite.syncAll() allows to do thread safe deoptimization which is
the root of all optimistic optimizations. No guard anymore ! (in
reality, less guards).
- MethodHandle give you lambda for free.
- Predefined method handles avoid code generation for doing the plumbing
required by features like varargs, spreads, named parameters.
i.e adaptation between the calling and the target method.
- MethodHandles.asInstance() avoid code generation when bridging Java
core interfaces like
Comparator, Runnable, Callable and MethodHandle.
- invokedynamic bootstrap method ease the implementation of lazy
- ClassValue ease the storage of Class metadata.
- invokedynamic bootstrap method constants ease the storage of callsite
And I'm sure I forget some features.
The second benefit is performance.
Some performance improvement are already visible by example using metod
doing reflection is more efficient than using java.lang.reflect
especially when you deal with primitive types.
Some improvement are yet to appear like inlining of the whole callsite
Some will come later just because they require more works :)
About performance of the dynamic language runtimes, because JSR 292
the implementation of the runtime, I expect that existing runtime will
more optimizations just because the code is now simpler. PHP.reboot is
all about that.
> -- John
More information about the mlvm-dev