From de93893f4e5583fbebf688351f7fc606d6e8eac1 Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Tue, 21 May 2013 09:43:23 -0700 Subject: [PATCH 01/29] 8013726: runtime/memory/ReserveMemory.java fails due to 'assert(bytes % os::vm_allocation_granularity() == 0) failed: reserve block size' Fix regression test to work on all platforms Reviewed-by: ctornqvi, dholmes --- hotspot/src/share/vm/prims/whitebox.cpp | 17 ++++++++++++--- .../test/runtime/memory/ReserveMemory.java | 21 +++++++------------ .../whitebox/sun/hotspot/WhiteBox.java | 2 +- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 7742c036114..92f2349bb7c 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -37,6 +37,7 @@ #include "runtime/os.hpp" #include "utilities/debug.hpp" #include "utilities/macros.hpp" +#include "utilities/exceptions.hpp" #if INCLUDE_ALL_GCS #include "gc_implementation/g1/concurrentMark.hpp" @@ -330,8 +331,18 @@ WB_ENTRY(void, WB_FullGC(JNIEnv* env, jobject o)) WB_END -WB_ENTRY(jlong, WB_ReserveMemory(JNIEnv* env, jobject o, jlong size)) - return (jlong)os::reserve_memory(size, NULL, 0); +WB_ENTRY(void, WB_ReadReservedMemory(JNIEnv* env, jobject o)) + // static+volatile in order to force the read to happen + // (not be eliminated by the compiler) + static char c; + static volatile char* p; + + p = os::reserve_memory(os::vm_allocation_granularity(), NULL, 0); + if (p == NULL) { + THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(), "Failed to reserve memory"); + } + + c = *p; WB_END //Some convenience methods to deal with objects from java @@ -437,7 +448,7 @@ static JNINativeMethod methods[] = { {CC"isInStringTable", CC"(Ljava/lang/String;)Z", (void*)&WB_IsInStringTable }, {CC"fullGC", CC"()V", (void*)&WB_FullGC }, - {CC"reserveMemory", CC"(J)J", (void*)&WB_ReserveMemory }, + {CC"readReservedMemory", CC"()V", (void*)&WB_ReadReservedMemory }, }; #undef CC diff --git a/hotspot/test/runtime/memory/ReserveMemory.java b/hotspot/test/runtime/memory/ReserveMemory.java index fbf1a413371..4d234d34d80 100644 --- a/hotspot/test/runtime/memory/ReserveMemory.java +++ b/hotspot/test/runtime/memory/ReserveMemory.java @@ -34,29 +34,20 @@ import com.oracle.java.testlibrary.*; -import java.lang.reflect.Field; import sun.hotspot.WhiteBox; -import sun.misc.Unsafe; public class ReserveMemory { - private static Unsafe getUnsafe() throws Exception { - Field f = Unsafe.class.getDeclaredField("theUnsafe"); - f.setAccessible(true); - return (Unsafe)f.get(null); - } - private static boolean isWindows() { return System.getProperty("os.name").toLowerCase().startsWith("win"); } + private static boolean isOsx() { + return System.getProperty("os.name").toLowerCase().startsWith("mac"); + } + public static void main(String args[]) throws Exception { if (args.length > 0) { - long address = WhiteBox.getWhiteBox().reserveMemory(4096); - - System.out.println("Reserved memory at address: 0x" + Long.toHexString(address)); - System.out.println("Will now read from the address, expecting a crash!"); - - int x = getUnsafe().getInt(address); + WhiteBox.getWhiteBox().readReservedMemory(); throw new Exception("Read of reserved/uncommitted memory unexpectedly succeeded, expected crash!"); } @@ -71,6 +62,8 @@ public class ReserveMemory { OutputAnalyzer output = new OutputAnalyzer(pb.start()); if (isWindows()) { output.shouldContain("EXCEPTION_ACCESS_VIOLATION"); + } else if (isOsx()) { + output.shouldContain("SIGBUS"); } else { output.shouldContain("SIGSEGV"); } diff --git a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java index cd3f576d986..3e451213311 100644 --- a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java +++ b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java @@ -115,7 +115,7 @@ public class WhiteBox { public native boolean isInStringTable(String str); // Memory - public native long reserveMemory(long size); + public native void readReservedMemory(); // force Full GC public native void fullGC(); From 19da55568fd2ac858fb02edf91f2589b173e4213 Mon Sep 17 00:00:00 2001 From: Bharadwaj Yadavalli Date: Tue, 21 May 2013 16:17:51 -0700 Subject: [PATCH 02/29] 8014059: JSR292: Failed to reject invalid class cplmhl00201m28n Restrict reference of interface methods by invokestatic and invokespecial to classfile version 52 or later. Reviewed-by: kvn, hseigel --- hotspot/src/share/vm/classfile/classFileParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 6b2ddd140c6..f7676c0def4 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -444,8 +444,8 @@ constantPoolHandle ClassFileParser::parse_constant_pool(TRAPS) { break; case JVM_REF_invokeStatic: case JVM_REF_invokeSpecial: - check_property( - tag.is_method() || tag.is_interface_method(), + check_property(tag.is_method() || + ((_major_version >= JAVA_8_VERSION) && tag.is_interface_method()), "Invalid constant pool index %u in class file %s (not a method)", ref_index, CHECK_(nullHandle)); break; From 7c1db2aff08c2e3aaa267df76a9929b1138882db Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Wed, 22 May 2013 17:26:31 +0200 Subject: [PATCH 03/29] 8014514: Fix jvm args for sjavac Reviewed-by: tbell --- common/autoconf/basics.m4 | 17 +- common/autoconf/build-performance.m4 | 69 ++--- common/autoconf/generated-configure.sh | 381 +++++++++++++------------ 3 files changed, 242 insertions(+), 225 deletions(-) diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 20f444ff702..550045b3cec 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -23,14 +23,23 @@ # questions. # +# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) +# If so, then append $1 to $2\ +# Also set JVM_ARG_OK to true/false depending on outcome. AC_DEFUN([ADD_JVM_ARG_IF_OK], [ - # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) - # If so, then append $1 to $2 - FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn` - FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: $1" >&AS_MESSAGE_LOG_FD + $ECHO "Command: $3 $1 -version" >&AS_MESSAGE_LOG_FD + OUTPUT=`$3 $1 -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then $2="[$]$2 $1" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&AS_MESSAGE_LOG_FD + $ECHO "$OUTPUT" >&AS_MESSAGE_LOG_FD + JVM_ARG_OK=false fi ]) diff --git a/common/autoconf/build-performance.m4 b/common/autoconf/build-performance.m4 index 12075413070..e7d6364edff 100644 --- a/common/autoconf/build-performance.m4 +++ b/common/autoconf/build-performance.m4 @@ -278,60 +278,37 @@ else fi AC_SUBST(SJAVAC_SERVER_JAVA) -AC_ARG_WITH(sjavac-server-cores, [AS_HELP_STRING([--with-sjavac-server-cores], - [use at most this number of concurrent threads on the sjavac server @<:@probed@:>@])]) -if test "x$with_sjavac_server_cores" != x; then - SJAVAC_SERVER_CORES="$with_sjavac_server_cores" -else - if test "$NUM_CORES" -gt 16; then - # We set this arbitrary limit because we want to limit the heap - # size of the javac server. - # In the future we will make the javac compilers in the server - # share more and more state, thus enabling us to use more and - # more concurrent threads in the server. - SJAVAC_SERVER_CORES="16" - else - SJAVAC_SERVER_CORES="$NUM_CORES" +if test "$MEMORY_SIZE" -gt "2500"; then + ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) + if test "$JVM_ARG_OK" = true; then + JVM_64BIT=true + JVM_ARG_OK=false + fi fi +if test "$JVM_64BIT" = true; then if test "$MEMORY_SIZE" -gt "17000"; then - MAX_HEAP_MEM=10000 - ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - elif test "$MEMORY_SIZE" -gt "10000"; then - MAX_HEAP_MEM=6000 - ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) + fi + if test "$MEMORY_SIZE" -gt "10000" && test "$JVM_ARG_OK" = false; then ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - elif test "$MEMORY_SIZE" -gt "5000"; then - MAX_HEAP_MEM=3000 - ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) + fi + if test "$MEMORY_SIZE" -gt "5000" && test "$JVM_ARG_OK" = false; then ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - elif test "$MEMORY_SIZE" -gt "3800"; then - MAX_HEAP_MEM=2500 + fi + if test "$MEMORY_SIZE" -gt "3800" && test "$JVM_ARG_OK" = false; then ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - elif test "$MEMORY_SIZE" -gt "1900"; then - MAX_HEAP_MEM=1200 - ADD_JVM_ARG_IF_OK([-Xms700M -Xmx1400M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - elif test "$MEMORY_SIZE" -gt "1000"; then - MAX_HEAP_MEM=900 - ADD_JVM_ARG_IF_OK([-Xms400M -Xmx1100M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - else - MAX_HEAP_MEM=512 - ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) fi - - ADD_JVM_ARG_IF_OK([-XX:PermSize=32m],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - ADD_JVM_ARG_IF_OK([-XX:MaxPermSize=160m],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) - - MAX_COMPILERS_IN_HEAP=`expr $MAX_HEAP_MEM / 501` - if test "$SJAVAC_SERVER_CORES" -gt "$MAX_COMPILERS_IN_HEAP"; then - AC_MSG_CHECKING([if number of server cores must be reduced]) - SJAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP" - AC_MSG_RESULT([yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB]) - fi -fi -AC_SUBST(SJAVAC_SERVER_CORES) +fi +if test "$MEMORY_SIZE" -gt "2500" && test "$JVM_ARG_OK" = false; then + ADD_JVM_ARG_IF_OK([-Xms1000M -Xmx1500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) +fi +if test "$MEMORY_SIZE" -gt "1000" && test "$JVM_ARG_OK" = false; then + ADD_JVM_ARG_IF_OK([-Xms400M -Xmx1100M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) +fi +if test "$JVM_ARG_OK" = false; then + ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA]) +fi AC_MSG_CHECKING([whether to use sjavac]) AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac], diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 832b6410016..0aae6e6ca9f 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -599,7 +599,6 @@ CCACHE USE_PRECOMPILED_HEADER SJAVAC_SERVER_DIR ENABLE_SJAVAC -SJAVAC_SERVER_CORES SJAVAC_SERVER_JAVA JOBS MEMORY_SIZE @@ -1025,7 +1024,6 @@ with_num_cores with_memory_size with_jobs with_sjavac_server_java -with_sjavac_server_cores enable_sjavac enable_precompiled_headers enable_ccache @@ -1796,9 +1794,6 @@ Optional Packages: --with-sjavac-server-java use this java binary for running the sjavac background server [Boot JDK java] - --with-sjavac-server-cores - use at most this number of concurrent threads on the - sjavac server [probed] --with-ccache-dir where to store ccache files [~/.ccache] Some influential environment variables: @@ -3077,6 +3072,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # questions. # +# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3) +# If so, then append $1 to $2\ +# Also set JVM_ARG_OK to true/false depending on outcome. # This will make sure the given variable points to a full and proper @@ -3775,7 +3773,7 @@ fi #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1367502949 +DATE_WHEN_GENERATED=1369236348 ############################################################################### # @@ -15705,73 +15703,115 @@ if test "x$with_boot_jdk_jvmargs" = x; then # Minimum amount of heap memory. - # Test if -Xms64M is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -Xms64M to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -Xms64M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -Xms64M -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -Xms64M" >&5 + $ECHO "Command: $JAVA -Xms64M -version" >&5 + OUTPUT=`$JAVA -Xms64M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -Xms64M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then # Why does macosx need more heap? Its the huge JDK batch. - # Test if -Xmx1600M is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -Xmx1600M to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -Xmx1600M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -Xmx1600M -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -Xmx1600M" >&5 + $ECHO "Command: $JAVA -Xmx1600M -version" >&5 + OUTPUT=`$JAVA -Xmx1600M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -Xmx1600M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi else - # Test if -Xmx1100M is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -Xmx1100M to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -Xmx1100M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -Xmx1100M -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -Xmx1100M" >&5 + $ECHO "Command: $JAVA -Xmx1100M -version" >&5 + OUTPUT=`$JAVA -Xmx1100M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -Xmx1100M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi fi # When is adding -client something that speeds up the JVM? # ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA]) - # Test if -XX:PermSize=32m is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -XX:PermSize=32m to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -XX:PermSize=32m -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -XX:PermSize=32m -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -XX:PermSize=32m" >&5 + $ECHO "Command: $JAVA -XX:PermSize=32m -version" >&5 + OUTPUT=`$JAVA -XX:PermSize=32m -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:PermSize=32m" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi - # Test if -XX:MaxPermSize=160m is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -XX:MaxPermSize=160m to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -XX:MaxPermSize=160m -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -XX:MaxPermSize=160m -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -XX:MaxPermSize=160m" >&5 + $ECHO "Command: $JAVA -XX:MaxPermSize=160m -version" >&5 + OUTPUT=`$JAVA -XX:MaxPermSize=160m -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:MaxPermSize=160m" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi - # Test if -XX:ThreadStackSize=$STACK_SIZE is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -XX:ThreadStackSize=$STACK_SIZE to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -XX:ThreadStackSize=$STACK_SIZE" >&5 + $ECHO "Command: $JAVA -XX:ThreadStackSize=$STACK_SIZE -version" >&5 + OUTPUT=`$JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:ThreadStackSize=$STACK_SIZE" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi # Disable special log output when a debug build is used as Boot JDK... - # Test if -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput to boot_jdk_jvmargs - FOUND_WARN=`$JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" >&5 + $ECHO "Command: $JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version" >&5 + OUTPUT=`$JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi fi @@ -32664,192 +32704,183 @@ else SJAVAC_SERVER_JAVA="" # Hotspot specific options. - # Test if -verbosegc is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -verbosegc to SJAVAC_SERVER_JAVA - FOUND_WARN=`$JAVA -verbosegc -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -verbosegc -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -verbosegc" >&5 + $ECHO "Command: $JAVA -verbosegc -version" >&5 + OUTPUT=`$JAVA -verbosegc -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -verbosegc" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi # JRockit specific options. - # Test if -Xverbose:gc is a valid argument to $JAVA (often is $JAVA passed as $JAVA) - # If so, then append -Xverbose:gc to SJAVAC_SERVER_JAVA - FOUND_WARN=`$JAVA -Xverbose:gc -version 2>&1 | grep -i warn` - FOUND_VERSION=`$JAVA -Xverbose:gc -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -Xverbose:gc" >&5 + $ECHO "Command: $JAVA -Xverbose:gc -version" >&5 + OUTPUT=`$JAVA -Xverbose:gc -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xverbose:gc" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi SJAVAC_SERVER_JAVA="$JAVA $SJAVAC_SERVER_JAVA" fi +if test "$MEMORY_SIZE" -gt "2500"; then -# Check whether --with-sjavac-server-cores was given. -if test "${with_sjavac_server_cores+set}" = set; then : - withval=$with_sjavac_server_cores; -fi - -if test "x$with_sjavac_server_cores" != x; then - SJAVAC_SERVER_CORES="$with_sjavac_server_cores" -else - if test "$NUM_CORES" -gt 16; then - # We set this arbitrary limit because we want to limit the heap - # size of the javac server. - # In the future we will make the javac compilers in the server - # share more and more state, thus enabling us to use more and - # more concurrent threads in the server. - SJAVAC_SERVER_CORES="16" - else - SJAVAC_SERVER_CORES="$NUM_CORES" - fi - - if test "$MEMORY_SIZE" -gt "17000"; then - MAX_HEAP_MEM=10000 - - # Test if -d64 is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -d64 to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -d64" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -d64 -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -d64" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi + if test "$JVM_ARG_OK" = true; then + JVM_64BIT=true + JVM_ARG_OK=false + fi + fi - # Test if -Xms10G -Xmx10G is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms10G -Xmx10G to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version 2>&1 | grep " version \""` +if test "$JVM_64BIT" = true; then + if test "$MEMORY_SIZE" -gt "17000"; then + + $ECHO "Check if jvm arg is ok: -Xms10G -Xmx10G" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms10G -Xmx10G" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi - elif test "$MEMORY_SIZE" -gt "10000"; then - MAX_HEAP_MEM=6000 - - # Test if -d64 is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -d64 to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -d64" fi + if test "$MEMORY_SIZE" -gt "10000" && test "$JVM_ARG_OK" = false; then - - # Test if -Xms6G -Xmx6G is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms6G -Xmx6G to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -Xms6G -Xmx6G" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms6G -Xmx6G" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi - elif test "$MEMORY_SIZE" -gt "5000"; then - MAX_HEAP_MEM=3000 - - # Test if -d64 is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -d64 to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -d64 -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -d64" fi + if test "$MEMORY_SIZE" -gt "5000" && test "$JVM_ARG_OK" = false; then - - # Test if -Xms1G -Xmx3G is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms1G -Xmx3G to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -Xms1G -Xmx3G" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1G -Xmx3G" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi - elif test "$MEMORY_SIZE" -gt "3800"; then - MAX_HEAP_MEM=2500 + fi + if test "$MEMORY_SIZE" -gt "3800" && test "$JVM_ARG_OK" = false; then - # Test if -Xms1G -Xmx2500M is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms1G -Xmx2500M to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version 2>&1 | grep " version \""` + $ECHO "Check if jvm arg is ok: -Xms1G -Xmx2500M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1G -Xmx2500M" - fi - - elif test "$MEMORY_SIZE" -gt "1900"; then - MAX_HEAP_MEM=1200 - - # Test if -Xms700M -Xmx1400M is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms700M -Xmx1400M to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms700M -Xmx1400M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms700M -Xmx1400M -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms700M -Xmx1400M" - fi - - elif test "$MEMORY_SIZE" -gt "1000"; then - MAX_HEAP_MEM=900 - - # Test if -Xms400M -Xmx1100M is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms400M -Xmx1100M to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M" - fi - + JVM_ARG_OK=true else - MAX_HEAP_MEM=512 - - # Test if -Xms256M -Xmx512M is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -Xms256M -Xmx512M to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M" + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false fi fi - - - # Test if -XX:PermSize=32m is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -XX:PermSize=32m to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -XX:PermSize=32m -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -XX:PermSize=32m -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -XX:PermSize=32m" - fi - - - # Test if -XX:MaxPermSize=160m is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -XX:MaxPermSize=160m to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -XX:MaxPermSize=160m -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -XX:MaxPermSize=160m -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -XX:MaxPermSize=160m" - fi - - - # Test if -XX:ThreadStackSize=$STACK_SIZE is a valid argument to $SJAVAC_SERVER_JAVA (often is $JAVA passed as $SJAVAC_SERVER_JAVA) - # If so, then append -XX:ThreadStackSize=$STACK_SIZE to SJAVAC_SERVER_JAVA - FOUND_WARN=`$SJAVAC_SERVER_JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1 | grep -i warn` - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -XX:ThreadStackSize=$STACK_SIZE -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -XX:ThreadStackSize=$STACK_SIZE" - fi - - - MAX_COMPILERS_IN_HEAP=`expr $MAX_HEAP_MEM / 501` - if test "$SJAVAC_SERVER_CORES" -gt "$MAX_COMPILERS_IN_HEAP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if number of server cores must be reduced" >&5 -$as_echo_n "checking if number of server cores must be reduced... " >&6; } - SJAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB" >&5 -$as_echo "yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB" >&6; } - fi fi +if test "$MEMORY_SIZE" -gt "2500" && test "$JVM_ARG_OK" = false; then + $ECHO "Check if jvm arg is ok: -Xms1000M -Xmx1500M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms1000M -Xmx1500M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + +fi +if test "$MEMORY_SIZE" -gt "1000" && test "$JVM_ARG_OK" = false; then + + $ECHO "Check if jvm arg is ok: -Xms400M -Xmx1100M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms400M -Xmx1100M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + +fi +if test "$JVM_ARG_OK" = false; then + + $ECHO "Check if jvm arg is ok: -Xms256M -Xmx512M" >&5 + $ECHO "Command: $SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version" >&5 + OUTPUT=`$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + SJAVAC_SERVER_JAVA="$SJAVAC_SERVER_JAVA -Xms256M -Xmx512M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use sjavac" >&5 $as_echo_n "checking whether to use sjavac... " >&6; } From 6ed8c8fcea1f1b2549c4b8a09e492b3247e32394 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Wed, 22 May 2013 14:37:49 -0400 Subject: [PATCH 04/29] 8003421: NPG: Move oops out of InstanceKlass into mirror Inject protection_domain, signers, init_lock into java_lang_Class Reviewed-by: stefank, dholmes, sla --- .../jvm/hotspot/memory/DictionaryEntry.java | 7 ++- .../sun/jvm/hotspot/oops/InstanceKlass.java | 8 --- .../jvm/hotspot/utilities/HeapGXLWriter.java | 12 ++-- .../hotspot/utilities/HeapHprofBinWriter.java | 8 +-- .../utilities/soql/JSJavaInstanceKlass.java | 8 --- .../share/vm/classfile/classFileParser.cpp | 14 +---- .../src/share/vm/classfile/javaClasses.cpp | 63 +++++++++++++++---- .../src/share/vm/classfile/javaClasses.hpp | 19 +++++- hotspot/src/share/vm/classfile/vmSymbols.hpp | 3 + hotspot/src/share/vm/oops/arrayKlass.cpp | 2 +- hotspot/src/share/vm/oops/instanceKlass.cpp | 57 ++++++----------- hotspot/src/share/vm/oops/instanceKlass.hpp | 36 +++-------- hotspot/src/share/vm/oops/klass.cpp | 5 +- hotspot/src/share/vm/oops/klass.hpp | 2 +- hotspot/src/share/vm/oops/objArrayKlass.hpp | 2 +- hotspot/src/share/vm/oops/typeArrayKlass.hpp | 2 + hotspot/src/share/vm/prims/jvm.cpp | 14 ++--- hotspot/src/share/vm/runtime/vmStructs.cpp | 4 +- 18 files changed, 130 insertions(+), 136 deletions(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java index be40fd44c51..301410408d2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java @@ -96,9 +96,10 @@ public class DictionaryEntry extends sun.jvm.hotspot.utilities.HashtableEntry { public boolean containsProtectionDomain(Oop protectionDomain) { InstanceKlass ik = (InstanceKlass) klass(); - if (protectionDomain.equals(ik.getProtectionDomain())) { - return true; // Succeeds trivially - } + // Currently unimplemented and not used. + // if (protectionDomain.equals(ik.getJavaMirror().getProtectionDomain())) { + // return true; // Succeeds trivially + // } for (ProtectionDomainEntry current = pdSet(); current != null; current = current.next()) { if (protectionDomain.equals(current.protectionDomain())) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java index cfa26eacdbd..80d5b795b3f 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java @@ -75,8 +75,6 @@ public class InstanceKlass extends Klass { javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), 0); constants = new MetadataField(type.getAddressField("_constants"), 0); classLoaderData = type.getAddressField("_class_loader_data"); - protectionDomain = new OopField(type.getOopField("_protection_domain"), 0); - signers = new OopField(type.getOopField("_signers"), 0); sourceFileName = type.getAddressField("_source_file_name"); sourceDebugExtension = type.getAddressField("_source_debug_extension"); innerClasses = type.getAddressField("_inner_classes"); @@ -136,8 +134,6 @@ public class InstanceKlass extends Klass { private static CIntField javaFieldsCount; private static MetadataField constants; private static AddressField classLoaderData; - private static OopField protectionDomain; - private static OopField signers; private static AddressField sourceFileName; private static AddressField sourceDebugExtension; private static AddressField innerClasses; @@ -350,8 +346,6 @@ public class InstanceKlass extends Klass { public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); } public ClassLoaderData getClassLoaderData() { return ClassLoaderData.instantiateWrapperFor(classLoaderData.getValue(getAddress())); } public Oop getClassLoader() { return getClassLoaderData().getClassLoader(); } - public Oop getProtectionDomain() { return protectionDomain.getValue(this); } - public ObjArray getSigners() { return (ObjArray) signers.getValue(this); } public Symbol getSourceFileName() { return getSymbol(sourceFileName); } public String getSourceDebugExtension(){ return CStringUtilities.getString(sourceDebugExtension.getValue(getAddress())); } public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); } @@ -541,8 +535,6 @@ public class InstanceKlass extends Klass { // visitor.doOop(methods, true); // visitor.doOop(localInterfaces, true); // visitor.doOop(transitiveInterfaces, true); - visitor.doOop(protectionDomain, true); - visitor.doOop(signers, true); visitor.doCInt(nonstaticFieldSize, true); visitor.doCInt(staticFieldSize, true); visitor.doCInt(staticOopFieldCount, true); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java index f5058386662..47494e826b3 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java @@ -204,13 +204,13 @@ public class HeapGXLWriter extends AbstractHeapGraphWriter { Oop loader = ik.getClassLoader(); writeEdge(instance, loader, "loaded-by"); - // write signers - Oop signers = ik.getSigners(); - writeEdge(instance, signers, "signed-by"); + // write signers NYI + // Oop signers = ik.getJavaMirror().getSigners(); + writeEdge(instance, null, "signed-by"); - // write protection domain - Oop protectionDomain = ik.getProtectionDomain(); - writeEdge(instance, protectionDomain, "protection-domain"); + // write protection domain NYI + // Oop protectionDomain = ik.getJavaMirror().getProtectionDomain(); + writeEdge(instance, null, "protection-domain"); // write edges for static reference fields from this class for (Iterator itr = refFields.iterator(); itr.hasNext();) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java index 58fd75ee8b8..65299721f17 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java @@ -477,8 +477,8 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { if (k instanceof InstanceKlass) { InstanceKlass ik = (InstanceKlass) k; writeObjectID(ik.getClassLoader()); - writeObjectID(ik.getSigners()); - writeObjectID(ik.getProtectionDomain()); + writeObjectID(null); // ik.getJavaMirror().getSigners()); + writeObjectID(null); // ik.getJavaMirror().getProtectionDomain()); // two reserved id fields writeObjectID(null); writeObjectID(null); @@ -516,8 +516,8 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { if (bottomKlass instanceof InstanceKlass) { InstanceKlass ik = (InstanceKlass) bottomKlass; writeObjectID(ik.getClassLoader()); - writeObjectID(ik.getSigners()); - writeObjectID(ik.getProtectionDomain()); + writeObjectID(null); // ik.getJavaMirror().getSigners()); + writeObjectID(null); // ik.getJavaMirror().getProtectionDomain()); } else { writeObjectID(null); writeObjectID(null); diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java index 7198e5cec14..a76e5ddbf31 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java @@ -47,8 +47,6 @@ public class JSJavaInstanceKlass extends JSJavaKlass { private static final int FIELD_IS_SYNTHETIC = 13; private static final int FIELD_IS_INTERFACE = 14; private static final int FIELD_CLASS_LOADER = 15; - private static final int FIELD_PROTECTION_DOMAIN = 16; - private static final int FIELD_SIGNERS = 17; private static final int FIELD_STATICS = 18; private static final int FIELD_UNDEFINED = -1; @@ -100,10 +98,6 @@ public class JSJavaInstanceKlass extends JSJavaKlass { return Boolean.valueOf(ik.isInterface()); case FIELD_CLASS_LOADER: return factory.newJSJavaObject(ik.getClassLoader()); - case FIELD_PROTECTION_DOMAIN: - return factory.newJSJavaObject(ik.getProtectionDomain()); - case FIELD_SIGNERS: - return factory.newJSJavaObject(ik.getSigners()); case FIELD_STATICS: return getStatics(); case FIELD_UNDEFINED: @@ -246,8 +240,6 @@ public class JSJavaInstanceKlass extends JSJavaKlass { addField("isSynthetic", FIELD_IS_SYNTHETIC); addField("isInterface", FIELD_IS_INTERFACE); addField("classLoader", FIELD_CLASS_LOADER); - addField("protectionDomain", FIELD_PROTECTION_DOMAIN); - addField("signers", FIELD_SIGNERS); addField("statics", FIELD_STATICS); } diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index f7676c0def4..8aa15736447 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -4040,6 +4040,9 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, } } + // Allocate mirror and initialize static fields + java_lang_Class::create_mirror(this_klass, protection_domain, CHECK_(nullHandle)); + #ifdef ASSERT if (ParseAllGenericSignatures) { @@ -4055,17 +4058,6 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, this_klass(), &all_mirandas, CHECK_(nullHandle)); } - // Allocate mirror and initialize static fields - java_lang_Class::create_mirror(this_klass, CHECK_(nullHandle)); - - // Allocate a simple java object for locking during class initialization. - // This needs to be a java object because it can be held across a java call. - typeArrayOop r = oopFactory::new_typeArray(T_INT, 0, CHECK_NULL); - this_klass->set_init_lock(r); - - // TODO: Move these oops to the mirror - this_klass->set_protection_domain(protection_domain()); - // Update the loader_data graph. record_defined_class_dependencies(this_klass, CHECK_NULL); diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index bb02a6d8694..cbe3581ff4a 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -512,22 +512,22 @@ void java_lang_Class::fixup_mirror(KlassHandle k, TRAPS) { // If the offset was read from the shared archive, it was fixed up already if (!k->is_shared()) { - if (k->oop_is_instance()) { - // During bootstrap, java.lang.Class wasn't loaded so static field - // offsets were computed without the size added it. Go back and - // update all the static field offsets to included the size. - for (JavaFieldStream fs(InstanceKlass::cast(k())); !fs.done(); fs.next()) { - if (fs.access_flags().is_static()) { - int real_offset = fs.offset() + InstanceMirrorKlass::offset_of_static_fields(); - fs.set_offset(real_offset); + if (k->oop_is_instance()) { + // During bootstrap, java.lang.Class wasn't loaded so static field + // offsets were computed without the size added it. Go back and + // update all the static field offsets to included the size. + for (JavaFieldStream fs(InstanceKlass::cast(k())); !fs.done(); fs.next()) { + if (fs.access_flags().is_static()) { + int real_offset = fs.offset() + InstanceMirrorKlass::offset_of_static_fields(); + fs.set_offset(real_offset); + } } } } - } - create_mirror(k, CHECK); + create_mirror(k, Handle(NULL), CHECK); } -oop java_lang_Class::create_mirror(KlassHandle k, TRAPS) { +oop java_lang_Class::create_mirror(KlassHandle k, Handle protection_domain, TRAPS) { assert(k->java_mirror() == NULL, "should only assign mirror once"); // Use this moment of initialization to cache modifier_flags also, // to support Class.getModifiers(). Instance classes recalculate @@ -563,6 +563,16 @@ oop java_lang_Class::create_mirror(KlassHandle k, TRAPS) { set_array_klass(comp_mirror(), k()); } else { assert(k->oop_is_instance(), "Must be"); + + // Allocate a simple java object for a lock. + // This needs to be a java object because during class initialization + // it can be held across a java call. + typeArrayOop r = oopFactory::new_typeArray(T_INT, 0, CHECK_NULL); + set_init_lock(mirror(), r); + + // Set protection domain also + set_protection_domain(mirror(), protection_domain()); + // Initialize static fields InstanceKlass::cast(k())->do_local_static_fields(&initialize_static_field, CHECK_NULL); } @@ -597,6 +607,34 @@ void java_lang_Class::set_static_oop_field_count(oop java_class, int size) { java_class->int_field_put(_static_oop_field_count_offset, size); } +oop java_lang_Class::protection_domain(oop java_class) { + assert(_protection_domain_offset != 0, "must be set"); + return java_class->obj_field(_protection_domain_offset); +} +void java_lang_Class::set_protection_domain(oop java_class, oop pd) { + assert(_protection_domain_offset != 0, "must be set"); + java_class->obj_field_put(_protection_domain_offset, pd); +} + +oop java_lang_Class::init_lock(oop java_class) { + assert(_init_lock_offset != 0, "must be set"); + return java_class->obj_field(_init_lock_offset); +} +void java_lang_Class::set_init_lock(oop java_class, oop init_lock) { + assert(_init_lock_offset != 0, "must be set"); + java_class->obj_field_put(_init_lock_offset, init_lock); +} + +objArrayOop java_lang_Class::signers(oop java_class) { + assert(_signers_offset != 0, "must be set"); + return (objArrayOop)java_class->obj_field(_signers_offset); +} +void java_lang_Class::set_signers(oop java_class, objArrayOop signers) { + assert(_signers_offset != 0, "must be set"); + java_class->obj_field_put(_signers_offset, (oop)signers); +} + + oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS) { // This should be improved by adding a field at the Java level or by // introducing a new VM klass (see comment in ClassFileParser) @@ -2934,6 +2972,9 @@ int java_lang_Class::_klass_offset; int java_lang_Class::_array_klass_offset; int java_lang_Class::_oop_size_offset; int java_lang_Class::_static_oop_field_count_offset; +int java_lang_Class::_protection_domain_offset; +int java_lang_Class::_init_lock_offset; +int java_lang_Class::_signers_offset; GrowableArray* java_lang_Class::_fixup_mirror_list = NULL; int java_lang_Throwable::backtrace_offset; int java_lang_Throwable::detailMessage_offset; diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 8e4dd46f3e9..e240bc27e43 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -208,7 +208,10 @@ class java_lang_String : AllStatic { macro(java_lang_Class, klass, intptr_signature, false) \ macro(java_lang_Class, array_klass, intptr_signature, false) \ macro(java_lang_Class, oop_size, int_signature, false) \ - macro(java_lang_Class, static_oop_field_count, int_signature, false) + macro(java_lang_Class, static_oop_field_count, int_signature, false) \ + macro(java_lang_Class, protection_domain, object_signature, false) \ + macro(java_lang_Class, init_lock, object_signature, false) \ + macro(java_lang_Class, signers, object_signature, false) class java_lang_Class : AllStatic { friend class VMStructs; @@ -222,15 +225,20 @@ class java_lang_Class : AllStatic { static int _oop_size_offset; static int _static_oop_field_count_offset; + static int _protection_domain_offset; + static int _init_lock_offset; + static int _signers_offset; + static bool offsets_computed; static int classRedefinedCount_offset; static GrowableArray* _fixup_mirror_list; + static void set_init_lock(oop java_class, oop init_lock); public: static void compute_offsets(); // Instance creation - static oop create_mirror(KlassHandle k, TRAPS); + static oop create_mirror(KlassHandle k, Handle protection_domain, TRAPS); static void fixup_mirror(KlassHandle k, TRAPS); static oop create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS); // Conversion @@ -262,6 +270,13 @@ class java_lang_Class : AllStatic { static int classRedefinedCount(oop the_class_mirror); static void set_classRedefinedCount(oop the_class_mirror, int value); + // Support for embedded per-class oops + static oop protection_domain(oop java_class); + static void set_protection_domain(oop java_class, oop protection_domain); + static oop init_lock(oop java_class); + static objArrayOop signers(oop java_class); + static void set_signers(oop java_class, objArrayOop signers); + static int oop_size(oop java_class); static void set_oop_size(oop java_class, int size); static int static_oop_field_count(oop java_class); diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 9fd9aff5e22..e0bff971d0c 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -392,6 +392,9 @@ template(array_klass_name, "array_klass") \ template(oop_size_name, "oop_size") \ template(static_oop_field_count_name, "static_oop_field_count") \ + template(protection_domain_name, "protection_domain") \ + template(init_lock_name, "init_lock") \ + template(signers_name, "signers_name") \ template(loader_data_name, "loader_data") \ template(dependencies_name, "dependencies") \ \ diff --git a/hotspot/src/share/vm/oops/arrayKlass.cpp b/hotspot/src/share/vm/oops/arrayKlass.cpp index 9b5ec951bbb..dc2fbe92e2a 100644 --- a/hotspot/src/share/vm/oops/arrayKlass.cpp +++ b/hotspot/src/share/vm/oops/arrayKlass.cpp @@ -94,7 +94,7 @@ void ArrayKlass::complete_create_array_klass(ArrayKlass* k, KlassHandle super_kl ResourceMark rm(THREAD); k->initialize_supers(super_klass(), CHECK); k->vtable()->initialize_vtable(false, CHECK); - java_lang_Class::create_mirror(k, CHECK); + java_lang_Class::create_mirror(k, Handle(NULL), CHECK); } GrowableArray* ArrayKlass::compute_secondary_supers(int num_extra_slots) { diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index 06827e68148..b61f595424e 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -268,8 +268,6 @@ InstanceKlass::InstanceKlass(int vtable_len, set_fields(NULL, 0); set_constants(NULL); set_class_loader_data(NULL); - set_protection_domain(NULL); - set_signers(NULL); set_source_file_name(NULL); set_source_debug_extension(NULL, 0); set_array_name(NULL); @@ -279,7 +277,6 @@ InstanceKlass::InstanceKlass(int vtable_len, set_is_marked_dependent(false); set_init_state(InstanceKlass::allocated); set_init_thread(NULL); - set_init_lock(NULL); set_reference_type(rt); set_oop_map_cache(NULL); set_jni_ids(NULL); @@ -408,12 +405,6 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) { } set_inner_classes(NULL); - // Null out Java heap objects, although these won't be walked to keep - // alive once this InstanceKlass is deallocated. - set_protection_domain(NULL); - set_signers(NULL); - set_init_lock(NULL); - // We should deallocate the Annotations instance MetadataFactory::free_metadata(loader_data, annotations()); set_annotations(NULL); @@ -451,6 +442,24 @@ void InstanceKlass::eager_initialize(Thread *thread) { } } +// JVMTI spec thinks there are signers and protection domain in the +// instanceKlass. These accessors pretend these fields are there. +// The hprof specification also thinks these fields are in InstanceKlass. +oop InstanceKlass::protection_domain() const { + // return the protection_domain from the mirror + return java_lang_Class::protection_domain(java_mirror()); +} + +// To remove these from requires an incompatible change and CCC request. +objArrayOop InstanceKlass::signers() const { + // return the signers from the mirror + return java_lang_Class::signers(java_mirror()); +} + +volatile oop InstanceKlass::init_lock() const { + // return the init lock from the mirror + return java_lang_Class::init_lock(java_mirror()); +} void InstanceKlass::eager_initialize_impl(instanceKlassHandle this_oop) { EXCEPTION_MARK; @@ -1883,16 +1892,6 @@ bool InstanceKlass::is_dependent_nmethod(nmethod* nm) { // Garbage collection -void InstanceKlass::oops_do(OopClosure* cl) { - Klass::oops_do(cl); - - cl->do_oop(adr_protection_domain()); - cl->do_oop(adr_signers()); - cl->do_oop(adr_init_lock()); - - // Don't walk the arrays since they are walked from the ClassLoaderData objects. -} - #ifdef ASSERT template void assert_is_in(T *p) { T heap_oop = oopDesc::load_heap_oop(p); @@ -2241,9 +2240,6 @@ void InstanceKlass::remove_unshareable_info() { m->remove_unshareable_info(); } - // Need to reinstate when reading back the class. - set_init_lock(NULL); - // do array classes also. array_klasses_do(remove_unshareable_in_class); } @@ -2275,13 +2271,6 @@ void InstanceKlass::restore_unshareable_info(TRAPS) { ik->itable()->initialize_itable(false, CHECK); } - // Allocate a simple java object for a lock. - // This needs to be a java object because during class initialization - // it can be held across a java call. - typeArrayOop r = oopFactory::new_typeArray(T_INT, 0, CHECK); - Handle h(THREAD, (oop)r); - ik->set_init_lock(h()); - // restore constant pool resolved references ik->constants()->restore_unshareable_info(CHECK); @@ -2836,10 +2825,7 @@ void InstanceKlass::print_on(outputStream* st) const { class_loader_data()->print_value_on(st); st->cr(); } - st->print(BULLET"protection domain: "); ((InstanceKlass*)this)->protection_domain()->print_value_on(st); st->cr(); st->print(BULLET"host class: "); host_klass()->print_value_on_maybe_null(st); st->cr(); - st->print(BULLET"signers: "); signers()->print_value_on(st); st->cr(); - st->print(BULLET"init_lock: "); ((oop)_init_lock)->print_value_on(st); st->cr(); if (source_file_name() != NULL) { st->print(BULLET"source file: "); source_file_name()->print_value_on(st); @@ -3040,7 +3026,6 @@ void InstanceKlass::collect_statistics(KlassSizeStats *sz) const { n += (sz->_method_ordering_bytes = sz->count_array(method_ordering())); n += (sz->_local_interfaces_bytes = sz->count_array(local_interfaces())); n += (sz->_transitive_interfaces_bytes = sz->count_array(transitive_interfaces())); - n += (sz->_signers_bytes = sz->count_array(signers())); n += (sz->_fields_bytes = sz->count_array(fields())); n += (sz->_inner_classes_bytes = sz->count_array(inner_classes())); sz->_ro_bytes += n; @@ -3206,17 +3191,11 @@ void InstanceKlass::verify_on(outputStream* st) { guarantee(constants()->is_metadata(), "should be in metaspace"); guarantee(constants()->is_constantPool(), "should be constant pool"); } - if (protection_domain() != NULL) { - guarantee(protection_domain()->is_oop(), "should be oop"); - } const Klass* host = host_klass(); if (host != NULL) { guarantee(host->is_metadata(), "should be in metaspace"); guarantee(host->is_klass(), "should be klass"); } - if (signers() != NULL) { - guarantee(signers()->is_objArray(), "should be obj array"); - } } void InstanceKlass::oop_verify_on(oop obj, outputStream* st) { diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index 8ee9adc01f1..1a370711fd7 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -58,8 +58,6 @@ // [fields ] // [constants ] // [class loader ] -// [protection domain ] -// [signers ] // [source file name ] // [inner classes ] // [static field size ] @@ -180,16 +178,6 @@ class InstanceKlass: public Klass { static volatile int _total_instanceKlass_count; protected: - // Protection domain. - oop _protection_domain; - // Class signers. - objArrayOop _signers; - // Lock for (1) initialization; (2) access to the ConstantPool of this class. - // Must be one per class and it has to be a VM internal object so java code - // cannot lock it (like the mirror). - // It has to be an object not a Mutex because it's held through java calls. - volatile oop _init_lock; - // Annotations for this class Annotations* _annotations; // Array classes holding elements of this class. @@ -527,8 +515,10 @@ class InstanceKlass: public Klass { void set_constants(ConstantPool* c) { _constants = c; } // protection domain - oop protection_domain() { return _protection_domain; } - void set_protection_domain(oop pd) { klass_oop_store(&_protection_domain, pd); } + oop protection_domain() const; + + // signers + objArrayOop signers() const; // host class Klass* host_klass() const { @@ -575,10 +565,6 @@ class InstanceKlass: public Klass { } } - // signers - objArrayOop signers() const { return _signers; } - void set_signers(objArrayOop s) { klass_oop_store((oop*)&_signers, s); } - // source file name Symbol* source_file_name() const { return _source_file_name; } void set_source_file_name(Symbol* n); @@ -912,8 +898,6 @@ class InstanceKlass: public Klass { Method* method_at_itable(Klass* holder, int index, TRAPS); // Garbage collection - virtual void oops_do(OopClosure* cl); - void oop_follow_contents(oop obj); int oop_adjust_pointers(oop obj); @@ -999,14 +983,12 @@ private: // Lock during initialization public: - volatile oop init_lock() const {return _init_lock; } + // Lock for (1) initialization; (2) access to the ConstantPool of this class. + // Must be one per class and it has to be a VM internal object so java code + // cannot lock it (like the mirror). + // It has to be an object not a Mutex because it's held through java calls. + volatile oop init_lock() const; private: - void set_init_lock(oop value) { klass_oop_store(&_init_lock, value); } - - // Offsets for memory management - oop* adr_protection_domain() const { return (oop*)&this->_protection_domain;} - oop* adr_signers() const { return (oop*)&this->_signers;} - oop* adr_init_lock() const { return (oop*)&this->_init_lock;} // Static methods that are used to implement member methods where an exposed this pointer // is needed due to possible GCs diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp index 52dd2645979..5c334206b97 100644 --- a/hotspot/src/share/vm/oops/klass.cpp +++ b/hotspot/src/share/vm/oops/klass.cpp @@ -511,8 +511,9 @@ void Klass::restore_unshareable_info(TRAPS) { // (same order as class file parsing) loader_data->add_class(this); - // Recreate the class mirror - java_lang_Class::create_mirror(this, CHECK); + // Recreate the class mirror. The protection_domain is always null for + // boot loader, for now. + java_lang_Class::create_mirror(this, Handle(NULL), CHECK); } Klass* Klass::array_klass_or_null(int rank) { diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp index acd402c79ad..6b0103abb5e 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -445,7 +445,7 @@ class Klass : public Metadata { Klass* array_klass_or_null(int rank); Klass* array_klass_or_null(); - virtual oop protection_domain() { return NULL; } + virtual oop protection_domain() const = 0; oop class_loader() const; diff --git a/hotspot/src/share/vm/oops/objArrayKlass.hpp b/hotspot/src/share/vm/oops/objArrayKlass.hpp index 74aa4f8d76d..9905704ccab 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp @@ -75,7 +75,7 @@ class ObjArrayKlass : public ArrayKlass { void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS); // Compute protection domain - oop protection_domain() { return bottom_klass()->protection_domain(); } + oop protection_domain() const { return bottom_klass()->protection_domain(); } private: // Either oop or narrowOop depending on UseCompressedOops. diff --git a/hotspot/src/share/vm/oops/typeArrayKlass.hpp b/hotspot/src/share/vm/oops/typeArrayKlass.hpp index 3fe8312a0ba..f8bf2ac74c0 100644 --- a/hotspot/src/share/vm/oops/typeArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/typeArrayKlass.hpp @@ -67,6 +67,8 @@ class TypeArrayKlass : public ArrayKlass { typeArrayOop allocate(int length, TRAPS) { return allocate_common(length, true, THREAD); } oop multi_allocate(int rank, jint* sizes, TRAPS); + oop protection_domain() const { return NULL; } + // Copying void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS); diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index bedfc619035..733d04a1b69 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -1072,11 +1072,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassSigners(JNIEnv *env, jclass cls)) return NULL; } - Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls)); - objArrayOop signers = NULL; - if (k->oop_is_instance()) { - signers = InstanceKlass::cast(k)->signers(); - } + objArrayOop signers = java_lang_Class::signers(JNIHandles::resolve_non_null(cls)); // If there are no signers set in the class, or if the class // is an array, return NULL. @@ -1102,7 +1098,7 @@ JVM_ENTRY(void, JVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signer // be called with an array. Only the bootstrap loader creates arrays. Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls)); if (k->oop_is_instance()) { - InstanceKlass::cast(k)->set_signers(objArrayOop(JNIHandles::resolve(signers))); + java_lang_Class::set_signers(k->java_mirror(), objArrayOop(JNIHandles::resolve(signers))); } } JVM_END @@ -1119,8 +1115,8 @@ JVM_ENTRY(jobject, JVM_GetProtectionDomain(JNIEnv *env, jclass cls)) return NULL; } - Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve(cls)); - return (jobject) JNIHandles::make_local(env, k->protection_domain()); + oop pd = java_lang_Class::protection_domain(JNIHandles::resolve(cls)); + return (jobject) JNIHandles::make_local(env, pd); JVM_END @@ -1139,7 +1135,7 @@ JVM_ENTRY(void, JVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protect if (k->oop_is_instance()) { oop pd = JNIHandles::resolve(protection_domain); assert(pd == NULL || pd->is_oop(), "just checking"); - InstanceKlass::cast(k)->set_protection_domain(pd); + java_lang_Class::set_protection_domain(k->java_mirror(), pd); } } JVM_END diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index b3fdd1e7097..6e12cd447fc 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -292,10 +292,8 @@ typedef BinaryTreeDictionary MetablockTreeDictionary; nonstatic_field(InstanceKlass, _transitive_interfaces, Array*) \ nonstatic_field(InstanceKlass, _fields, Array*) \ nonstatic_field(InstanceKlass, _java_fields_count, u2) \ - nonstatic_field(InstanceKlass, _constants, ConstantPool*) \ + nonstatic_field(InstanceKlass, _constants, ConstantPool*) \ nonstatic_field(InstanceKlass, _class_loader_data, ClassLoaderData*) \ - nonstatic_field(InstanceKlass, _protection_domain, oop) \ - nonstatic_field(InstanceKlass, _signers, objArrayOop) \ nonstatic_field(InstanceKlass, _source_file_name, Symbol*) \ nonstatic_field(InstanceKlass, _source_debug_extension, char*) \ nonstatic_field(InstanceKlass, _inner_classes, Array*) \ From bd53fa8370d6e4f318c939e6a51c6a9942a39b13 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Thu, 23 May 2013 17:39:32 +0200 Subject: [PATCH 05/29] 8009576: Test returns ClassNotFoundException Small classpath fix and move tests into open Reviewed-by: mgerdin, zgu --- .../runtime/Metaspace/FragmentMetaspace.java | 64 ++++++ .../Metaspace/FragmentMetaspaceSimple.java | 69 ++++++ .../runtime/Metaspace/classes/test/Empty.java | 28 +++ .../testlibrary/GeneratedClassLoader.java | 202 ++++++++++++++++++ 4 files changed, 363 insertions(+) create mode 100644 hotspot/test/runtime/Metaspace/FragmentMetaspace.java create mode 100644 hotspot/test/runtime/Metaspace/FragmentMetaspaceSimple.java create mode 100644 hotspot/test/runtime/Metaspace/classes/test/Empty.java create mode 100644 hotspot/test/runtime/testlibrary/GeneratedClassLoader.java diff --git a/hotspot/test/runtime/Metaspace/FragmentMetaspace.java b/hotspot/test/runtime/Metaspace/FragmentMetaspace.java new file mode 100644 index 00000000000..5e1a7200493 --- /dev/null +++ b/hotspot/test/runtime/Metaspace/FragmentMetaspace.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @library /runtime/testlibrary + * @build GeneratedClassLoader + * @run main/othervm/timeout=200 FragmentMetaspace + */ + +import java.io.IOException; + +/** + * Test that tries to fragment the native memory used by class loaders. + * This test creates class loaders that load classes of increasing size for every + * iteration. By increasing the size of the class meta data needed for every iteration + * we stress the subsystem for allocating native memory for meta data. + */ +public class FragmentMetaspace { + + public static void main(String... args) { + runGrowing(Long.valueOf(System.getProperty("time", "80000"))); + // try to clean up and unload classes to decrease + // class verification time in debug vm + System.gc(); + } + + private static void runGrowing(long time) { + long startTime = System.currentTimeMillis(); + for (int i = 0; System.currentTimeMillis() < startTime + time; ++i) { + try { + GeneratedClassLoader gcl = new GeneratedClassLoader(); + + Class c = gcl.getGeneratedClasses(i, 100)[0]; + c.newInstance(); + c = null; + + gcl = null; + } catch (IOException|InstantiationException|IllegalAccessException ex) { + throw new RuntimeException(ex); + } + } + } +} diff --git a/hotspot/test/runtime/Metaspace/FragmentMetaspaceSimple.java b/hotspot/test/runtime/Metaspace/FragmentMetaspaceSimple.java new file mode 100644 index 00000000000..2e6f7b52c0e --- /dev/null +++ b/hotspot/test/runtime/Metaspace/FragmentMetaspaceSimple.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @library /runtime/testlibrary + * @library classes + * @build test.Empty ClassUnloadCommon + * @run main/othervm/timeout=200 FragmentMetaspaceSimple + */ + +import java.util.ArrayList; + +/** + * Test that tries to fragment the native memory used by class loaders. + * Keeps every other class loader alive in order to fragment the memory space + * used to store classes and meta data. Since the memory is probably allocated in + * chunks per class loader this will cause a lot of fragmentation if not handled + * properly since every other chunk will be unused. + */ +public class FragmentMetaspaceSimple { + public static void main(String... args) { + runSimple(Long.valueOf(System.getProperty("time", "80000"))); + System.gc(); + } + + private static void runSimple(long time) { + long startTime = System.currentTimeMillis(); + ArrayList cls = new ArrayList<>(); + for (int i = 0; System.currentTimeMillis() < startTime + time; ++i) { + ClassLoader ldr = ClassUnloadCommon.newClassLoader(); + if (i % 1000 == 0) { + cls.clear(); + } + // only keep every other class loader alive + if (i % 2 == 1) { + cls.add(ldr); + } + Class c = null; + try { + c = ldr.loadClass("test.Empty"); + } catch (ClassNotFoundException ex) { + throw new RuntimeException(ex); + } + c = null; + } + cls = null; + } +} diff --git a/hotspot/test/runtime/Metaspace/classes/test/Empty.java b/hotspot/test/runtime/Metaspace/classes/test/Empty.java new file mode 100644 index 00000000000..dc02e299af5 --- /dev/null +++ b/hotspot/test/runtime/Metaspace/classes/test/Empty.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package test; + +public class Empty { +public String toString() { return "nothing"; } +} diff --git a/hotspot/test/runtime/testlibrary/GeneratedClassLoader.java b/hotspot/test/runtime/testlibrary/GeneratedClassLoader.java new file mode 100644 index 00000000000..84a1b7e157d --- /dev/null +++ b/hotspot/test/runtime/testlibrary/GeneratedClassLoader.java @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.DataInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import javax.tools.JavaCompiler; +import javax.tools.ToolProvider; + +/** + * A class loader that generates new classes. + * The generated classes are made by first emitting java sources with nested + * static classes, these are then compiled and the class files are read back. + * Some efforts are made to make the class instances unique and of not insignificant + * size. + */ +public class GeneratedClassLoader extends ClassLoader { + /** + * Holds a pair of class bytecodes and class name (for use with defineClass). + */ + private static class GeneratedClass { + public byte[] bytes; + public String name; + public GeneratedClass(byte[] bytes, String name) { + this.bytes = bytes; this.name = name; + } + } + + /** + * Used to uniquely name every class generated. + */ + private static int count = 0; + /** + * Used to enable/disable keeping the class files and java sources for + * the generated classes. + */ + private static boolean deleteFiles = Boolean.parseBoolean( + System.getProperty("GeneratedClassLoader.deleteFiles", "true")); + + private static String bigstr = + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + + "In facilisis scelerisque vehicula. Donec congue nisi a " + + "leo posuere placerat lobortis felis ultrices. Pellentesque " + + "habitant morbi tristique senectus et netus et malesuada " + + "fames ac turpis egestas. Nam tristique velit at felis " + + "iaculis at tempor sem vestibulum. Sed adipiscing lectus " + + "non mi molestie sagittis. Morbi eu purus urna. Nam tempor " + + "tristique massa eget semper. Mauris cursus, nulla et ornare " + + "vehicula, leo dolor scelerisque metus, sit amet rutrum erat " + + "sapien quis dui. Nullam eleifend risus et velit accumsan sed " + + "suscipit felis pulvinar. Nullam faucibus suscipit gravida. " + + "Pellentesque habitant morbi tristique senectus et netus et " + + "malesuada fames ac turpis egestas. Nullam ut massa augue, " + + "nec viverra mauris."; + + private static int getNextCount() { + return count++; + } + + ////// end statics + + private JavaCompiler javac; + private String nameBase; + + public GeneratedClassLoader() { + javac = ToolProvider.getSystemJavaCompiler(); + nameBase = "TestSimpleClass"; + } + + private long getBigValue(int which) { + // > 65536 is too large to encode in the bytecode + // so this will force us to emit a constant pool entry for this int + return (long)which + 65537; + } + + private String getBigString(int which) { + return bigstr + which; + } + + private String getClassName(int count) { + return nameBase + count; + } + + private String generateSource(int count, int sizeFactor, int numClasses) { + StringBuilder sb = new StringBuilder(); + sb.append("public class ").append(getClassName(count)).append("{\n"); + for (int j = 0; j < numClasses; ++j) { + sb.append("public static class ") + .append("Class") + .append(j) + .append("{\n"); + for (int i = 0; i < sizeFactor; ++i) { + int value = i; + sb.append("private long field") + .append(i).append(" = ") + .append(getBigValue(value++)) + .append(";\n"); + sb.append("public long method") + .append(i) + .append("() {\n"); + sb.append("return ") + .append(getBigValue(value++)) + .append(";"); + sb.append("}\n"); + sb.append("private String str").append(i) + .append(" = \"") + .append(getBigString(i)) + .append("\";"); + } + sb.append("\n}"); + } + sb.append("\n}"); + return sb.toString(); + } + + private GeneratedClass[] getGeneratedClass(int sizeFactor, int numClasses) throws IOException { + int uniqueCount = getNextCount(); + String src = generateSource(uniqueCount, sizeFactor, numClasses); + String className = getClassName(uniqueCount); + File file = new File(className + ".java"); + try (PrintWriter pw = new PrintWriter(new FileWriter(file))) { + pw.append(src); + pw.flush(); + } + int exitcode = javac.run(null, null, null, file.getCanonicalPath()); + if (exitcode != 0) { + throw new RuntimeException("javac failure when compiling: " + + file.getCanonicalPath()); + } else { + if (deleteFiles) { + file.delete(); + } + } + GeneratedClass[] gc = new GeneratedClass[numClasses]; + for (int i = 0; i < numClasses; ++i) { + String name = className + "$" + "Class" + i; + File classFile = new File(name + ".class"); + byte[] bytes; + try (DataInputStream dis = new DataInputStream(new FileInputStream(classFile))) { + bytes = new byte[dis.available()]; + dis.readFully(bytes); + } + if (deleteFiles) { + classFile.delete(); + } + gc[i] = new GeneratedClass(bytes, name); + } + if (deleteFiles) { + new File(className + ".class").delete(); + } + return gc; + } + + /** + * Generate a single class, compile it and load it. + * @param sizeFactor Fuzzy measure of how large the class should be. + * @return the Class instance. + * @throws IOException + */ + public Class generateClass(int sizeFactor) throws IOException { + return getGeneratedClasses(sizeFactor, 1)[0]; + } + + /** + * Generate several classes, compile and load them. + * @param sizeFactor Fuzzy measure of how large each class should be. + * @param numClasses The number of classes to create + * @return an array of the Class instances. + * @throws IOException + */ + public Class[] getGeneratedClasses(int sizeFactor, int numClasses) throws IOException { + GeneratedClass[] gc = getGeneratedClass(sizeFactor, numClasses); + Class[] classes = new Class[numClasses]; + for (int i = 0; i < numClasses; ++i) { + classes[i] = defineClass(gc[i].name, gc[i].bytes, 0 , gc[i].bytes.length); + } + return classes; + } +} From d8f8fedca74d02ded8bb8181622c2f0a99406b99 Mon Sep 17 00:00:00 2001 From: David Katleman Date: Thu, 23 May 2013 10:47:32 -0700 Subject: [PATCH 06/29] Added tag jdk8-b91 for changeset 46c3a4b9ef6d --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index f74c0bcfaa6..dc47bb707b1 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -212,3 +212,4 @@ b9415faa7066a4d3b16d466556d5428446918d95 jdk8-b87 e1a929afcfc492470d50be0b6b0e8dc77d3760b9 jdk8-b88 892a0196d10c67f3a12f0eefb0bb536e423d8868 jdk8-b89 69b773a221b956a3386933ecdbfeccee0edeac47 jdk8-b90 +cb51fb4789ac0b8be4056482077ddfb8f3bd3805 jdk8-b91 From 6430d3536c086e37716bb22667c78043345d4224 Mon Sep 17 00:00:00 2001 From: David Katleman Date: Thu, 23 May 2013 10:47:37 -0700 Subject: [PATCH 07/29] Added tag jdk8-b91 for changeset 63e3e07dfc0d --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index 20b78fa3d32..af3629045ae 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -212,3 +212,4 @@ f1709874d55a06bc3d5dfa02dbcdfbc59f4cba34 jdk8-b87 4e3a881ebb1ee96ce0872508b0066d74f310dbfa jdk8-b88 fe4150590ee597f4e125fea950aa3b352622cc2d jdk8-b89 c8286839d0df04aba819ec4bef12b86babccf30e jdk8-b90 +8f7ffb296385f85a4a6d53f9f2d4a7b13a8fa1ff jdk8-b91 From 09facbd2efe125c9fc49dff367ae97200f52de4e Mon Sep 17 00:00:00 2001 From: David Katleman Date: Thu, 23 May 2013 10:47:40 -0700 Subject: [PATCH 08/29] Added tag jdk8-b91 for changeset 7083a5fec809 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index f202d86f926..55b79b802b7 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -343,3 +343,4 @@ c4af77d2045476c56fbf3f914b336bb1b7cd18af hs25-b30 69494caf57908ba2c8efa9eaaa472b4d1875588a hs25-b32 1ae0472ff3a0117b5b019d380ad59fface2fde14 jdk8-b90 b19517cecc2e91636d7c16ba2f35e3d3dc628099 hs25-b33 +7cbdf0e3725c0c56a2ff7540fc70b6d4b5890d04 jdk8-b91 From 5ae68c32a286bfff994d9e384627ae49f9ed64a4 Mon Sep 17 00:00:00 2001 From: David Katleman Date: Thu, 23 May 2013 10:47:45 -0700 Subject: [PATCH 09/29] Added tag jdk8-b91 for changeset e4e0796ef6c5 --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 7ba815339e0..e23e9fa8292 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -212,3 +212,4 @@ eddbc8ad2435a89f64729512337c9f2669e4dd85 jdk8-b87 7122f7bb0fcc8a39e5254402119b2ee3fa0ad313 jdk8-b88 893d2ba8bbea3a8d090e51d8eaea285b390789ea jdk8-b89 668acc0e1034bc1bec6d02be92e0dd4a63d0667e jdk8-b90 +e3065fb07877c7e96e8b93416fe2ab9a4c9eb2a5 jdk8-b91 From a66fd7b0668021b1151168b73333f11e7994e49d Mon Sep 17 00:00:00 2001 From: David Katleman Date: Thu, 23 May 2013 10:47:47 -0700 Subject: [PATCH 10/29] Added tag jdk8-b91 for changeset 1b09fbc97609 --- jaxws/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxws/.hgtags b/jaxws/.hgtags index b60c92ca352..088ec3da462 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -212,3 +212,4 @@ a5e7c2f093c9996ab3419db1565094a07b059e9c jdk8-b86 24fa5452e5d4e9df8b85196283275a6ca4b4adb4 jdk8-b88 88838e08e4ef6a254867c8126070a1975683108d jdk8-b89 3e5b9ea5ac35ea7096da484e24a863cf4552179f jdk8-b90 +0bb1a9fa56b037d072efdaae5f5b73a0f23c966c jdk8-b91 From 061596e851cfb9dabf7b88d20f4a6c5a376a0f03 Mon Sep 17 00:00:00 2001 From: David Katleman Date: Thu, 23 May 2013 10:47:50 -0700 Subject: [PATCH 11/29] Added tag jdk8-b91 for changeset 053ed974a2ae --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 7be0eb3751c..e16f4d2cc30 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -212,3 +212,4 @@ d5228e624826a10ccc5b05f30ad8d839b58fe48d jdk8-b87 8dbb4b159e04de3c447c9242c70505e71f8624c7 jdk8-b88 845025546e35519fbb8970e79fc2a834063a5e19 jdk8-b89 c63eda8f63008a4398d2c22ac8d72f7fef6f9238 jdk8-b90 +169451cf0cc53bde5af24f9820ea3f35ec4b4df4 jdk8-b91 From 7fb6c93ec00ce067d7fe7099e51e5e3400d63e98 Mon Sep 17 00:00:00 2001 From: David Katleman Date: Thu, 23 May 2013 10:47:57 -0700 Subject: [PATCH 12/29] Added tag jdk8-b91 for changeset a5e4cac27b50 --- langtools/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/langtools/.hgtags b/langtools/.hgtags index 04454fd7776..1c4ad707352 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -212,3 +212,4 @@ cfb65ca92082b2412aed66c8422c2466bde544ef jdk8-b84 a1e10f3adc47c8602a72e43a41403a642e73e0b1 jdk8-b88 ec434cfd2752a7742c875c2fe7d556d8b81c0f3a jdk8-b89 e19283cd30a43fca94d8f7639c73ef66db493b1e jdk8-b90 +997c0fae2b12108959387862be54b78ca0ae3fca jdk8-b91 From 97932395dc0434b19ff41b162d510508756ffaaf Mon Sep 17 00:00:00 2001 From: David Katleman Date: Thu, 23 May 2013 10:47:58 -0700 Subject: [PATCH 13/29] Added tag jdk8-b91 for changeset 7d6fffdd46a9 --- nashorn/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/nashorn/.hgtags b/nashorn/.hgtags index 5cfb5342b40..0c80753de1e 100644 --- a/nashorn/.hgtags +++ b/nashorn/.hgtags @@ -200,3 +200,4 @@ e0378f0a50dafdcfb7b04f6401d320f89884baa1 jdk8-b85 40c107d1ae6f81a62e35dfe618b827897405e9b2 jdk8-b88 45ce27fbe2720d80070095c0db7344ec41e2833d jdk8-b89 67ca019e3713dd71c884d753de02fd0021981969 jdk8-b90 +6b9f4120380091b8b1751a825b9f84bf1be224fe jdk8-b91 From b2e43ed612c42a451c28028f9be07bcf65fa1249 Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Thu, 23 May 2013 23:04:33 -0700 Subject: [PATCH 14/29] 8014288: perf regression in nashorn JDK-8008448.js test after 8008511 changes The fix of perf regression is to use method_idnum() for direct indexing into NMT Reviewed-by: twisti, kvn, coleenp, dholmes --- hotspot/src/share/vm/oops/instanceKlass.cpp | 19 +++++++++-- hotspot/src/share/vm/oops/instanceKlass.hpp | 3 +- hotspot/src/share/vm/prims/methodHandles.cpp | 34 +++++++------------- hotspot/src/share/vm/prims/methodHandles.hpp | 11 +++---- 4 files changed, 35 insertions(+), 32 deletions(-) diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index b61f595424e..562adaae04a 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -2754,15 +2754,28 @@ nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_le return NULL; } -void InstanceKlass::add_member_name(Handle mem_name) { +void InstanceKlass::add_member_name(int index, Handle mem_name) { jweak mem_name_wref = JNIHandles::make_weak_global(mem_name); MutexLocker ml(MemberNameTable_lock); + assert(0 <= index && index < idnum_allocated_count(), "index is out of bounds"); DEBUG_ONLY(No_Safepoint_Verifier nsv); if (_member_names == NULL) { - _member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable(); + _member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable(idnum_allocated_count()); } - _member_names->add_member_name(mem_name_wref); + _member_names->add_member_name(index, mem_name_wref); +} + +oop InstanceKlass::get_member_name(int index) { + MutexLocker ml(MemberNameTable_lock); + assert(0 <= index && index < idnum_allocated_count(), "index is out of bounds"); + DEBUG_ONLY(No_Safepoint_Verifier nsv); + + if (_member_names == NULL) { + return NULL; + } + oop mem_name =_member_names->get_member_name(index); + return mem_name; } // ----------------------------------------------------------------------------------------------------- diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index 1a370711fd7..e158cdf3cf4 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -1022,7 +1022,8 @@ public: // JSR-292 support MemberNameTable* member_names() { return _member_names; } void set_member_names(MemberNameTable* member_names) { _member_names = member_names; } - void add_member_name(Handle member_name); + void add_member_name(int index, Handle member_name); + oop get_member_name(int index); public: // JVMTI support diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp index 58957eed067..bb9da0034e4 100644 --- a/hotspot/src/share/vm/prims/methodHandles.cpp +++ b/hotspot/src/share/vm/prims/methodHandles.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -232,7 +232,8 @@ oop MethodHandles::init_method_MemberName(Handle mname, Method* m, bool do_dispa // This is done eagerly, since it is readily available without // constructing any new objects. // TO DO: maybe intern mname_oop - m->method_holder()->add_member_name(mname); + m->method_holder()->add_member_name(m->method_idnum(), mname); + return mname(); } @@ -301,7 +302,6 @@ oop MethodHandles::init_field_MemberName(Handle mname, KlassHandle field_holder, // Although the fieldDescriptor::_index would also identify the field, // we do not use it, because it is harder to decode. // TO DO: maybe intern mname_oop - InstanceKlass::cast(field_holder())->add_member_name(mname); return mname(); } @@ -943,7 +943,8 @@ int MethodHandles::find_MemberNames(KlassHandle k, // MemberNameTable // -MemberNameTable::MemberNameTable() : GrowableArray(10, true) { +MemberNameTable::MemberNameTable(int methods_cnt) + : GrowableArray(methods_cnt, true) { assert_locked_or_safepoint(MemberNameTable_lock); } @@ -957,29 +958,18 @@ MemberNameTable::~MemberNameTable() { } } -// Return entry index if found, return -1 otherwise. -int MemberNameTable::find_member_name(oop mem_name) { +void MemberNameTable::add_member_name(int index, jweak mem_name_wref) { assert_locked_or_safepoint(MemberNameTable_lock); - int len = this->length(); - - for (int idx = 0; idx < len; idx++) { - jweak ref = this->at(idx); - oop entry = JNIHandles::resolve(ref); - if (entry == mem_name) { - return idx; - } - } - return -1; + this->at_put_grow(index, mem_name_wref); } -void MemberNameTable::add_member_name(jweak mem_name_wref) { +// Return a member name oop or NULL. +oop MemberNameTable::get_member_name(int index) { assert_locked_or_safepoint(MemberNameTable_lock); - oop mem_name = JNIHandles::resolve(mem_name_wref); - // Each member name may appear just once: add only if not found - if (find_member_name(mem_name) == -1) { - this->append(mem_name_wref); - } + jweak ref = this->at(index); + oop mem_name = JNIHandles::resolve(ref); + return mem_name; } #if INCLUDE_JVMTI diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp index f01a3c9fc1b..50ce7af86ea 100644 --- a/hotspot/src/share/vm/prims/methodHandles.hpp +++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -219,7 +219,6 @@ public: } }; - //------------------------------------------------------------------------------ // MethodHandlesAdapterGenerator // @@ -233,13 +232,13 @@ public: //------------------------------------------------------------------------------ // MemberNameTable // + class MemberNameTable : public GrowableArray { public: - MemberNameTable(); + MemberNameTable(int methods_cnt); ~MemberNameTable(); - void add_member_name(jweak mem_name_ref); - private: - int find_member_name(oop mem_name); + void add_member_name(int index, jweak mem_name_ref); + oop get_member_name(int index); #if INCLUDE_JVMTI public: From e6a52ec48e6b236793f1a424ba2c55b66c2606f8 Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Fri, 24 May 2013 09:25:43 -0700 Subject: [PATCH 15/29] Added tag hs25-b34 for changeset e12c800cd4a8 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 55b79b802b7..f2fb4715f13 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -344,3 +344,4 @@ c4af77d2045476c56fbf3f914b336bb1b7cd18af hs25-b30 1ae0472ff3a0117b5b019d380ad59fface2fde14 jdk8-b90 b19517cecc2e91636d7c16ba2f35e3d3dc628099 hs25-b33 7cbdf0e3725c0c56a2ff7540fc70b6d4b5890d04 jdk8-b91 +38da9f4f67096745f851318d792d6468aa1f6cf8 hs25-b34 From 23431500a04c75cede4145e843fcd1d669d49c47 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Tue, 28 May 2013 08:49:04 +0200 Subject: [PATCH 16/29] 8012566: Replace find, rm, printf and similar with their proper variables Reviewed-by: tbell --- langtools/makefiles/BuildLangtools.gmk | 38 +++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/langtools/makefiles/BuildLangtools.gmk b/langtools/makefiles/BuildLangtools.gmk index 2fab4b914b7..57d216b2bf9 100644 --- a/langtools/makefiles/BuildLangtools.gmk +++ b/langtools/makefiles/BuildLangtools.gmk @@ -56,7 +56,7 @@ $(eval $(call SetupJavaCompilation,BUILD_TOOLS,\ # The compileprops tools compiles a properties file into a resource bundle. TOOL_COMPILEPROPS_CMD:=$(JAVA) -cp $(LANGTOOLS_OUTPUTDIR)/btclasses compileproperties.CompileProperties -quiet # Lookup the properties that need to be compiled into resource bundles. -PROPSOURCES:=$(shell find $(LANGTOOLS_TOPDIR)/src/share/classes -name "*.properties") +PROPSOURCES:=$(shell $(FIND) $(LANGTOOLS_TOPDIR)/src/share/classes -name "*.properties") # Strip away prefix and suffix, leaving for example only: "com/sun/tools/javac/resources/javac_zh_CN" PROPPATHS:=$(patsubst $(LANGTOOLS_TOPDIR)/src/share/classes/%.properties,%,$(PROPSOURCES)) # Generate the list of java files to be created. @@ -70,13 +70,13 @@ PROPCMDLINE:=$(subst _SPACE_,$(SPACE),$(join $(addprefix -compile_SPACE_,$(PROPS # Now setup the rule for the generation of the resource bundles. $(LANGTOOLS_OUTPUTDIR)/gensrc/_the_props.d : $(PROPSOURCES) $(BUILD_TOOLS) - rm -rf $(@D)/* - mkdir -p $(@D) $(PROPDIRS) - printf "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javah/resources/version.properties - printf "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javap/resources/version.properties - printf "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javac/resources/version.properties - printf "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.properties - echo Compiling $(words $(PROPSOURCES) v1 v2 v3) properties into resource bundles + $(RM) -r $(@D)/* + $(MKDIR) -p $(@D) $(PROPDIRS) + $(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javah/resources/version.properties + $(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javap/resources/version.properties + $(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javac/resources/version.properties + $(PRINTF) "jdk=$(JDK_VERSION)\nfull=$(FULL_VERSION)\nrelease=$(RELEASE)\n" > $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.properties + $(ECHO) Compiling $(words $(PROPSOURCES) v1 v2 v3) properties into resource bundles $(TOOL_COMPILEPROPS_CMD) $(PROPCMDLINE) \ -compile $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javah/resources/version.properties \ $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/javah/resources/version.java \ @@ -90,7 +90,7 @@ $(LANGTOOLS_OUTPUTDIR)/gensrc/_the_props.d : $(PROPSOURCES) $(BUILD_TOOLS) -compile $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.properties \ $(LANGTOOLS_OUTPUTDIR)/gensrc/com/sun/tools/jdeps/resources/version.java \ java.util.ListResourceBundle - echo PROPS_ARE_CREATED=yes > $@ + $(ECHO) PROPS_ARE_CREATED=yes > $@ # Trigger the generation of the resource bundles. After the resource bundles have # been compiled, then the makefile will restart and the newly created java files @@ -134,19 +134,19 @@ ifeq ($(PROPS_ARE_CREATED),yes) $(LANGTOOLS_OUTPUTDIR)/genstubs/_the_stubs.d : $(STUBSOURCES) $(BUILD_TOOLS) \ $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \ $(LANGTOOLS_OUTPUTDIR)/gensrc/_the_props.d - mkdir -p $(@D) - mkdir -p $(LANGTOOLS_OUTPUTDIR)/tmpstubs - echo $(LOG_INFO) Generating stubs from JDK sources. - ($(TOOL_GENSTUBS_CMD) -s $(LANGTOOLS_OUTPUTDIR)/tmpstubs -sourcepath $(JDKS) $(STUBCLASSES) && echo STUBS_ARE_CREATED=yes > $@) + $(MKDIR) -p $(@D) + $(MKDIR) -p $(LANGTOOLS_OUTPUTDIR)/tmpstubs + $(ECHO) $(LOG_INFO) Generating stubs from JDK sources. + ($(TOOL_GENSTUBS_CMD) -s $(LANGTOOLS_OUTPUTDIR)/tmpstubs -sourcepath $(JDKS) $(STUBCLASSES) && $(ECHO) STUBS_ARE_CREATED=yes > $@) if $(DIFF) -x "_the*" -rq $(LANGTOOLS_OUTPUTDIR)/tmpstubs $(LANGTOOLS_OUTPUTDIR)/genstubs > /dev/null 2>&1; then \ - echo $(LOG_INFO) No changes in the stubs!; \ - rm -rf $(LANGTOOLS_OUTPUTDIR)/tmpstubs; \ + $(ECHO) $(LOG_INFO) No changes in the stubs!; \ + $(RM) -r $(LANGTOOLS_OUTPUTDIR)/tmpstubs; \ else \ - echo $(LOG_INFO) Changes in stubs detected!; \ - rm -rf $(@D); \ - mv $(LANGTOOLS_OUTPUTDIR)/tmpstubs $(@D); \ + $(ECHO) $(LOG_INFO) Changes in stubs detected!; \ + $(RM) -r $(@D); \ + $(MV) $(LANGTOOLS_OUTPUTDIR)/tmpstubs $(@D); \ fi - echo STUBS_ARE_CREATED=yes > $@ + $(ECHO) STUBS_ARE_CREATED=yes > $@ # Trigger a generation of the genstubs java source code and a restart # of the makefile to make sure that the following build setup use the From e02854128115d9eec21c5f7b44f3614c2ba9f4ea Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Tue, 28 May 2013 08:50:52 +0200 Subject: [PATCH 17/29] 8007129: build-infra Add configure --with-jtreg option for location of JTREG Reviewed-by: tbell --- common/autoconf/basics.m4 | 13 +- common/autoconf/generated-configure.sh | 578 ++++++++++++++++++------- common/autoconf/spec.gmk.in | 2 + common/autoconf/toolchain.m4 | 28 ++ 4 files changed, 455 insertions(+), 166 deletions(-) diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 550045b3cec..305424db718 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -60,16 +60,19 @@ AC_DEFUN([BASIC_FIXUP_PATH], else # We're on a posix platform. Hooray! :) path="[$]$1" - - if test ! -f "$path" && test ! -d "$path"; then - AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.]) - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.]) AC_MSG_ERROR([Spaces are not allowed in this path.]) fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.]) + fi + + $1="`cd "$path"; $THEPWDCMD`" fi ]) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 0aae6e6ca9f..87b75cb6cd7 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -681,6 +681,8 @@ STATIC_LIBRARY SHARED_LIBRARY OBJ_SUFFIX COMPILER_NAME +JTREGEXE +JT_HOME LIPO ac_ct_OBJDUMP OBJDUMP @@ -1004,6 +1006,7 @@ with_msvcr_dll with_dxsdk with_dxsdk_lib with_dxsdk_include +with_jtreg with_extra_cflags with_extra_cxxflags with_extra_ldflags @@ -1762,6 +1765,7 @@ Optional Packages: [probed] --with-dxsdk-include the DirectX SDK include directory (Windows only) [probed] + --with-jtreg Regression Test Harness [probed] --with-extra-cflags extra flags to be used when compiling jdk c-files --with-extra-cxxflags extra flags to be used when compiling jdk c++-files --with-extra-ldflags extra flags to be used when linking jdk @@ -3723,6 +3727,9 @@ fi +# Setup the JTREG paths + + # # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3773,7 +3780,7 @@ fi #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1369236348 +DATE_WHEN_GENERATED=1369723814 ############################################################################### # @@ -7387,17 +7394,20 @@ $as_echo "$as_me: Rewriting SRC_ROOT to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$SRC_ROOT" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of SRC_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of SRC_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + SRC_ROOT="`cd "$path"; $THEPWDCMD`" fi @@ -7506,17 +7516,20 @@ $as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$CURDIR" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + CURDIR="`cd "$path"; $THEPWDCMD`" fi @@ -8102,17 +8115,20 @@ $as_echo "$as_me: Rewriting OUTPUT_ROOT to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$OUTPUT_ROOT" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + OUTPUT_ROOT="`cd "$path"; $THEPWDCMD`" fi @@ -11159,17 +11175,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -11488,17 +11507,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -11631,17 +11653,20 @@ $as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$JAVA_HOME_PROCESSED" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + JAVA_HOME_PROCESSED="`cd "$path"; $THEPWDCMD`" fi if test ! -d "$JAVA_HOME_PROCESSED"; then @@ -11800,17 +11825,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -11985,17 +12013,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -12310,17 +12341,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -12522,17 +12556,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -12699,17 +12736,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -12904,17 +12944,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -13081,17 +13124,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -13286,17 +13332,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -13463,17 +13512,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -13668,17 +13720,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -13845,17 +13900,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14037,17 +14095,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14212,17 +14273,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14405,17 +14469,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14580,17 +14647,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14772,17 +14842,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -14947,17 +15020,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -15140,17 +15216,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -15315,17 +15394,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -15489,17 +15571,20 @@ $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$BOOT_JDK" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + BOOT_JDK="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 @@ -16172,6 +16257,157 @@ AR_OUT_OPTION='rcs$(SPACE)' # Locate the actual tools + +# Check whether --with-jtreg was given. +if test "${with_jtreg+set}" = set; then : + withval=$with_jtreg; +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JTReg Regression Test Harness" >&5 +$as_echo_n "checking for JTReg Regression Test Harness... " >&6; } + + if test "x$with_jtreg" != x; then + JT_HOME="$with_jtreg" + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$JT_HOME" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of JT_HOME" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + JT_HOME="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$JT_HOME" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + JT_HOME="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$JT_HOME" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + JT_HOME="`cd "$path"; $THEPWDCMD`" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JT_HOME" >&5 +$as_echo "$JT_HOME" >&6; } + + # jtreg win32 script works for everybody + JTREGEXE="$JT_HOME/win32/bin/jtreg" + if test ! -f "$JTREGEXE"; then + as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + + + + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then # Store path to cygwin link.exe to help excluding it when searching for @@ -17128,17 +17364,20 @@ $as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$MSVCR_DLL" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + MSVCR_DLL="`cd "$path"; $THEPWDCMD`" fi @@ -17282,17 +17521,20 @@ $as_echo "$as_me: Rewriting dxsdk_path to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$dxsdk_path" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of dxsdk_path, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of dxsdk_path, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of dxsdk_path, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of dxsdk_path, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + dxsdk_path="`cd "$path"; $THEPWDCMD`" fi @@ -17417,17 +17659,20 @@ $as_echo "$as_me: Rewriting DXSDK_LIB_PATH to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$DXSDK_LIB_PATH" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of DXSDK_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DXSDK_LIB_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of DXSDK_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of DXSDK_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + DXSDK_LIB_PATH="`cd "$path"; $THEPWDCMD`" fi @@ -17550,17 +17795,20 @@ $as_echo "$as_me: Rewriting DXSDK_INCLUDE_PATH to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$DXSDK_INCLUDE_PATH" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + DXSDK_INCLUDE_PATH="`cd "$path"; $THEPWDCMD`" fi @@ -28239,6 +28487,8 @@ $as_echo "$as_me: Rewriting LIPO to \"$new_complete\"" >&6;} fi + + # Restore old path without tools dir PATH="$OLD_PATH" @@ -30868,17 +31118,20 @@ $as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$with_freetype" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of with_freetype, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_freetype, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of with_freetype, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + with_freetype="`cd "$path"; $THEPWDCMD`" fi FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" @@ -31167,17 +31420,20 @@ $as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) path="$FREETYPELOCATION" - - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of FREETYPELOCATION, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5 $as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of FREETYPELOCATION, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + FREETYPELOCATION="`cd "$path"; $THEPWDCMD`" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard windows locations" >&5 diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index a7e66a31320..8705a2a0114 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -528,6 +528,8 @@ HG:=@HG@ OBJCOPY:=@OBJCOPY@ SETFILE:=@SETFILE@ XATTR:=@XATTR@ +JT_HOME:=@JT_HOME@ +JTREGEXE:=@JTREGEXE@ FIXPATH:=@FIXPATH@ diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 779f86117ab..723d96a22e1 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -479,6 +479,8 @@ if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then BASIC_FIXUP_EXECUTABLE(LIPO) fi +TOOLCHAIN_SETUP_JTREG + # Restore old path without tools dir PATH="$OLD_PATH" ]) @@ -1089,3 +1091,29 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_MISC], [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) ]) + +# Setup the JTREG paths +AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], +[ + AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], + [Regression Test Harness @<:@probed@:>@])]) + + AC_MSG_CHECKING([for JTReg Regression Test Harness]) + + if test "x$with_jtreg" != x; then + JT_HOME="$with_jtreg" + BASIC_FIXUP_PATH([JT_HOME]) + AC_MSG_RESULT($JT_HOME) + + # jtreg win32 script works for everybody + JTREGEXE="$JT_HOME/win32/bin/jtreg" + if test ! -f "$JTREGEXE"; then + AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE]) + fi + else + AC_MSG_RESULT(no) + fi + + AC_SUBST(JT_HOME) + AC_SUBST(JTREGEXE) +]) From d1eabf07b1b91f5a78f17ee16d223d4645966ca7 Mon Sep 17 00:00:00 2001 From: David Katleman Date: Wed, 29 May 2013 10:15:19 -0700 Subject: [PATCH 18/29] 8015525: JDK8 b91 source with GPL header errors Reviewed-by: dholmes, lancea --- .../sun/org/apache/xerces/internal/impl/XMLEntityManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java index 547a3a5bcd5..ee6ff0a6b2e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. */ /* From 320a9159a3e07d0085b32b9ba317a1a4fb954fe3 Mon Sep 17 00:00:00 2001 From: David Katleman Date: Wed, 29 May 2013 10:16:07 -0700 Subject: [PATCH 19/29] 8015525: JDK8 b91 source with GPL header errors Reviewed-by: dholmes, lancea --- .../test/org/openjdk/tests/java/util/FillableStringTest.java | 2 +- .../util/stream/test/org/openjdk/tests/java/util/MapTest.java | 2 +- jdk/test/jdk/lambda/MethodReferenceTestInstanceMethod.java | 2 +- jdk/test/jdk/lambda/MethodReferenceTestKinds.java | 2 +- jdk/test/jdk/lambda/MethodReferenceTestSueCase1.java | 2 +- jdk/test/jdk/lambda/MethodReferenceTestSueCase2.java | 2 +- jdk/test/jdk/lambda/MethodReferenceTestSueCase4.java | 2 +- jdk/test/jdk/lambda/separate/AttributeInjector.java | 2 +- jdk/test/jdk/lambda/separate/ClassFile.java | 2 +- jdk/test/jdk/lambda/separate/ClassFilePreprocessor.java | 2 +- jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java | 2 +- jdk/test/jdk/lambda/separate/Compiler.java | 2 +- jdk/test/jdk/lambda/separate/DirectedClassLoader.java | 2 +- jdk/test/jdk/lambda/separate/SourceModel.java | 2 +- jdk/test/jdk/lambda/separate/TestHarness.java | 2 +- jdk/test/jdk/lambda/vm/DefaultMethodRegressionTests.java | 2 +- jdk/test/jdk/lambda/vm/DefaultMethodsTest.java | 2 +- jdk/test/jdk/lambda/vm/InterfaceAccessFlagsTest.java | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/FillableStringTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/FillableStringTest.java index 5c8a65a50f3..565d668c79c 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/FillableStringTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/FillableStringTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/MapTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/MapTest.java index 53c7ab1c7dc..b0e33edd919 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/MapTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/MapTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/MethodReferenceTestInstanceMethod.java b/jdk/test/jdk/lambda/MethodReferenceTestInstanceMethod.java index b000d648fd1..40a64aaf38e 100644 --- a/jdk/test/jdk/lambda/MethodReferenceTestInstanceMethod.java +++ b/jdk/test/jdk/lambda/MethodReferenceTestInstanceMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/MethodReferenceTestKinds.java b/jdk/test/jdk/lambda/MethodReferenceTestKinds.java index 356b3d603d2..8f11bc28f58 100644 --- a/jdk/test/jdk/lambda/MethodReferenceTestKinds.java +++ b/jdk/test/jdk/lambda/MethodReferenceTestKinds.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/MethodReferenceTestSueCase1.java b/jdk/test/jdk/lambda/MethodReferenceTestSueCase1.java index 89bb988f7db..b6bbfa68d63 100644 --- a/jdk/test/jdk/lambda/MethodReferenceTestSueCase1.java +++ b/jdk/test/jdk/lambda/MethodReferenceTestSueCase1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/MethodReferenceTestSueCase2.java b/jdk/test/jdk/lambda/MethodReferenceTestSueCase2.java index f967f9d3eeb..dcb2a69e8ee 100644 --- a/jdk/test/jdk/lambda/MethodReferenceTestSueCase2.java +++ b/jdk/test/jdk/lambda/MethodReferenceTestSueCase2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/MethodReferenceTestSueCase4.java b/jdk/test/jdk/lambda/MethodReferenceTestSueCase4.java index c14b31f82c8..eb54df6a75d 100644 --- a/jdk/test/jdk/lambda/MethodReferenceTestSueCase4.java +++ b/jdk/test/jdk/lambda/MethodReferenceTestSueCase4.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/separate/AttributeInjector.java b/jdk/test/jdk/lambda/separate/AttributeInjector.java index 6ea11154c9f..52e3f76e31b 100644 --- a/jdk/test/jdk/lambda/separate/AttributeInjector.java +++ b/jdk/test/jdk/lambda/separate/AttributeInjector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/separate/ClassFile.java b/jdk/test/jdk/lambda/separate/ClassFile.java index 7da140b8177..919df1a1a9d 100644 --- a/jdk/test/jdk/lambda/separate/ClassFile.java +++ b/jdk/test/jdk/lambda/separate/ClassFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/separate/ClassFilePreprocessor.java b/jdk/test/jdk/lambda/separate/ClassFilePreprocessor.java index e40434cc3cb..bb91746d5f7 100644 --- a/jdk/test/jdk/lambda/separate/ClassFilePreprocessor.java +++ b/jdk/test/jdk/lambda/separate/ClassFilePreprocessor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java b/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java index 48c0e8dcbb3..8da05ac4e81 100644 --- a/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java +++ b/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/separate/Compiler.java b/jdk/test/jdk/lambda/separate/Compiler.java index 9ba81d65890..cbee5764b8b 100644 --- a/jdk/test/jdk/lambda/separate/Compiler.java +++ b/jdk/test/jdk/lambda/separate/Compiler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/separate/DirectedClassLoader.java b/jdk/test/jdk/lambda/separate/DirectedClassLoader.java index 6da38668378..726edabf38f 100644 --- a/jdk/test/jdk/lambda/separate/DirectedClassLoader.java +++ b/jdk/test/jdk/lambda/separate/DirectedClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/separate/SourceModel.java b/jdk/test/jdk/lambda/separate/SourceModel.java index 6cef02fb170..1fe3e9edb7e 100644 --- a/jdk/test/jdk/lambda/separate/SourceModel.java +++ b/jdk/test/jdk/lambda/separate/SourceModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/separate/TestHarness.java b/jdk/test/jdk/lambda/separate/TestHarness.java index d5ba449a3c9..801fa485b33 100644 --- a/jdk/test/jdk/lambda/separate/TestHarness.java +++ b/jdk/test/jdk/lambda/separate/TestHarness.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/vm/DefaultMethodRegressionTests.java b/jdk/test/jdk/lambda/vm/DefaultMethodRegressionTests.java index 538d26d9b5a..fc206d2614f 100644 --- a/jdk/test/jdk/lambda/vm/DefaultMethodRegressionTests.java +++ b/jdk/test/jdk/lambda/vm/DefaultMethodRegressionTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/vm/DefaultMethodsTest.java b/jdk/test/jdk/lambda/vm/DefaultMethodsTest.java index 76ae86cd6fc..a02ce752540 100644 --- a/jdk/test/jdk/lambda/vm/DefaultMethodsTest.java +++ b/jdk/test/jdk/lambda/vm/DefaultMethodsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/jdk/test/jdk/lambda/vm/InterfaceAccessFlagsTest.java b/jdk/test/jdk/lambda/vm/InterfaceAccessFlagsTest.java index b08e67c7a09..b33ea3e657c 100644 --- a/jdk/test/jdk/lambda/vm/InterfaceAccessFlagsTest.java +++ b/jdk/test/jdk/lambda/vm/InterfaceAccessFlagsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it From b08f6026b423e1e51149078dd8924c00079e38d0 Mon Sep 17 00:00:00 2001 From: David Katleman Date: Wed, 29 May 2013 10:16:32 -0700 Subject: [PATCH 20/29] 8015525: JDK8 b91 source with GPL header errors Reviewed-by: dholmes, lancea --- .../annotations/typeAnnotations/classfile/TestNewCastArray.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/classfile/TestNewCastArray.java b/langtools/test/tools/javac/annotations/typeAnnotations/classfile/TestNewCastArray.java index c91924d1e87..504aaf9109f 100644 --- a/langtools/test/tools/javac/annotations/typeAnnotations/classfile/TestNewCastArray.java +++ b/langtools/test/tools/javac/annotations/typeAnnotations/classfile/TestNewCastArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it From a4a4a20033e98cad46511a6111d803964c2fdd73 Mon Sep 17 00:00:00 2001 From: "J. Duke" Date: Wed, 5 Jul 2017 18:56:23 +0200 Subject: [PATCH 21/29] Added tag jdk8-b91 for changeset 80b6c3172dc2 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 3392c1b99b7..25e7a3c7d92 100644 --- a/.hgtags +++ b/.hgtags @@ -212,3 +212,4 @@ da9a4c9312816451884aa6db6f18be51a07bff13 jdk8-b86 e517701a4d0e25ae9c7945bca6e1762a8c5d8aa6 jdk8-b88 4dec41b3c5e3bb616f0c6f15830d940905aa5d16 jdk8-b89 f09ab0c416185e3cba371e81bcb6a16060c90f44 jdk8-b90 +80b6c3172dc2cfceb022411292d290a967f9c728 jdk8-b91 From ddea5b012c37425c1e8d0c97f01c400d733807d0 Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Fri, 24 May 2013 09:35:10 -0700 Subject: [PATCH 22/29] 8015305: new hotspot build - hs25-b35 Reviewed-by: jcoomes --- hotspot/make/hotspot_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index db74b20d81b..815215f44ec 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013 HS_MAJOR_VER=25 HS_MINOR_VER=0 -HS_BUILD_NUMBER=34 +HS_BUILD_NUMBER=35 JDK_MAJOR_VER=1 JDK_MINOR_VER=8 From 7cb20773ad93f884d0398a4f11a3dd80089a02fc Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Fri, 24 May 2013 17:19:56 -0700 Subject: [PATCH 23/29] 8015265: revise the fix for 8007037 Reviewed-by: sspitsyn, dholmes, dcubed --- hotspot/src/share/vm/oops/constantPool.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp index 5c5ae945bda..fe1d7340e47 100644 --- a/hotspot/src/share/vm/oops/constantPool.cpp +++ b/hotspot/src/share/vm/oops/constantPool.cpp @@ -1063,9 +1063,10 @@ bool ConstantPool::compare_entry_to(int index1, constantPoolHandle cp2, int k2 = cp2->invoke_dynamic_name_and_type_ref_index_at(index2); int i1 = invoke_dynamic_bootstrap_specifier_index(index1); int i2 = cp2->invoke_dynamic_bootstrap_specifier_index(index2); - bool match = compare_entry_to(k1, cp2, k2, CHECK_false) && - compare_operand_to(i1, cp2, i2, CHECK_false); - return match; + // separate statements and variables because CHECK_false is used + bool match_entry = compare_entry_to(k1, cp2, k2, CHECK_false); + bool match_operand = compare_operand_to(i1, cp2, i2, CHECK_false); + return (match_entry && match_operand); } break; case JVM_CONSTANT_String: From fb0022c7b1d6a9f313451fe311aaed8e62b10583 Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Fri, 24 May 2013 17:36:12 -0700 Subject: [PATCH 24/29] 8013945: CMS fatal error: must own lock MemberNameTable_lock The "delete mnt" needs to grab MemberNameTable_lock if !SafepointSynchronize::is_at_safepoint() Reviewed-by: sla, mgerdin, dholmes, jmasa --- hotspot/src/share/vm/oops/instanceKlass.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index 562adaae04a..84f1cdd3e6d 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -2320,10 +2320,15 @@ void InstanceKlass::release_C_heap_structures() { FreeHeap(jmeths); } - MemberNameTable* mnt = member_names(); - if (mnt != NULL) { - delete mnt; - set_member_names(NULL); + // Deallocate MemberNameTable + { + Mutex* lock_or_null = SafepointSynchronize::is_at_safepoint() ? NULL : MemberNameTable_lock; + MutexLockerEx ml(lock_or_null, Mutex::_no_safepoint_check_flag); + MemberNameTable* mnt = member_names(); + if (mnt != NULL) { + delete mnt; + set_member_names(NULL); + } } int* indices = methods_cached_itable_indices_acquire(); From 375e12feb95368849df2e8ec48c13608aff1a605 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 27 May 2013 12:49:08 -0700 Subject: [PATCH 25/29] 8015270: @Contended: fix multiple issues in the layout code Field count handling fixed, has_nonstatic_fields invariant fixed, oop map overrun fixed; new asserts Reviewed-by: kvn, dcubed, coleenp --- .../share/vm/classfile/classFileParser.cpp | 64 ++++--- .../test/runtime/contended/HasNonStatic.java | 75 ++++++++ hotspot/test/runtime/contended/OopMaps.java | 164 ++++++++++++++++++ 3 files changed, 283 insertions(+), 20 deletions(-) create mode 100644 hotspot/test/runtime/contended/HasNonStatic.java create mode 100644 hotspot/test/runtime/contended/OopMaps.java diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 8aa15736447..263409f15d8 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -3152,7 +3152,6 @@ void ClassFileParser::layout_fields(Handle class_loader, } } } - int contended_count = nonstatic_contended_count; // Calculate the starting byte offsets @@ -3177,35 +3176,52 @@ void ClassFileParser::layout_fields(Handle class_loader, next_nonstatic_field_offset = nonstatic_fields_start; + bool is_contended_class = parsed_annotations->is_contended(); + // Class is contended, pad before all the fields - if (parsed_annotations->is_contended()) { + if (is_contended_class) { next_nonstatic_field_offset += ContendedPaddingWidth; } - // Compute the non-contended fields count + // Compute the non-contended fields count. + // The packing code below relies on these counts to determine if some field + // can be squeezed into the alignment gap. Contended fields are obviously + // exempt from that. unsigned int nonstatic_double_count = fac->count[NONSTATIC_DOUBLE] - fac_contended.count[NONSTATIC_DOUBLE]; unsigned int nonstatic_word_count = fac->count[NONSTATIC_WORD] - fac_contended.count[NONSTATIC_WORD]; unsigned int nonstatic_short_count = fac->count[NONSTATIC_SHORT] - fac_contended.count[NONSTATIC_SHORT]; unsigned int nonstatic_byte_count = fac->count[NONSTATIC_BYTE] - fac_contended.count[NONSTATIC_BYTE]; unsigned int nonstatic_oop_count = fac->count[NONSTATIC_OOP] - fac_contended.count[NONSTATIC_OOP]; + // Total non-static fields count, including every contended field + unsigned int nonstatic_fields_count = fac->count[NONSTATIC_DOUBLE] + fac->count[NONSTATIC_WORD] + + fac->count[NONSTATIC_SHORT] + fac->count[NONSTATIC_BYTE] + + fac->count[NONSTATIC_OOP]; + bool super_has_nonstatic_fields = (_super_klass() != NULL && _super_klass->has_nonstatic_fields()); - bool has_nonstatic_fields = super_has_nonstatic_fields || - ((nonstatic_double_count + nonstatic_word_count + - nonstatic_short_count + nonstatic_byte_count + - nonstatic_oop_count) != 0); + bool has_nonstatic_fields = super_has_nonstatic_fields || (nonstatic_fields_count != 0); // Prepare list of oops for oop map generation. + // + // "offset" and "count" lists are describing the set of contiguous oop + // regions. offset[i] is the start of the i-th region, which then has + // count[i] oops following. Before we know how many regions are required, + // we pessimistically allocate the maps to fit all the oops into the + // distinct regions. + // + // TODO: We add +1 to always allocate non-zero resource arrays; we need + // to figure out if we still need to do this. int* nonstatic_oop_offsets; unsigned int* nonstatic_oop_counts; unsigned int nonstatic_oop_map_count = 0; + unsigned int max_nonstatic_oop_maps = fac->count[NONSTATIC_OOP] + 1; nonstatic_oop_offsets = NEW_RESOURCE_ARRAY_IN_THREAD( - THREAD, int, nonstatic_oop_count + 1); + THREAD, int, max_nonstatic_oop_maps); nonstatic_oop_counts = NEW_RESOURCE_ARRAY_IN_THREAD( - THREAD, unsigned int, nonstatic_oop_count + 1); + THREAD, unsigned int, max_nonstatic_oop_maps); first_nonstatic_oop_offset = 0; // will be set for first oop field @@ -3392,9 +3408,11 @@ void ClassFileParser::layout_fields(Handle class_loader, int(nonstatic_oop_counts[nonstatic_oop_map_count - 1]) * heapOopSize ) { // Extend current oop map + assert(nonstatic_oop_map_count - 1 < max_nonstatic_oop_maps, "range check"); nonstatic_oop_counts[nonstatic_oop_map_count - 1] += 1; } else { // Create new oop map + assert(nonstatic_oop_map_count < max_nonstatic_oop_maps, "range check"); nonstatic_oop_offsets[nonstatic_oop_map_count] = real_offset; nonstatic_oop_counts [nonstatic_oop_map_count] = 1; nonstatic_oop_map_count += 1; @@ -3452,12 +3470,10 @@ void ClassFileParser::layout_fields(Handle class_loader, // // Additionally, this should not break alignment for the fields, so we round the alignment up // for each field. - if (contended_count > 0) { + if (nonstatic_contended_count > 0) { // if there is at least one contended field, we need to have pre-padding for them - if (nonstatic_contended_count > 0) { - next_nonstatic_padded_offset += ContendedPaddingWidth; - } + next_nonstatic_padded_offset += ContendedPaddingWidth; // collect all contended groups BitMap bm(_cp->size()); @@ -3518,6 +3534,7 @@ void ClassFileParser::layout_fields(Handle class_loader, next_nonstatic_padded_offset += heapOopSize; // Create new oop map + assert(nonstatic_oop_map_count < max_nonstatic_oop_maps, "range check"); nonstatic_oop_offsets[nonstatic_oop_map_count] = real_offset; nonstatic_oop_counts [nonstatic_oop_map_count] = 1; nonstatic_oop_map_count += 1; @@ -3554,18 +3571,17 @@ void ClassFileParser::layout_fields(Handle class_loader, // handle static fields } - // Size of instances - int notaligned_offset = next_nonstatic_padded_offset; - // Entire class is contended, pad in the back. // This helps to alleviate memory contention effects for subclass fields // and/or adjacent object. - if (parsed_annotations->is_contended()) { - notaligned_offset += ContendedPaddingWidth; + if (is_contended_class) { + next_nonstatic_padded_offset += ContendedPaddingWidth; } - int nonstatic_fields_end = align_size_up(notaligned_offset, heapOopSize); - int instance_end = align_size_up(notaligned_offset, wordSize); + int notaligned_nonstatic_fields_end = next_nonstatic_padded_offset; + + int nonstatic_fields_end = align_size_up(notaligned_nonstatic_fields_end, heapOopSize); + int instance_end = align_size_up(notaligned_nonstatic_fields_end, wordSize); int static_fields_end = align_size_up(next_static_byte_offset, wordSize); int static_field_size = (static_fields_end - @@ -3579,6 +3595,14 @@ void ClassFileParser::layout_fields(Handle class_loader, (instanceOopDesc::base_offset_in_bytes() + nonstatic_field_size*heapOopSize), wordSize) / wordSize), "consistent layout helper value"); + // Invariant: nonstatic_field end/start should only change if there are + // nonstatic fields in the class, or if the class is contended. We compare + // against the non-aligned value, so that end alignment will not fail the + // assert without actually having the fields. + assert((notaligned_nonstatic_fields_end == nonstatic_fields_start) || + is_contended_class || + (nonstatic_fields_count > 0), "double-check nonstatic start/end"); + // Number of non-static oop map blocks allocated at end of klass. const unsigned int total_oop_map_count = compute_oop_map_count(_super_klass, nonstatic_oop_map_count, diff --git a/hotspot/test/runtime/contended/HasNonStatic.java b/hotspot/test/runtime/contended/HasNonStatic.java new file mode 100644 index 00000000000..6792adf6abb --- /dev/null +++ b/hotspot/test/runtime/contended/HasNonStatic.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.lang.Class; +import java.lang.String; +import java.lang.System; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CyclicBarrier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import sun.misc.Unsafe; +import sun.misc.Contended; + +/* + * @test + * @bug 8015270 + * @summary \@Contended: fix multiple issues in the layout code + * + * @run main/othervm -XX:-RestrictContended HasNonStatic + */ +public class HasNonStatic { + + public static void main(String[] args) throws Exception { + R1 r1 = new R1(); + R2 r2 = new R2(); + R3 r3 = new R3(); + R4 r4 = new R4(); + } + + public static class R1 { + @Contended + Object o; + } + + @Contended + public static class R2 { + Object o; + } + + @Contended + public static class R3 { + } + + public static class R4 extends R3 { + } + +} + diff --git a/hotspot/test/runtime/contended/OopMaps.java b/hotspot/test/runtime/contended/OopMaps.java new file mode 100644 index 00000000000..b8dfbba416b --- /dev/null +++ b/hotspot/test/runtime/contended/OopMaps.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.lang.Class; +import java.lang.String; +import java.lang.System; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CyclicBarrier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import sun.misc.Unsafe; +import sun.misc.Contended; + +/* + * @test + * @bug 8015270 + * @summary \@Contended: fix multiple issues in the layout code + * + * @run main/othervm -XX:-RestrictContended OopMaps + */ +public class OopMaps { + + public static void main(String[] args) throws Exception { + Object o01 = new Object(); + Object o02 = new Object(); + Object o03 = new Object(); + Object o04 = new Object(); + Object o05 = new Object(); + Object o06 = new Object(); + Object o07 = new Object(); + Object o08 = new Object(); + Object o09 = new Object(); + Object o10 = new Object(); + Object o11 = new Object(); + Object o12 = new Object(); + Object o13 = new Object(); + Object o14 = new Object(); + + final int COUNT = 100000; + R1[] rs = new R1[COUNT]; + + for (int i = 0; i < COUNT; i++) { + R1 r1 = new R1(); + r1.o01 = o01; + r1.o02 = o02; + r1.o03 = o03; + r1.o04 = o04; + r1.o05 = o05; + r1.o06 = o06; + r1.o07 = o07; + r1.o08 = o08; + r1.o09 = o09; + r1.o10 = o10; + r1.o11 = o11; + r1.o12 = o12; + r1.o13 = o13; + r1.o14 = o14; + r1.i1 = 1; + r1.i2 = 2; + r1.i3 = 3; + r1.i4 = 4; + rs[i] = r1; + } + + System.gc(); + + for (int i = 0; i < COUNT; i++) { + R1 r1 = rs[i]; + if (r1.o01 != o01) throw new Error("Test Error: o01"); + if (r1.o02 != o02) throw new Error("Test Error: o02"); + if (r1.o03 != o03) throw new Error("Test Error: o03"); + if (r1.o04 != o04) throw new Error("Test Error: o04"); + if (r1.o05 != o05) throw new Error("Test Error: o05"); + if (r1.o06 != o06) throw new Error("Test Error: o06"); + if (r1.o07 != o07) throw new Error("Test Error: o07"); + if (r1.o08 != o08) throw new Error("Test Error: o08"); + if (r1.o09 != o09) throw new Error("Test Error: o09"); + if (r1.o10 != o10) throw new Error("Test Error: o10"); + if (r1.o11 != o11) throw new Error("Test Error: o11"); + if (r1.o12 != o12) throw new Error("Test Error: o12"); + if (r1.o13 != o13) throw new Error("Test Error: o13"); + if (r1.o14 != o14) throw new Error("Test Error: o14"); + if (r1.i1 != 1) throw new Error("Test Error: i1"); + if (r1.i2 != 2) throw new Error("Test Error: i2"); + if (r1.i3 != 3) throw new Error("Test Error: i3"); + if (r1.i4 != 4) throw new Error("Test Error: i4"); + } + } + + public static class R0 { + int i1; + int i2; + + Object o01; + Object o02; + + @Contended + Object o03; + + @Contended + Object o04; + + @Contended + Object o05; + + @Contended + Object o06; + + @Contended + Object o07; + } + + public static class R1 extends R0 { + int i3; + int i4; + + Object o08; + Object o09; + + @Contended + Object o10; + + @Contended + Object o11; + + @Contended + Object o12; + + @Contended + Object o13; + + @Contended + Object o14; + } + +} + From 7f2a2f1460e0c397e9a867ccd2efe382f4093535 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Tue, 28 May 2013 15:08:57 +0200 Subject: [PATCH 26/29] 8015329: Print reason for failed MiniDumpWriteDump() call Printing both result from GetLastError and text representation of error. Also changed so that we produce dumps by default on client versions of Windows when running with a debug build. Also reviewed by peter.allwin@oracle.com Reviewed-by: sla, dholmes --- hotspot/src/os/windows/vm/os_windows.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 5a05d416a98..275dc3b809a 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -944,6 +944,8 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* MINIDUMP_TYPE dumpType; static const char* cwd; +// Default is to always create dump for debug builds, on product builds only dump on server versions of Windows. +#ifndef ASSERT // If running on a client version of Windows and user has not explicitly enabled dumping if (!os::win32::is_windows_server() && !CreateMinidumpOnCrash) { VMError::report_coredump_status("Minidumps are not enabled by default on client versions of Windows", false); @@ -953,6 +955,12 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* VMError::report_coredump_status("Minidump has been disabled from the command line", false); return; } +#else + if (!FLAG_IS_DEFAULT(CreateMinidumpOnCrash) && !CreateMinidumpOnCrash) { + VMError::report_coredump_status("Minidump has been disabled from the command line", false); + return; + } +#endif dbghelp = os::win32::load_Windows_dll("DBGHELP.DLL", NULL, 0); @@ -1004,7 +1012,21 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* // the dump types we really want. If first call fails, lets fall back to just use MiniDumpWithFullMemory then. if (_MiniDumpWriteDump(hProcess, processId, dumpFile, dumpType, pmei, NULL, NULL) == false && _MiniDumpWriteDump(hProcess, processId, dumpFile, (MINIDUMP_TYPE)MiniDumpWithFullMemory, pmei, NULL, NULL) == false) { - VMError::report_coredump_status("Call to MiniDumpWriteDump() failed", false); + DWORD error = GetLastError(); + LPTSTR msgbuf = NULL; + + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, error, 0, (LPTSTR)&msgbuf, 0, NULL) != 0) { + + jio_snprintf(buffer, bufferSize, "Call to MiniDumpWriteDump() failed (Error 0x%x: %s)", error, msgbuf); + LocalFree(msgbuf); + } else { + // Call to FormatMessage failed, just include the result from GetLastError + jio_snprintf(buffer, bufferSize, "Call to MiniDumpWriteDump() failed (Error 0x%x)", error); + } + VMError::report_coredump_status(buffer, false); } else { VMError::report_coredump_status(buffer, true); } From b0dcc34e06089cd76a0c85f39b0ed0d88418c33c Mon Sep 17 00:00:00 2001 From: Joseph Provino Date: Tue, 28 May 2013 11:17:16 -0400 Subject: [PATCH 27/29] 8013461: There is a symbol AsyncGetCallTrace in libjvm.symbols that does not exist in minimal/libjvm.a when DEBUG_LEVEL == release AsyncGetCallTrace is needed in libjvm.symbols so that programs which reference it can build correctly. Reviewed-by: dholmes, bobv --- hotspot/make/excludeSrc.make | 2 +- hotspot/src/share/vm/prims/forte.cpp | 38 ++++++++++++++++++---------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/hotspot/make/excludeSrc.make b/hotspot/make/excludeSrc.make index 93f68ee41c0..df9bc302165 100644 --- a/hotspot/make/excludeSrc.make +++ b/hotspot/make/excludeSrc.make @@ -25,7 +25,7 @@ ifeq ($(INCLUDE_JVMTI), false) CXXFLAGS += -DINCLUDE_JVMTI=0 CFLAGS += -DINCLUDE_JVMTI=0 - Src_Files_EXCLUDE += jvmtiGetLoadedClasses.cpp forte.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \ + Src_Files_EXCLUDE += jvmtiGetLoadedClasses.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \ jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \ jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \ jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \ diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp index 33419f29836..737dcecd0e1 100644 --- a/hotspot/src/share/vm/prims/forte.cpp +++ b/hotspot/src/share/vm/prims/forte.cpp @@ -35,6 +35,19 @@ #include "runtime/vframe.hpp" #include "runtime/vframeArray.hpp" +// call frame copied from old .h file and renamed +typedef struct { + jint lineno; // line number in the source file + jmethodID method_id; // method executed in this frame +} ASGCT_CallFrame; + +// call trace copied from old .h file and renamed +typedef struct { + JNIEnv *env_id; // Env where trace was recorded + jint num_frames; // number of frames in this trace + ASGCT_CallFrame *frames; // frames +} ASGCT_CallTrace; + // These name match the names reported by the forte quality kit enum { ticks_no_Java_frame = 0, @@ -50,6 +63,8 @@ enum { ticks_safepoint = -10 }; +#if INCLUDE_JVMTI + //------------------------------------------------------- // Native interfaces for use by Forte tools. @@ -360,20 +375,6 @@ static bool find_initial_Java_frame(JavaThread* thread, } - -// call frame copied from old .h file and renamed -typedef struct { - jint lineno; // line number in the source file - jmethodID method_id; // method executed in this frame -} ASGCT_CallFrame; - -// call trace copied from old .h file and renamed -typedef struct { - JNIEnv *env_id; // Env where trace was recorded - jint num_frames; // number of frames in this trace - ASGCT_CallFrame *frames; // frames -} ASGCT_CallTrace; - static void forte_fill_call_trace_given_top(JavaThread* thd, ASGCT_CallTrace* trace, int depth, @@ -634,3 +635,12 @@ void Forte::register_stub(const char* name, address start, address end) { pointer_delta(end, start, sizeof(jbyte)), 0, NULL); #endif // !_WINDOWS && !IA64 } + +#else // INCLUDE_JVMTI +extern "C" { + JNIEXPORT + void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) { + trace->num_frames = ticks_no_class_load; // -1 + } +} +#endif // INCLUDE_JVMTI From 8d4061812f566f10543125e7dd12f0aa932c856c Mon Sep 17 00:00:00 2001 From: Joseph Provino Date: Tue, 28 May 2013 11:32:46 -0400 Subject: [PATCH 28/29] 8011064: Some tests have failed with SIGSEGV on arm-hflt on build b82 NMT_detail is only supported when frame pointers are not omitted (-fno-omit-frame-pointer). Reviewed-by: dholmes, cjplummer --- hotspot/src/share/vm/services/memTracker.cpp | 11 ++++++++++- hotspot/src/share/vm/utilities/globalDefinitions.hpp | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/services/memTracker.cpp b/hotspot/src/share/vm/services/memTracker.cpp index a89de2f40af..0e6f7c42e57 100644 --- a/hotspot/src/share/vm/services/memTracker.cpp +++ b/hotspot/src/share/vm/services/memTracker.cpp @@ -34,6 +34,7 @@ #include "services/memReporter.hpp" #include "services/memTracker.hpp" #include "utilities/decoder.hpp" +#include "utilities/defaultStream.hpp" #include "utilities/globalDefinitions.hpp" bool NMT_track_callsite = false; @@ -77,7 +78,15 @@ void MemTracker::init_tracking_options(const char* option_line) { if (strcmp(option_line, "=summary") == 0) { _tracking_level = NMT_summary; } else if (strcmp(option_line, "=detail") == 0) { - _tracking_level = NMT_detail; + // detail relies on a stack-walking ability that may not + // be available depending on platform and/or compiler flags + if (PLATFORM_NMT_DETAIL_SUPPORTED) { + _tracking_level = NMT_detail; + } else { + jio_fprintf(defaultStream::error_stream(), + "NMT detail is not supported on this platform. Using NMT summary instead."); + _tracking_level = NMT_summary; + } } else if (strcmp(option_line, "=off") != 0) { vm_exit_during_initialization("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL); } diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 5609ffdf431..d9088307a97 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -380,6 +380,14 @@ const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlass # include "globalDefinitions_ppc.hpp" #endif +/* + * If a platform does not support NMT_detail + * the platform specific globalDefinitions (above) + * can set PLATFORM_NMT_DETAIL_SUPPORTED to false + */ +#ifndef PLATFORM_NMT_DETAIL_SUPPORTED +#define PLATFORM_NMT_DETAIL_SUPPORTED true +#endif // The byte alignment to be used by Arena::Amalloc. See bugid 4169348. // Note: this value must be a power of 2 From 0793ab7e650022fa61ef49a27021ecc5218e12bd Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Tue, 28 May 2013 19:54:18 +0400 Subject: [PATCH 29/29] 8015493: runtime/contended/OopMaps.java fails with OutOfMemory Limit the memory footprint to dodge OutOfMemory errors. Reviewed-by: dcubed, ctornqvi, iignatyev --- hotspot/test/runtime/contended/OopMaps.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hotspot/test/runtime/contended/OopMaps.java b/hotspot/test/runtime/contended/OopMaps.java index b8dfbba416b..8faa0bee2ac 100644 --- a/hotspot/test/runtime/contended/OopMaps.java +++ b/hotspot/test/runtime/contended/OopMaps.java @@ -41,12 +41,15 @@ import sun.misc.Contended; /* * @test * @bug 8015270 + * @bug 8015493 * @summary \@Contended: fix multiple issues in the layout code * - * @run main/othervm -XX:-RestrictContended OopMaps + * @run main/othervm -XX:-RestrictContended -XX:ContendedPaddingWidth=128 -Xmx128m OopMaps */ public class OopMaps { + public static final int COUNT = 10000; + public static void main(String[] args) throws Exception { Object o01 = new Object(); Object o02 = new Object(); @@ -63,7 +66,6 @@ public class OopMaps { Object o13 = new Object(); Object o14 = new Object(); - final int COUNT = 100000; R1[] rs = new R1[COUNT]; for (int i = 0; i < COUNT; i++) {