RFR(L): 8008688: Make MethodHandleInfo public
John Rose
john.r.rose at oracle.com
Wed Jun 26 23:00:27 PDT 2013
This change implements the MethodHandleInfo API for cracking a direct method handle back into its symbolic reference components. A DMH is any CONSTANT_MethodHandle or any result of a Lookup.find* or Lookup.unreflect* API call.
http://cr.openjdk.java.net/~jrose/8008688/webrev.04
Problem:
JDK 8 (esp. Project Lambda) needs a stable API for "cracking" CONSTANT_MethodHandle constants that are involved with lambda capture sites (which are implemented with invokedynamic).
Solution:
Create, specify, implement, and test such an API. Run the API design past the 292 EG, the Project Lambda folks, and the Oracle internal review council (CCC).
Testing:
Regular JSR 292 regression tests, plus a new jtreg test with positive and 3 kinds of negative tests, in hundreds of combinations. (See below.)
— John
P.S. Output from RevealDirectTest.java. (It runs with and without a security manager.)
@Test testSimple executed 107 positive tests in 446 ms
@Test testPublicLookup/1 executed 56 positive tests in 99 ms
@Test testPublicLookup/2 executed 80 positive tests in 551 ms
@Test testPublicLookup/3 executed 56 positive tests in 47 ms
@Test testPublicLookupNegative/1 executed 23/0/0 negative tests in 2 ms
@Test testPublicLookupNegative/2 executed 0/27/0 negative tests in 4 ms
@Test testPublicLookupNegative/3 executed 0/0/27 negative tests in 10 ms
@Test testJavaLangClass executed 60 positive tests in 67 ms
@Test testCallerSensitive executed 30 positive tests in 425 ms
@Test testCallerSensitiveNegative executed 12/0/0 negative tests in 1 ms
@Test testMethodHandleNatives executed 4 positive tests in 5 ms
@Test testMethodHandleInvokes/1 executed 640 positive tests in 828 ms
@Test testMethodHandleInvokes/2 executed 640 positive tests in 177 ms
More information about the mlvm-dev
mailing list