[7u12] Request for approval for CR 8000999: backport of JSR 292 to 7u
Christian Thalinger
christian.thalinger at oracle.com
Thu Oct 18 12:22:47 PDT 2012
On Oct 18, 2012, at 12:17 PM, Christian Thalinger <christian.thalinger at oracle.com> wrote:
>
> On Oct 18, 2012, at 12:00 PM, mark.reinhold at oracle.com wrote:
>
>> 2012/10/18 11:54 -0700, christian.thalinger at oracle.com:
>>> Webrev: http://cr.openjdk.java.net/~twisti/8000999/
>>> 8000999: backport of JSR 292 to 7u
>>>
>>> This is an umbrella bug for these changes (which are backported in one
>>> changeset):
>>>
>>> ...
>>
>> Um, isn't this an awfully big change for what's supposed to be a low-risk
>> update release?
>
> It's big, indeed. But actually it's a bug fix and it only touches JSR 292 related files and functionality.
>
> Since PR decided that HS24 will be used for 7u12 (which I applaud to) we need these changes in 7. Otherwise it doesn't work.
I forgot to add the diff between 7 and 8 after this change goes in. There is also a review request on hotspot-dev.
-- Chris
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.
More information about the jdk7u-dev
mailing list