'. '

InvokeDynamic

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(New page: Implementing different languages on top of Hotspot virtual machine is of different complexity. The most problematic thing is to properly and effectively dispatch methods calls. Not eve...)
Line 1: Line 1:
-
Implementing different languages on top of [[Hotspot]] virtual machine is of different complexity. The most problematic thing is to properly and effectively dispatch methods calls. Not every languages uses the [[Java]] rules. Some support type conversions, implicit arguments. Some can dynamically alter the existing dispatch target or strategies. More about that in an excellent summary [http://blogs.sun.com/jrose/resource/pres/200910-VMIL.pdf Bytecodes meet Combinators].
+
Implementing different languages on top of [[HotSpot]] virtual machine is of different complexity. The most problematic thing is to properly and effectively dispatch methods calls. Not every languages uses the [[Java]] rules. Some support type conversions, implicit arguments. Some can dynamically alter the existing dispatch target or strategies. More about that in an excellent summary [http://blogs.sun.com/jrose/resource/pres/200910-VMIL.pdf Bytecodes meet Combinators].
To address all these different needs the new [[invokeDynamic]] [[bytecode]] operand does not hardcode the actual invocation, but delegates it software controllable ''MethodHandle''s. What is a method handle? A pointer to method of some signature (for example ''plus'' would take two ints and return their sum as an int) and an object - a receiver to call the method on. However this is nothing else than a [[closures|closure]].
To address all these different needs the new [[invokeDynamic]] [[bytecode]] operand does not hardcode the actual invocation, but delegates it software controllable ''MethodHandle''s. What is a method handle? A pointer to method of some signature (for example ''plus'' would take two ints and return their sum as an int) and an object - a receiver to call the method on. However this is nothing else than a [[closures|closure]].
-
The proposed improvements to the [[Hotspot]] virtual machine may help the [[JDK]] to support different languages, but first and foremost they open the door to effective implementation of [[Closures]].
+
The proposed improvements to the [[HotSpot]] virtual machine may help the [[JDK]] to support different languages, but first and foremost they open the door to effective implementation of [[Closures]].

Revision as of 18:41, 28 November 2009

Implementing different languages on top of HotSpot virtual machine is of different complexity. The most problematic thing is to properly and effectively dispatch methods calls. Not every languages uses the Java rules. Some support type conversions, implicit arguments. Some can dynamically alter the existing dispatch target or strategies. More about that in an excellent summary Bytecodes meet Combinators.

To address all these different needs the new invokeDynamic bytecode operand does not hardcode the actual invocation, but delegates it software controllable MethodHandles. What is a method handle? A pointer to method of some signature (for example plus would take two ints and return their sum as an int) and an object - a receiver to call the method on. However this is nothing else than a closure.

The proposed improvements to the HotSpot virtual machine may help the JDK to support different languages, but first and foremost they open the door to effective implementation of Closures.

Personal tools
buy