RFR(M) JDK-8031819: Remove legacy jdk checks and code

David Holmes david.holmes at oracle.com
Fri Jun 6 05:26:03 UTC 2014


Hi Harold,

Love to see this cleanup! :) But everyone needs to be very aware that 
once this goes in you can forget about placing a JDK 9 VM anywhere but a 
JDK 9 JDK. (Or did we already hit that?)

A few comments and further cleanups:

In classLoader.* is it worth renaming/absorbing the is_rt_jar13 and 
related "13" items?

---

javaClasses.cpp:

This comment:

1732   // For Java 7+ we support the Throwable immutability protocol 
defined for Java 7. This support
1733   // was missing in 7u0 so in 7u0 there is a workaround in the 
Throwable class. That workaround
1734   // can be removed in a JDK using this JVM version

can be reduced to simply:

1732   // We support the Throwable immutability protocol defined since 
Java 7.

Or even deleted completely.

---

systemDictionary.hpp:

The check_klass_Opt_Only_JDK* functions seem to be unused and only 
generated assertion failures when they were used.

---

linkResolver.cpp

The comment above the change seems irrelevant now the change is made.

---

reflection.cpp

Comment:

  423   // New (1.4) reflection implementation. Allow all accesses from
  424   // sun/reflect/MagicAccessorImpl subclasses to succeed trivially.

can drop the first sentence. Ditto #526

---

reflectionUtils.cpp


This comment makes no sense without a specific version reference and can 
be deleted:

  79   // The following class fields do not exist in previous version of jdk

---

thread.cpp:

You must a chunk of code regarding uncaught exception handling:

1744     // JSR-166: change call from from ThreadGroup.uncaughtException to
1745     // java.lang.Thread.dispatchUncaughtException
1746     if (uncaught_exception.not_null()) {
1747       Handle group(this, java_lang_Thread::threadGroup(threadObj()));
1748       {
1749         EXCEPTION_MARK;
1750         // Check if the method Thread.dispatchUncaughtException() 
exists. If so
1751         // call it.  Otherwise we have an older library without the 
JSR-166 changes,
1752         // so call ThreadGroup.uncaughtException()

We only need the code that calls dispatchUncaughtException.

---

threadService.cpp

You don't need the block that used to delineate the "if" statement. ie 
lines:

  668   {
  678   }

can be deleted and the indentation fixed up.

---

src/share/vm/prims/unsafe.cpp:

There is unused code in here too:  Unsafe_SetObject140,  Unsafe_GetObject140

Cheers,
David

On 5/06/2014 1:34 AM, harold seigel wrote:
> Hi,
>
> Please review this JDK 9 fix for bug JDK-8031819.  The fix removes
> legacy code for old JDK versions.  Although the webrev contains lots of
> files, the changes are not complicated.
>
> Open webrev: http://cr.openjdk.java.net/~hseigel/bug_8031819/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8031819
>
> The fix was tested with the Hotspot JTREG tests, JCK Lang, VM, and
> API/java_lang tests, nsk Quick tests, and JPRT.
>
> Thanks! Harold


More information about the hotspot-runtime-dev mailing list