-
Enhancement
-
Resolution: Fixed
-
P3
-
7
-
b56
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2180589 | 6u18 | John Rose | P3 | Resolved | Fixed | b01 |
JDK-2177675 | hs16 | John Rose | P3 | Closed | Fixed | b01 |
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
- backported by
-
JDK-2180589 dynamic languages need method handles
- Resolved
-
JDK-2177675 dynamic languages need method handles
- Closed
- relates to
-
JDK-6829142 JSR 292 JVM features need a finalized Java API
- Closed
-
JDK-6829187 compiler optimizations required for JSR 292
- Resolved
-
JDK-6829192 JSR 292 needs to support 64-bit x86
- Resolved
-
JDK-6829193 JSR 292 needs to support SPARC
- Resolved
-
JDK-6831604 missing null check in guarantee
- Closed
-
JDK-6829194 JSR 292 needs to support compressed oops
- Closed
-
JDK-6812678 macro assembler needs delayed binding of a few constants (for 6655638)
- Resolved
-
JDK-6812831 factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
- Resolved
-
JDK-6829144 JSR 292 JVM features need a provisional Java API
- Resolved
-
JDK-6824466 (reflect) java.lang.reflect.Method should use java.lang.invoke.MethodHandle
- Closed
-
JDK-6829195 JSR 292 needs to support the C++ interpreter
- Closed