JDK-6655638 : dynamic languages need method handles
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-01-27
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u18Fixed 7 b56Fixed hs16Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
http://blogs.sun.com/jrose/entry/method_handles_in_the_vm (forthcoming)

One pain point in dynamic language implementation is calling
dynamically linked code under a variety of names, containing classes,
and signatures.  The JVM's static linking and typing rules, which usually
serve to enforce system integrity, get in the way with dynamic languages.

A method handle can be formed on any method, with suitable access check performed at the point of handle creation (not call).  The handle will allow its target to be accessed from any caller which obtains the handle.  It is a low-level function pointer.

Because method handles are low-level monomorphic (singly-typed) objects, they behave as if they possess instance-specific behavior.  They also exhibit descriptor polymorphism, in that different instances can respond to calls with different argument and return signatures.  Neither of these features are available in the current JVM, except by simulating with combinatorially complex system of signature interfaces, or inefficient reflection.

The interesting operations on method handles are about the same as with any system of functional types:

- creating one from an isolated method
- creating one from a bit of code, with associated data values
- invoking one on some arguments
- creating an adapter around one
- asking one for its argument and return types

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/e5b0439ef4ae