# HG changeset patch # User rbackman # Date 1409243465 -7200 # Node ID 3fe652b058706c2f56a40d746bb64fdf31a2a30b # Parent 352debf44a39081370e61c1fd2d92d7de22c948c# Parent 7e8c3ace277d6bd97666edc2128ffa97e68f2173 Merge diff -r 352debf44a39 -r 3fe652b05870 hotspot/make/Makefile --- a/hotspot/make/Makefile Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/make/Makefile Thu Aug 28 18:31:05 2014 +0200 @@ -721,6 +721,19 @@ ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \ fi +copy_optimized_jdk:: + $(RM) -r $(JDK_IMAGE_DIR)/optimized + $(MKDIR) -p $(JDK_IMAGE_DIR)/optimized + if [ -d $(JDK_IMPORT_PATH)/optimized ] ; then \ + ($(CD) $(JDK_IMPORT_PATH)/optimized && \ + $(TAR) -cf - $(JDK_DIRS)) | \ + ($(CD) $(JDK_IMAGE_DIR)/optimized && $(TAR) -xf -) ; \ + else \ + ($(CD) $(JDK_IMPORT_PATH) && \ + $(TAR) -cf - $(JDK_DIRS)) | \ + ($(CD) $(JDK_IMAGE_DIR)/optimized && $(TAR) -xf -) ; \ + fi + # # Check target # diff -r 352debf44a39 -r 3fe652b05870 hotspot/make/jprt.gmk --- a/hotspot/make/jprt.gmk Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/make/jprt.gmk Thu Aug 28 18:31:05 2014 +0200 @@ -42,6 +42,9 @@ jprt_build_fastdebugEmb: $(MAKE) JAVASE_EMBEDDED=true MINIMIZE_RAM_USAGE=true jprt_build_fastdebug +jprt_build_optimizedEmb: + $(MAKE) JAVASE_EMBEDDED=true MINIMIZE_RAM_USAGE=true jprt_build_optimized + jprt_build_productOpen: $(MAKE) OPENJDK=true jprt_build_product @@ -51,6 +54,9 @@ jprt_build_fastdebugOpen: $(MAKE) OPENJDK=true jprt_build_fastdebug +jprt_build_optimizedOpen: + $(MAKE) OPENJDK=true jprt_build_optimized + jprt_build_product: all_product copy_product_jdk export_product_jdk ( $(CD) $(JDK_IMAGE_DIR) && \ $(ZIPEXE) $(ZIPFLAGS) -r $(JPRT_ARCHIVE_BUNDLE) . ) @@ -63,5 +69,9 @@ ( $(CD) $(JDK_IMAGE_DIR)/debug && \ $(ZIPEXE) $(ZIPFLAGS) -r $(JPRT_ARCHIVE_BUNDLE) . ) -.PHONY: jprt_build_product jprt_build_fastdebug jprt_build_debug +jprt_build_optimized: all_optimized copy_optimized_jdk export_optimized_jdk + ( $(CD) $(JDK_IMAGE_DIR)/optimized && \ + $(ZIPEXE) $(ZIPFLAGS) -r $(JPRT_ARCHIVE_BUNDLE) . ) +.PHONY: jprt_build_product jprt_build_fastdebug jprt_build_debug jprt_build_optimized + diff -r 352debf44a39 -r 3fe652b05870 hotspot/make/jprt.properties --- a/hotspot/make/jprt.properties Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/make/jprt.properties Thu Aug 28 18:31:05 2014 +0200 @@ -93,13 +93,13 @@ # Standard list of jprt build targets for this source tree jprt.build.targets.standard= \ - ${jprt.my.solaris.sparcv9}-{product|fastdebug|optimized}, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}, \ ${jprt.my.solaris.x64}-{product|fastdebug}, \ ${jprt.my.linux.i586}-{product|fastdebug}, \ - ${jprt.my.linux.x64}-{product|fastdebug|optimized}, \ + ${jprt.my.linux.x64}-{product|fastdebug}, \ ${jprt.my.macosx.x64}-{product|fastdebug}, \ ${jprt.my.windows.i586}-{product|fastdebug}, \ - ${jprt.my.windows.x64}-{product|fastdebug|optimized}, \ + ${jprt.my.windows.x64}-{product|fastdebug}, \ ${jprt.my.linux.armvh}-{product|fastdebug} jprt.build.targets.open= \ diff -r 352debf44a39 -r 3fe652b05870 hotspot/src/cpu/x86/vm/vm_version_x86.cpp --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp Thu Aug 28 18:31:05 2014 +0200 @@ -604,6 +604,17 @@ #if INCLUDE_RTM_OPT if (UseRTMLocking) { + if (is_intel_family_core()) { + if ((_model == CPU_MODEL_HASWELL_E3) || + (_model == CPU_MODEL_HASWELL_E7 && _stepping < 3) || + (_model == CPU_MODEL_BROADWELL && _stepping < 4)) { + if (!UnlockExperimentalVMOptions) { + vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this platform. It must be enabled via -XX:+UnlockExperimentalVMOptions flag."); + } else { + warning("UseRTMLocking is only available as experimental option on this platform."); + } + } + } if (!FLAG_IS_CMDLINE(UseRTMLocking)) { // RTM locking should be used only for applications with // high lock contention. For now we do not use it by default. diff -r 352debf44a39 -r 3fe652b05870 hotspot/src/cpu/x86/vm/vm_version_x86.hpp --- a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp Thu Aug 28 18:31:05 2014 +0200 @@ -276,7 +276,10 @@ CPU_MODEL_WESTMERE_EX = 0x2f, CPU_MODEL_SANDYBRIDGE = 0x2a, CPU_MODEL_SANDYBRIDGE_EP = 0x2d, - CPU_MODEL_IVYBRIDGE_EP = 0x3a + CPU_MODEL_IVYBRIDGE_EP = 0x3a, + CPU_MODEL_HASWELL_E3 = 0x3c, + CPU_MODEL_HASWELL_E7 = 0x3f, + CPU_MODEL_BROADWELL = 0x3d } cpuExtendedFamily; // cpuid information block. All info derived from executing cpuid with diff -r 352debf44a39 -r 3fe652b05870 hotspot/src/share/vm/opto/type.cpp --- a/hotspot/src/share/vm/opto/type.cpp Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/src/share/vm/opto/type.cpp Thu Aug 28 18:31:05 2014 +0200 @@ -1708,8 +1708,8 @@ // Make a TypeTuple from the range of a method signature const TypeTuple *TypeTuple::make_range(ciSignature* sig) { ciType* return_type = sig->return_type(); - uint total_fields = TypeFunc::Parms + return_type->size(); - const Type **field_array = fields(total_fields); + uint arg_cnt = return_type->size(); + const Type **field_array = fields(arg_cnt); switch (return_type->basic_type()) { case T_LONG: field_array[TypeFunc::Parms] = TypeLong::LONG; @@ -1734,26 +1734,26 @@ default: ShouldNotReachHere(); } - return (TypeTuple*)(new TypeTuple(total_fields,field_array))->hashcons(); + return (TypeTuple*)(new TypeTuple(TypeFunc::Parms + arg_cnt, field_array))->hashcons(); } // Make a TypeTuple from the domain of a method signature const TypeTuple *TypeTuple::make_domain(ciInstanceKlass* recv, ciSignature* sig) { - uint total_fields = TypeFunc::Parms + sig->size(); + uint arg_cnt = sig->size(); uint pos = TypeFunc::Parms; const Type **field_array; if (recv != NULL) { - total_fields++; - field_array = fields(total_fields); + arg_cnt++; + field_array = fields(arg_cnt); // Use get_const_type here because it respects UseUniqueSubclasses: field_array[pos++] = get_const_type(recv)->join_speculative(TypePtr::NOTNULL); } else { - field_array = fields(total_fields); + field_array = fields(arg_cnt); } int i = 0; - while (pos < total_fields) { + while (pos < TypeFunc::Parms + arg_cnt) { ciType* type = sig->type_at(i); switch (type->basic_type()) { @@ -1780,7 +1780,8 @@ } i++; } - return (TypeTuple*)(new TypeTuple(total_fields,field_array))->hashcons(); + + return (TypeTuple*)(new TypeTuple(TypeFunc::Parms + arg_cnt, field_array))->hashcons(); } const TypeTuple *TypeTuple::make( uint cnt, const Type **fields ) { @@ -1789,6 +1790,7 @@ //------------------------------fields----------------------------------------- // Subroutine call type with space allocated for argument types +// Memory for Control, I_O, Memory, FramePtr, and ReturnAdr is allocated implicitly const Type **TypeTuple::fields( uint arg_cnt ) { const Type **flds = (const Type **)(Compile::current()->type_arena()->Amalloc_4((TypeFunc::Parms+arg_cnt)*sizeof(Type*) )); flds[TypeFunc::Control ] = Type::CONTROL; diff -r 352debf44a39 -r 3fe652b05870 hotspot/src/share/vm/opto/type.hpp --- a/hotspot/src/share/vm/opto/type.hpp Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/src/share/vm/opto/type.hpp Thu Aug 28 18:31:05 2014 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -635,6 +635,7 @@ static const TypeTuple *make_domain(ciInstanceKlass* recv, ciSignature *sig); // Subroutine call type with space allocated for argument types + // Memory for Control, I_O, Memory, FramePtr, and ReturnAdr is allocated implicitly static const Type **fields( uint arg_cnt ); virtual const Type *xmeet( const Type *t ) const; diff -r 352debf44a39 -r 3fe652b05870 hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java --- a/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java Thu Aug 28 18:31:05 2014 +0200 @@ -35,7 +35,9 @@ * @summary "Tests unloading of anonymous classes." * @library /testlibrary /testlibrary/whitebox * @compile TestAnonymousClassUnloading.java - * @run main ClassFileInstaller TestAnonymousClassUnloading sun.hotspot.WhiteBox + * @run main ClassFileInstaller TestAnonymousClassUnloading + * sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation TestAnonymousClassUnloading */ public class TestAnonymousClassUnloading { diff -r 352debf44a39 -r 3fe652b05870 hotspot/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java --- a/hotspot/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java Thu Aug 28 18:31:05 2014 +0200 @@ -36,7 +36,7 @@ * @build WorkerClass * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation -XX:-UseCompressedOops -XX:+UseParallelGC -XX:CompileOnly=TestMethodUnloading::doWork TestMethodUnloading + * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation -XX:-UseCompressedOops -XX:CompileOnly=TestMethodUnloading::doWork TestMethodUnloading */ public class TestMethodUnloading { private static final String workerClassName = "WorkerClass"; diff -r 352debf44a39 -r 3fe652b05870 hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java --- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java Thu Aug 28 18:31:05 2014 +0200 @@ -54,16 +54,19 @@ CommandLineOptionTest.verifyOptionValueForSameVM(optionName, TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE, CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS, + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:+UseRTMLocking"); CommandLineOptionTest.verifyOptionValueForSameVM(optionName, TestPrintPreciseRTMLockingStatisticsBase.DEFAULT_VALUE, CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS, + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:-UseRTMLocking", prepareOptionValue("true")); // verify that option could be turned on CommandLineOptionTest.verifyOptionValueForSameVM(optionName, "true", CommandLineOptionTest.UNLOCK_DIAGNOSTIC_VM_OPTIONS, + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:+UseRTMLocking", prepareOptionValue("true")); } diff -r 352debf44a39 -r 3fe652b05870 hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java --- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java Thu Aug 28 18:31:05 2014 +0200 @@ -63,13 +63,16 @@ // verify default value CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", TestUseRTMDeoptOptionOnSupportedConfig.DEFAULT_VALUE, + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:+UseRTMLocking"); // verify that option is off when UseRTMLocking is off - CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", - "false", "-XX:-UseRTMLocking", "-XX:+UseRTMDeopt"); + CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "false", + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, + "-XX:-UseRTMLocking", "-XX:+UseRTMDeopt"); // verify that option could be turned on - CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", - "true", "-XX:+UseRTMLocking", "-XX:+UseRTMDeopt"); + CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMDeopt", "true", + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, + "-XX:+UseRTMLocking", "-XX:+UseRTMDeopt"); } public static void main(String args[]) throws Throwable { diff -r 352debf44a39 -r 3fe652b05870 hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java --- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java Thu Aug 28 18:31:05 2014 +0200 @@ -59,24 +59,31 @@ new String[]{ RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR, unrecongnizedOption - }, ExitCode.OK, "-XX:+UseRTMLocking" + }, ExitCode.OK, + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, + "-XX:+UseRTMLocking" ); CommandLineOptionTest.verifySameJVMStartup(null, new String[]{ RTMGenericCommandLineOptionTest.RTM_INSTR_ERROR, unrecongnizedOption - }, ExitCode.OK, "-XX:-UseRTMLocking" + }, ExitCode.OK, + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, + "-XX:-UseRTMLocking" ); // verify that UseRTMLocking is of by default CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", - TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE); + TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE, + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS); // verify that we can change UseRTMLocking value CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", TestUseRTMLockingOptionOnSupportedConfig.DEFAULT_VALUE, + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:-UseRTMLocking"); CommandLineOptionTest.verifyOptionValueForSameVM("UseRTMLocking", - "true", "-XX:+UseRTMLocking"); + "true", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, + "-XX:+UseRTMLocking"); } public static void main(String args[]) throws Throwable { diff -r 352debf44a39 -r 3fe652b05870 hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java --- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java Tue Aug 26 13:07:57 2014 -0700 +++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java Thu Aug 28 18:31:05 2014 +0200 @@ -54,18 +54,22 @@ // verify that we will not get a warning CommandLineOptionTest.verifySameJVMStartup(null, new String[] { warningMessage }, ExitCode.OK, + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:+UseRTMLocking", "-XX:-UseBiasedLocking"); // verify that we will get a warning CommandLineOptionTest.verifySameJVMStartup( new String[] { warningMessage }, null, ExitCode.OK, + CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking"); // verify that UseBiasedLocking is false when we use rtm locking CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking", - "false", "-XX:+UseRTMLocking"); + "false", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, + "-XX:+UseRTMLocking"); // verify that we can't turn on biased locking when // using rtm locking CommandLineOptionTest.verifyOptionValueForSameVM("UseBiasedLocking", - "false", "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking"); + "false", CommandLineOptionTest.UNLOCK_EXPERIMENTAL_VM_OPTIONS, + "-XX:+UseRTMLocking", "-XX:+UseBiasedLocking"); } public static void main(String args[]) throws Throwable {