JDK-8000999 : backport of JSR 292 to 7u
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 7u40
  • Priority: P1
  • Status: Resolved
  • Resolution: Won't Fix
  • Submitted: 2012-10-16
  • Updated: 2012-10-22
  • Resolved: 2012-10-22
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
This is an umbrella bug for these changes (which are backported in one changeset):

6983728: JSR 292 remove argument count limitations
7128512: Javadoc typo in java.lang.invoke.MethodHandle
7117167: Misc warnings in java.lang.invoke and sun.invoke.*
7129034: VM crash with a field setter method with a filterArguments
7087658: MethodHandles.Lookup.findVirtual is confused by interface methods that are multiply inherited
7127687: MethodType leaks memory due to interning
7023639: JSR 292 method handle invocation needs a fast path for compiled code
7188911: nightly failures after JSR 292 lazy method handle update (round 2)
7190416: JSR 292: typo in InvokerBytecodeGenerator.getConstantPoolSize
7191102: nightly failures after JSR 292 lazy method handle update (round 3)
7194612: api/java_lang/invoke/MethodHandles/Lookup/index.html#ExceptionsTests[findVirtualNSME] fails w/ -esa
7194662: JSR 292: PermuteArgsTest times out in nightly test runs

Comments
We decided to backport each individual JSR 292 changeset from 8 to 7u12. So this bug is not required anymore.
22-10-2012

The backport is just copying over the files from JDK 8. That's why the webrev is so big and pretty useless. The real changes between 8 and 7 are these: diff -Nur jdk8/src/share/classes/java/lang/invoke/MethodHandleStatics.java jdk7u/src/share/classes/java/lang/invoke/MethodHandleStatics.java --- jdk8/src/share/classes/java/lang/invoke/MethodHandleStatics.java 2012-10-15 12:21:52.806052959 -0700 +++ jdk7u/src/share/classes/java/lang/invoke/MethodHandleStatics.java 2012-10-16 10:48:29.728257304 -0700 @@ -94,10 +94,14 @@ // handy shared exception makers (they simplify the common case code) /*non-public*/ static InternalError newInternalError(String message, Throwable cause) { - return new InternalError(message, cause); + InternalError e = new InternalError(message); + e.initCause(cause); + return e; } /*non-public*/ static InternalError newInternalError(Throwable cause) { - return new InternalError(cause); + InternalError e = new InternalError(); + e.initCause(cause); + return e; } /*non-public*/ static RuntimeException newIllegalStateException(String message) { return new IllegalStateException(message); diff -Nur jdk8/src/share/classes/sun/invoke/util/ValueConversions.java jdk7u/src/share/classes/sun/invoke/util/ValueConversions.java --- jdk8/src/share/classes/sun/invoke/util/ValueConversions.java 2012-10-16 10:49:36.081911283 -0700 +++ jdk7u/src/share/classes/sun/invoke/util/ValueConversions.java 2012-10-16 10:48:19.626424849 -0700 @@ -1211,9 +1211,13 @@ // handy shared exception makers (they simplify the common case code) private static InternalError newInternalError(String message, Throwable cause) { - return new InternalError(message, cause); + InternalError e = new InternalError(message); + e.initCause(cause); + return e; } private static InternalError newInternalError(Throwable cause) { - return new InternalError(cause); + InternalError e = new InternalError(); + e.initCause(cause); + return e; } } diff --git a/src/share/classes/sun/misc/Unsafe.java b/src/share/classes/sun/misc/Unsafe.java --- a/src/share/classes/sun/misc/Unsafe.java +++ b/src/share/classes/sun/misc/Unsafe.java @@ -678,6 +678,14 @@ public native Object staticFieldBase(Field f); /** + * Detect if the given class may need to be initialized. This is often + * needed in conjunction with obtaining the static field base of a + * class. + * @return false only if a call to {@code ensureClassInitialized} would have no effect + */ + public native boolean shouldBeInitialized(Class c); + + /** * Ensure the given class has been initialized. This is often * needed in conjunction with obtaining the static field base of a * class.
16-10-2012

http://cr.openjdk.java.net/~twisti/8000999
16-10-2012