OpenJDK / jdk / jdk10
changeset 21693:7019c7876f50
Merge
author | lana |
---|---|
date | Fri, 08 Nov 2013 17:39:39 -0800 |
parents | e1c40a93dd66 aaf663f591ab |
children | ceff78ba5ce4 |
files | jdk/src/share/classes/java/lang/invoke/MagicLambdaImpl.java jdk/src/share/demo/jfc/Notepad/resources/Notepad_fr.properties jdk/src/share/demo/jfc/Notepad/resources/Notepad_sv.properties jdk/test/java/net/NetworkInterface/MemLeakTest.java jdk/test/jdk/lambda/vm/DefaultMethodsTest.java jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh jdk/test/sun/tools/jstatd/jpsOutput1.awk jdk/test/sun/tools/jstatd/jstatGcutilOutput1.awk jdk/test/sun/tools/jstatd/jstatdDefaults.sh jdk/test/sun/tools/jstatd/jstatdExternalRegistry.sh jdk/test/sun/tools/jstatd/jstatdPort.sh jdk/test/sun/tools/jstatd/jstatdServerName.sh jdk/test/sun/tools/jstatd/jstatdUsage1.sh jdk/test/sun/tools/jstatd/usage.out langtools/test/tools/javac/ExtDirs/ext1/pkg1.jar langtools/test/tools/javac/ExtDirs/ext2/pkg2.jar langtools/test/tools/javac/ExtDirs/ext3/pkg1.jar langtools/test/tools/javac/ExtDirs/ext3/pkg2.jar langtools/test/tools/javac/T8019486/WrongLVTForLambdaTest.java |
diffstat | 1509 files changed, 37007 insertions(+), 9371 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Thu Nov 07 18:11:12 2013 +0530 +++ b/.hgtags Fri Nov 08 17:39:39 2013 -0800 @@ -235,3 +235,5 @@ b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111 ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112 4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113 +dfa34ab293faad9b543a24646dbb381bc3ab5586 jdk8-b114 +3dd9732b17034f45d111996d1d50287b05a3998c jdk8-b115
--- a/.hgtags-top-repo Thu Nov 07 18:11:12 2013 +0530 +++ b/.hgtags-top-repo Fri Nov 08 17:39:39 2013 -0800 @@ -235,3 +235,5 @@ d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111 547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112 6ba4c7cb623ec612031e05cf8bf279d8f407bd1e jdk8-b113 +4f2011496393a26dcfd7b1f7787a3673ddd32599 jdk8-b114 +763ada2a1d8c5962bc8c3d297e57c562d2e95338 jdk8-b115
--- a/common/autoconf/basics.m4 Thu Nov 07 18:11:12 2013 +0530 +++ b/common/autoconf/basics.m4 Fri Nov 08 17:39:39 2013 -0800 @@ -514,7 +514,7 @@ if test "x$IS_GNU_MAKE" = x; then AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.]) else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[[12]]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[[12]]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.]) else
--- a/common/autoconf/generated-configure.sh Thu Nov 07 18:11:12 2013 +0530 +++ b/common/autoconf/generated-configure.sh Fri Nov 08 17:39:39 2013 -0800 @@ -3865,7 +3865,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1382702260 +DATE_WHEN_GENERATED=1383151988 ############################################################################### # @@ -8323,7 +8323,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -8680,7 +8680,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9034,7 +9034,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9393,7 +9393,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9746,7 +9746,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
--- a/corba/.hgtags Thu Nov 07 18:11:12 2013 +0530 +++ b/corba/.hgtags Fri Nov 08 17:39:39 2013 -0800 @@ -235,3 +235,5 @@ 85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111 43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112 a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113 +0bbccf77c23e566170b88b52c2cf28e5d31ce927 jdk8-b114 +8d07115924b7d703a5048adb24e8aba751442f13 jdk8-b115
--- a/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Thu Nov 07 18:11:12 2013 +0530 +++ b/corba/src/share/classes/com/sun/corba/se/impl/corba/AnyImpl.java Fri Nov 08 17:39:39 2013 -0800 @@ -580,7 +580,7 @@ java.lang.Object[] objholder = new java.lang.Object[1]; objholder[0] = object; long[] longholder = new long[1]; - TCUtility.unmarshalIn(in, typeCode, longholder, objholder); + TCUtility.unmarshalIn(in, realType(), longholder, objholder); value = longholder[0]; object = objholder[0]; stream = null;
--- a/corba/src/share/classes/javax/rmi/CORBA/Stub.java Thu Nov 07 18:11:12 2013 +0530 +++ b/corba/src/share/classes/javax/rmi/CORBA/Stub.java Fri Nov 08 17:39:39 2013 -0800 @@ -61,13 +61,11 @@ private transient StubDelegate stubDelegate = null; private static Class stubDelegateClass = null; private static final String StubClassKey = "javax.rmi.CORBA.StubClass"; - private static final String defaultStubImplName = "com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl"; static { - Object stubDelegateInstance = (Object) createDelegateIfSpecified(StubClassKey, defaultStubImplName); + Object stubDelegateInstance = createDelegate(StubClassKey); if (stubDelegateInstance != null) stubDelegateClass = stubDelegateInstance.getClass(); - } @@ -207,7 +205,7 @@ // are in different packages and the visibility needs to be package for // security reasons. If you know a better solution how to share this code // then remove it from PortableRemoteObject. Also in Util.java - private static Object createDelegateIfSpecified(String classKey, String defaultClassName) { + private static Object createDelegate(String classKey) { String className = (String) AccessController.doPrivileged(new GetPropertyAction(classKey)); if (className == null) { @@ -218,7 +216,7 @@ } if (className == null) { - className = defaultClassName; + return new com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl(); } try {
--- a/corba/src/share/classes/javax/rmi/CORBA/Util.java Thu Nov 07 18:11:12 2013 +0530 +++ b/corba/src/share/classes/javax/rmi/CORBA/Util.java Fri Nov 08 17:39:39 2013 -0800 @@ -60,14 +60,11 @@ public class Util { // This can only be set at static initialization time (no sync necessary). - private static javax.rmi.CORBA.UtilDelegate utilDelegate = null; + private static final javax.rmi.CORBA.UtilDelegate utilDelegate; private static final String UtilClassKey = "javax.rmi.CORBA.UtilClass"; - private static final String defaultUtilImplName = -"com.sun.corba.se.impl.javax.rmi.CORBA.Util"; static { - utilDelegate = (javax.rmi.CORBA.UtilDelegate) - createDelegateIfSpecified(UtilClassKey, defaultUtilImplName); + utilDelegate = (javax.rmi.CORBA.UtilDelegate)createDelegate(UtilClassKey); } private Util(){} @@ -338,9 +335,7 @@ // are in different packages and the visibility needs to be package for // security reasons. If you know a better solution how to share this code // then remove it from PortableRemoteObject. Also in Stub.java - private static Object createDelegateIfSpecified(String classKey, - String defaultClassName) - { + private static Object createDelegate(String classKey) { String className = (String) AccessController.doPrivileged(new GetPropertyAction(classKey)); if (className == null) { @@ -351,7 +346,7 @@ } if (className == null) { - className = defaultClassName; + return new com.sun.corba.se.impl.javax.rmi.CORBA.Util(); } try {
--- a/corba/src/share/classes/javax/rmi/PortableRemoteObject.java Thu Nov 07 18:11:12 2013 +0530 +++ b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java Fri Nov 08 17:39:39 2013 -0800 @@ -65,17 +65,14 @@ */ public class PortableRemoteObject { - private static javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate = null; + private static final javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate; private static final String PortableRemoteObjectClassKey = "javax.rmi.CORBA.PortableRemoteObjectClass"; - private static final String defaultPortableRemoteObjectImplName = - "com.sun.corba.se.impl.javax.rmi.PortableRemoteObject"; - static { proDelegate = (javax.rmi.CORBA.PortableRemoteObjectDelegate) - createDelegateIfSpecified(PortableRemoteObjectClassKey); + createDelegate(PortableRemoteObjectClassKey); } /** @@ -181,7 +178,7 @@ // are in different packages and the visibility needs to be package for // security reasons. If you know a better solution how to share this code // then remove it from here. - private static Object createDelegateIfSpecified(String classKey) { + private static Object createDelegate(String classKey) { String className = (String) AccessController.doPrivileged(new GetPropertyAction(classKey)); if (className == null) { @@ -191,7 +188,7 @@ } } if (className == null) { - className = defaultPortableRemoteObjectImplName; + return new com.sun.corba.se.impl.javax.rmi.PortableRemoteObject(); } try {
--- a/corba/src/share/classes/org/omg/CORBA/ORB.java Thu Nov 07 18:11:12 2013 +0530 +++ b/corba/src/share/classes/org/omg/CORBA/ORB.java Fri Nov 08 17:39:39 2013 -0800 @@ -174,15 +174,6 @@ private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass"; // - // The last resort fallback ORB implementation classes in case - // no ORB implementation class is dynamically configured through - // properties or applet parameters. Change these values to - // vendor-specific class names. - // - private static final String defaultORB = "com.sun.corba.se.impl.orb.ORBImpl"; - private static final String defaultORBSingleton = "com.sun.corba.se.impl.orb.ORBSingleton"; - - // // The global instance of the singleton ORB implementation which // acts as a factory for typecodes for generated Helper classes. // TypeCodes should be immutable since they may be shared across @@ -294,10 +285,11 @@ String className = getSystemProperty(ORBSingletonClassKey); if (className == null) className = getPropertyFromFile(ORBSingletonClassKey); - if (className == null) - className = defaultORBSingleton; - - singleton = create_impl(className); + if (className == null) { + singleton = new com.sun.corba.se.impl.orb.ORBSingleton(); + } else { + singleton = create_impl(className); + } } return singleton; } @@ -347,10 +339,12 @@ className = getSystemProperty(ORBClassKey); if (className == null) className = getPropertyFromFile(ORBClassKey); - if (className == null) - className = defaultORB; + if (className == null) { + orb = new com.sun.corba.se.impl.orb.ORBImpl(); + } else { + orb = create_impl(className); + } - orb = create_impl(className); orb.set_parameters(args, props); return orb; } @@ -375,10 +369,12 @@ className = getSystemProperty(ORBClassKey); if (className == null) className = getPropertyFromFile(ORBClassKey); - if (className == null) - className = defaultORB; + if (className == null) { + orb = new com.sun.corba.se.impl.orb.ORBImpl(); + } else { + orb = create_impl(className); + } - orb = create_impl(className); orb.set_parameters(app, props); return orb; }
--- a/hotspot/.hgtags Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/.hgtags Fri Nov 08 17:39:39 2013 -0800 @@ -389,3 +389,7 @@ 23b8db5ea31d3079f1326afde4cd5c67b1dac49c hs25-b55 4589b398ab03aba6a5da8c06ff53603488d1b8f4 jdk8-b113 82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56 +7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114 +3b32d287da89a47a45d16f6d9ba5bd3cd9bf4b3e hs25-b57 +9ebaac78a8a0061fb9597e07f806498cb626cdeb jdk8-b115 +e510dfdec6dd701410f3398ed86ebcdff0cca63a hs25-b58
--- a/hotspot/agent/src/os/bsd/ps_proc.c Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/agent/src/os/bsd/ps_proc.c Fri Nov 08 17:39:39 2013 -0800 @@ -131,7 +131,7 @@ static bool ptrace_continue(pid_t pid, int signal) { // pass the signal to the process so we don't swallow it - if (ptrace(PTRACE_CONT, pid, NULL, signal) < 0) { + if (ptrace(PT_CONTINUE, pid, NULL, signal) < 0) { print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid); return false; } @@ -434,7 +434,6 @@ // attach to the process. One and only one exposed stuff struct ps_prochandle* Pgrab(pid_t pid) { struct ps_prochandle* ph = NULL; - thread_info* thr = NULL; if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) { print_debug("can't allocate memory for ps_prochandle\n");
--- a/hotspot/make/hotspot_version Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/make/hotspot_version Fri Nov 08 17:39:39 2013 -0800 @@ -35,7 +35,7 @@ HS_MAJOR_VER=25 HS_MINOR_VER=0 -HS_BUILD_NUMBER=56 +HS_BUILD_NUMBER=58 JDK_MAJOR_VER=1 JDK_MINOR_VER=8
--- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -365,7 +365,7 @@ return entry; } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { // make it look good in the debugger return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation) + frame::pc_return_offset; }
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -3526,8 +3526,12 @@ delayed()->sub(Rtsp, Roffset, Rtsp); // Bang down shadow pages too. - // The -1 because we already subtracted 1 page. - for (int i = 0; i< StackShadowPages-1; i++) { + // At this point, (tmp-0) is the last address touched, so don't + // touch it again. (It was touched as (tmp-pagesize) but then tmp + // was post-decremented.) Skip this address by starting at i=1, and + // touch a few more pages below. N.B. It is important to touch all + // the way down to and including i=StackShadowPages. + for (int i = 1; i <= StackShadowPages; i++) { set((-i*offset)+STACK_BIAS, Rscratch); st(G0, Rtsp, Rscratch); } @@ -4099,15 +4103,19 @@ void MacroAssembler::encode_klass_not_null(Register r) { assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - assert(r != G6_heapbase, "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - sub(r, G6_heapbase, r); - if (Universe::narrow_klass_shift() != 0) { - assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); - srlx(r, LogKlassAlignmentInBytes, r); + if (Universe::narrow_klass_base() != NULL) { + assert(r != G6_heapbase, "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + sub(r, G6_heapbase, r); + if (Universe::narrow_klass_shift() != 0) { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); + srlx(r, LogKlassAlignmentInBytes, r); + } + reinit_heapbase(); + } else { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + srlx(r, Universe::narrow_klass_shift(), r); } - reinit_heapbase(); } void MacroAssembler::encode_klass_not_null(Register src, Register dst) { @@ -4115,11 +4123,16 @@ encode_klass_not_null(src); } else { assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - set((intptr_t)Universe::narrow_klass_base(), dst); - sub(src, dst, dst); - if (Universe::narrow_klass_shift() != 0) { - srlx(dst, LogKlassAlignmentInBytes, dst); + if (Universe::narrow_klass_base() != NULL) { + set((intptr_t)Universe::narrow_klass_base(), dst); + sub(src, dst, dst); + if (Universe::narrow_klass_shift() != 0) { + srlx(dst, LogKlassAlignmentInBytes, dst); + } + } else { + // shift src into dst + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + srlx(src, Universe::narrow_klass_shift(), dst); } } } @@ -4129,14 +4142,16 @@ // the instructions they generate change, then this method needs to be updated. int MacroAssembler::instr_size_for_decode_klass_not_null() { assert (UseCompressedClassPointers, "only for compressed klass ptrs"); - // set + add + set - int num_instrs = insts_for_internal_set((intptr_t)Universe::narrow_klass_base()) + 1 + - insts_for_internal_set((intptr_t)Universe::narrow_ptrs_base()); - if (Universe::narrow_klass_shift() == 0) { - return num_instrs * BytesPerInstWord; - } else { // sllx - return (num_instrs + 1) * BytesPerInstWord; + int num_instrs = 1; // shift src,dst or add + if (Universe::narrow_klass_base() != NULL) { + // set + add + set + num_instrs += insts_for_internal_set((intptr_t)Universe::narrow_klass_base()) + + insts_for_internal_set((intptr_t)Universe::narrow_ptrs_base()); + if (Universe::narrow_klass_shift() != 0) { + num_instrs += 1; // sllx + } } + return num_instrs * BytesPerInstWord; } // !!! If the instructions that get generated here change then function @@ -4145,13 +4160,17 @@ // Do not add assert code to this unless you change vtableStubs_sparc.cpp // pd_code_size_limit. assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - assert(r != G6_heapbase, "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - if (Universe::narrow_klass_shift() != 0) - sllx(r, LogKlassAlignmentInBytes, r); - add(r, G6_heapbase, r); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + assert(r != G6_heapbase, "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + if (Universe::narrow_klass_shift() != 0) + sllx(r, LogKlassAlignmentInBytes, r); + add(r, G6_heapbase, r); + reinit_heapbase(); + } else { + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + sllx(r, Universe::narrow_klass_shift(), r); + } } void MacroAssembler::decode_klass_not_null(Register src, Register dst) { @@ -4161,16 +4180,21 @@ // Do not add assert code to this unless you change vtableStubs_sparc.cpp // pd_code_size_limit. assert (UseCompressedClassPointers, "must be compressed"); - assert(Universe::narrow_klass_base() != NULL, "narrow_klass_base should be initialized"); - if (Universe::narrow_klass_shift() != 0) { - assert((src != G6_heapbase) && (dst != G6_heapbase), "bad register choice"); - set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); - sllx(src, LogKlassAlignmentInBytes, dst); - add(dst, G6_heapbase, dst); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + if (Universe::narrow_klass_shift() != 0) { + assert((src != G6_heapbase) && (dst != G6_heapbase), "bad register choice"); + set((intptr_t)Universe::narrow_klass_base(), G6_heapbase); + sllx(src, LogKlassAlignmentInBytes, dst); + add(dst, G6_heapbase, dst); + reinit_heapbase(); + } else { + set((intptr_t)Universe::narrow_klass_base(), dst); + add(src, dst, dst); + } } else { - set((intptr_t)Universe::narrow_klass_base(), dst); - add(src, dst, dst); + // shift/mov src into dst. + assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift() || Universe::narrow_klass_shift() == 0, "decode alg wrong"); + sllx(src, Universe::narrow_klass_shift(), dst); } } }
--- a/hotspot/src/cpu/sparc/vm/sparc.ad Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/sparc/vm/sparc.ad Fri Nov 08 17:39:39 2013 -0800 @@ -1660,12 +1660,16 @@ if (UseCompressedClassPointers) { assert(Universe::heap() != NULL, "java heap should be initialized"); st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass"); - st->print_cr("\tSET Universe::narrow_klass_base,R_G6_heap_base"); - if (Universe::narrow_klass_shift() != 0) { - st->print_cr("\tSLL R_G5,3,R_G5"); + if (Universe::narrow_klass_base() != 0) { + st->print_cr("\tSET Universe::narrow_klass_base,R_G6_heap_base"); + if (Universe::narrow_klass_shift() != 0) { + st->print_cr("\tSLL R_G5,Universe::narrow_klass_shift,R_G5"); + } + st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5"); + st->print_cr("\tSET Universe::narrow_ptrs_base,R_G6_heap_base"); + } else { + st->print_cr("\tSLL R_G5,Universe::narrow_klass_shift,R_G5"); } - st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5"); - st->print_cr("\tSET Universe::narrow_ptrs_base,R_G6_heap_base"); } else { st->print_cr("\tLDX [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check"); } @@ -2912,6 +2916,9 @@ __ bind(LSkip2); } + // We have no guarantee that on 64 bit the higher half of limit_reg is 0 + __ signx(limit_reg); + __ subcc(limit_reg, 1 * sizeof(jchar), chr1_reg); __ br(Assembler::equal, true, Assembler::pn, Ldone); __ delayed()->mov(O7, result_reg); // result is difference in lengths @@ -2969,6 +2976,9 @@ Register chr1_reg = result_reg; Register chr2_reg = tmp1_reg; + // We have no guarantee that on 64 bit the higher half of limit_reg is 0 + __ signx(limit_reg); + //check for alignment and position the pointers to the ends __ or3(str1_reg, str2_reg, chr1_reg); __ andcc(chr1_reg, 0x3, chr1_reg);
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -153,13 +153,9 @@ } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { - TosState incoming_state = state; +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { + address entry = __ pc(); - Label cont; - address compiled_entry = __ pc(); - - address entry = __ pc(); #if !defined(_LP64) && defined(COMPILER2) // All return values are where we want them, except for Longs. C2 returns // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. @@ -170,14 +166,12 @@ // do this here. Unfortunately if we did a rethrow we'd see an machepilog node // first which would move g1 -> O0/O1 and destroy the exception we were throwing. - if (incoming_state == ltos) { + if (state == ltos) { __ srl (G1, 0, O1); __ srlx(G1, 32, O0); } #endif // !_LP64 && COMPILER2 - __ bind(cont); - // The callee returns with the stack possibly adjusted by adapter transition // We remove that possible adjustment here. // All interpreter local registers are untouched. Any result is passed back @@ -186,29 +180,18 @@ __ mov(Llast_SP, SP); // Remove any adapter added stack space. - Label L_got_cache, L_giant_index; const Register cache = G3_scratch; - const Register size = G1_scratch; - if (EnableInvokeDynamic) { - __ ldub(Address(Lbcp, 0), G1_scratch); // Load current bytecode. - __ cmp_and_br_short(G1_scratch, Bytecodes::_invokedynamic, Assembler::equal, Assembler::pn, L_giant_index); - } - __ get_cache_and_index_at_bcp(cache, G1_scratch, 1); - __ bind(L_got_cache); - __ ld_ptr(cache, ConstantPoolCache::base_offset() + - ConstantPoolCacheEntry::flags_offset(), size); - __ and3(size, 0xFF, size); // argument size in words - __ sll(size, Interpreter::logStackElementSize, size); // each argument size in bytes - __ add(Lesp, size, Lesp); // pop arguments + const Register index = G1_scratch; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); + + const Register flags = cache; + __ ld_ptr(cache, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset(), flags); + const Register parameter_size = flags; + __ and3(flags, ConstantPoolCacheEntry::parameter_size_mask, parameter_size); // argument size in words + __ sll(parameter_size, Interpreter::logStackElementSize, parameter_size); // each argument size in bytes + __ add(Lesp, parameter_size, Lesp); // pop arguments __ dispatch_next(state, step); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(cache, G1_scratch, 1, sizeof(u4)); - __ ba_short(L_got_cache); - } - return entry; }
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -2932,9 +2932,7 @@ ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); AddressLiteral table(table_addr); __ set(table, temp); __ sll(ra, LogBytesPerWord, ra); @@ -2984,7 +2982,7 @@ __ verify_oop(O0_recv); // get return address - AddressLiteral table(Interpreter::return_3_addrs_by_index_table()); + AddressLiteral table(Interpreter::invoke_return_entry_table()); __ set(table, Rtemp); __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type // Make sure we don't need to mask Rret after the above shift @@ -3026,7 +3024,7 @@ __ profile_final_call(O4); // get return address - AddressLiteral table(Interpreter::return_3_addrs_by_index_table()); + AddressLiteral table(Interpreter::invoke_return_entry_table()); __ set(table, Rtemp); __ srl(Rret, ConstantPoolCacheEntry::tos_state_shift, Rret); // get return type // Make sure we don't need to mask Rret after the above shift
--- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -1468,19 +1468,18 @@ addr = new LIR_Address(src.result(), offset, type); } - if (data != dst) { - __ move(data, dst); - data = dst; - } + // Because we want a 2-arg form of xchg and xadd + __ move(data, dst); + if (x->is_add()) { - __ xadd(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); + __ xadd(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); } else { if (is_obj) { // Do the pre-write barrier, if any. pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */, true /* do_load */, false /* patch */, NULL); } - __ xchg(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr); + __ xchg(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr); if (is_obj) { // Seems to be a precise address post_barrier(LIR_OprFact::address(addr), data);
--- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -367,7 +367,7 @@ return entry; } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { // make it look good in the debugger return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation); }
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -196,7 +196,7 @@ void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) { assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode"); - movl(reg, Address(rsi, bcp_offset)); + load_unsigned_short(reg, Address(rsi, bcp_offset)); bswapl(reg); shrl(reg, 16); }
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -192,7 +192,7 @@ Register reg, int bcp_offset) { assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode"); - movl(reg, Address(r13, bcp_offset)); + load_unsigned_short(reg, Address(r13, bcp_offset)); bswapl(reg); shrl(reg, 16); }
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -1381,8 +1381,12 @@ jcc(Assembler::greater, loop); // Bang down shadow pages too. - // The -1 because we already subtracted 1 page. - for (int i = 0; i< StackShadowPages-1; i++) { + // At this point, (tmp-0) is the last address touched, so don't + // touch it again. (It was touched as (tmp-pagesize) but then tmp + // was post-decremented.) Skip this address by starting at i=1, and + // touch a few more pages below. N.B. It is important to touch all + // the way down to and including i=StackShadowPages. + for (int i = 1; i <= StackShadowPages; i++) { // this could be any sized move but this is can be a debugging crumb // so the bigger the better. movptr(Address(tmp, (-i*os::vm_page_size())), size ); @@ -5049,25 +5053,32 @@ } void MacroAssembler::encode_klass_not_null(Register r) { - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); - // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. - assert(r != r12_heapbase, "Encoding a klass in r12"); - mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); - subq(r, r12_heapbase); + if (Universe::narrow_klass_base() != NULL) { + // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. + assert(r != r12_heapbase, "Encoding a klass in r12"); + mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); + subq(r, r12_heapbase); + } if (Universe::narrow_klass_shift() != 0) { assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); shrq(r, LogKlassAlignmentInBytes); } - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + reinit_heapbase(); + } } void MacroAssembler::encode_klass_not_null(Register dst, Register src) { if (dst == src) { encode_klass_not_null(src); } else { - mov64(dst, (int64_t)Universe::narrow_klass_base()); - negq(dst); - addq(dst, src); + if (Universe::narrow_klass_base() != NULL) { + mov64(dst, (int64_t)Universe::narrow_klass_base()); + negq(dst); + addq(dst, src); + } else { + movptr(dst, src); + } if (Universe::narrow_klass_shift() != 0) { assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong"); shrq(dst, LogKlassAlignmentInBytes); @@ -5081,15 +5092,19 @@ // generate change, then this method needs to be updated. int MacroAssembler::instr_size_for_decode_klass_not_null() { assert (UseCompressedClassPointers, "only for compressed klass ptrs"); - // mov64 + addq + shlq? + mov64 (for reinit_heapbase()). - return (Universe::narrow_klass_shift() == 0 ? 20 : 24); + if (Universe::narrow_klass_base() != NULL) { + // mov64 + addq + shlq? + mov64 (for reinit_heapbase()). + return (Universe::narrow_klass_shift() == 0 ? 20 : 24); + } else { + // longest load decode klass function, mov64, leaq + return 16; + } } // !!! If the instructions that get generated here change then function // instr_size_for_decode_klass_not_null() needs to get updated. void MacroAssembler::decode_klass_not_null(Register r) { // Note: it will change flags - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); assert (UseCompressedClassPointers, "should only be used for compressed headers"); assert(r != r12_heapbase, "Decoding a klass in r12"); // Cannot assert, unverified entry point counts instructions (see .ad file) @@ -5100,14 +5115,15 @@ shlq(r, LogKlassAlignmentInBytes); } // Use r12 as a scratch register in which to temporarily load the narrow_klass_base. - mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); - addq(r, r12_heapbase); - reinit_heapbase(); + if (Universe::narrow_klass_base() != NULL) { + mov64(r12_heapbase, (int64_t)Universe::narrow_klass_base()); + addq(r, r12_heapbase); + reinit_heapbase(); + } } void MacroAssembler::decode_klass_not_null(Register dst, Register src) { // Note: it will change flags - assert(Universe::narrow_klass_base() != NULL, "Base should be initialized"); assert (UseCompressedClassPointers, "should only be used for compressed headers"); if (dst == src) { decode_klass_not_null(dst); @@ -5115,7 +5131,6 @@ // Cannot assert, unverified entry point counts instructions (see .ad file) // vtableStubs also counts instructions in pd_code_size_limit. // Also do not verify_oop as this is called by verify_oop. - mov64(dst, (int64_t)Universe::narrow_klass_base()); if (Universe::narrow_klass_shift() != 0) { assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -150,13 +150,12 @@ } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { - TosState incoming_state = state; +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); #ifdef COMPILER2 // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases - if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) { + if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) { for (int i = 1; i < 8; i++) { __ ffree(i); } @@ -164,7 +163,7 @@ __ empty_FPU_stack(); } #endif - if ((incoming_state == ftos && UseSSE < 1) || (incoming_state == dtos && UseSSE < 2)) { + if ((state == ftos && UseSSE < 1) || (state == dtos && UseSSE < 2)) { __ MacroAssembler::verify_FPU(1, "generate_return_entry_for compiled"); } else { __ MacroAssembler::verify_FPU(0, "generate_return_entry_for compiled"); @@ -172,12 +171,12 @@ // In SSE mode, interpreter returns FP results in xmm0 but they need // to end up back on the FPU so it can operate on them. - if (incoming_state == ftos && UseSSE >= 1) { + if (state == ftos && UseSSE >= 1) { __ subptr(rsp, wordSize); __ movflt(Address(rsp, 0), xmm0); __ fld_s(Address(rsp, 0)); __ addptr(rsp, wordSize); - } else if (incoming_state == dtos && UseSSE >= 2) { + } else if (state == dtos && UseSSE >= 2) { __ subptr(rsp, 2*wordSize); __ movdbl(Address(rsp, 0), xmm0); __ fld_d(Address(rsp, 0)); @@ -194,33 +193,22 @@ __ restore_bcp(); __ restore_locals(); - if (incoming_state == atos) { + if (state == atos) { Register mdp = rbx; Register tmp = rcx; __ profile_return_type(mdp, rax, tmp); } - Label L_got_cache, L_giant_index; - if (EnableInvokeDynamic) { - __ cmpb(Address(rsi, 0), Bytecodes::_invokedynamic); - __ jcc(Assembler::equal, L_giant_index); - } - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); - __ bind(L_got_cache); - __ movl(rbx, Address(rbx, rcx, - Address::times_ptr, ConstantPoolCache::base_offset() + - ConstantPoolCacheEntry::flags_offset())); - __ andptr(rbx, 0xFF); - __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); + const Register cache = rbx; + const Register index = rcx; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); + + const Register flags = cache; + __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); + __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); + __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); __ dispatch_next(state, step); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4)); - __ jmp(L_got_cache); - } - return entry; }
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -166,7 +166,7 @@ } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { address entry = __ pc(); // Restore stack bottom in case i2c adjusted stack @@ -183,28 +183,16 @@ __ profile_return_type(mdp, rax, tmp); } - Label L_got_cache, L_giant_index; - if (EnableInvokeDynamic) { - __ cmpb(Address(r13, 0), Bytecodes::_invokedynamic); - __ jcc(Assembler::equal, L_giant_index); - } - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); - __ bind(L_got_cache); - __ movl(rbx, Address(rbx, rcx, - Address::times_ptr, - in_bytes(ConstantPoolCache::base_offset()) + - 3 * wordSize)); - __ andl(rbx, 0xFF); - __ lea(rsp, Address(rsp, rbx, Address::times_8)); + const Register cache = rbx; + const Register index = rcx; + __ get_cache_and_index_at_bcp(cache, index, 1, index_size); + + const Register flags = cache; + __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); + __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); + __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); __ dispatch_next(state, step); - // out of the main line of code... - if (EnableInvokeDynamic) { - __ bind(L_giant_index); - __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4)); - __ jmp(L_got_cache); - } - return entry; }
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -558,7 +558,7 @@ void TemplateTable::locals_index_wide(Register reg) { - __ movl(reg, at_bcp(2)); + __ load_unsigned_short(reg, at_bcp(2)); __ bswapl(reg); __ shrl(reg, 16); __ negptr(reg); @@ -1552,7 +1552,11 @@ InvocationCounter::counter_offset(); // Load up EDX with the branch displacement - __ movl(rdx, at_bcp(1)); + if (is_wide) { + __ movl(rdx, at_bcp(1)); + } else { + __ load_signed_short(rdx, at_bcp(1)); + } __ bswapl(rdx); if (!is_wide) __ sarl(rdx, 16); LP64_ONLY(__ movslq(rdx, rdx)); @@ -2925,9 +2929,7 @@ ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); ExternalAddress table(table_addr); __ movptr(flags, ArrayAddress(table, Address(noreg, flags, Address::times_ptr))); }
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -568,7 +568,7 @@ } void TemplateTable::locals_index_wide(Register reg) { - __ movl(reg, at_bcp(2)); + __ load_unsigned_short(reg, at_bcp(2)); __ bswapl(reg); __ shrl(reg, 16); __ negptr(reg); @@ -1575,7 +1575,11 @@ InvocationCounter::counter_offset(); // Load up edx with the branch displacement - __ movl(rdx, at_bcp(1)); + if (is_wide) { + __ movl(rdx, at_bcp(1)); + } else { + __ load_signed_short(rdx, at_bcp(1)); + } __ bswapl(rdx); if (!is_wide) { @@ -2980,9 +2984,7 @@ ConstantPoolCacheEntry::verify_tos_state_shift(); // load return address { - const address table_addr = (is_invokeinterface || is_invokedynamic) ? - (address)Interpreter::return_5_addrs_by_index_table() : - (address)Interpreter::return_3_addrs_by_index_table(); + const address table_addr = (address) Interpreter::invoke_return_entry_table_for(code); ExternalAddress table(table_addr); __ lea(rscratch1, table); __ movptr(flags, Address(rscratch1, flags, Address::times_ptr));
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -1006,7 +1006,7 @@ istate->set_stack_limit(stack_base - method->max_stack() - 1); } -address CppInterpreter::return_entry(TosState state, int length) { +address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotCallThis(); return NULL; }
--- a/hotspot/src/cpu/zero/vm/globals_zero.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -57,6 +57,8 @@ // GC Ergo Flags define_pd_global(uintx, CMSYoungGenPerWorker, 16*M); // default max size of CMS young gen, per GC worker thread +define_pd_global(uintx, TypeProfileLevel, 0); + #define ARCH_FLAGS(develop, product, diagnostic, experimental, notproduct) #endif // CPU_ZERO_VM_GLOBALS_ZERO_HPP
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -945,17 +945,15 @@ // Used by VMSelfDestructTimer and the MemProfiler. double os::elapsedTime() { - return (double)(os::elapsed_counter()) * 0.000001; + return ((double)os::elapsed_counter()) / os::elapsed_frequency(); } jlong os::elapsed_counter() { - timeval time; - int status = gettimeofday(&time, NULL); - return jlong(time.tv_sec) * 1000 * 1000 + jlong(time.tv_usec) - initial_time_count; + return javaTimeNanos() - initial_time_count; } jlong os::elapsed_frequency() { - return (1000 * 1000); + return NANOSECS_PER_SEC; // nanosecond resolution } bool os::supports_vtime() { return true; } @@ -3582,7 +3580,7 @@ Bsd::_main_thread = pthread_self(); Bsd::clock_init(); - initial_time_count = os::elapsed_counter(); + initial_time_count = javaTimeNanos(); #ifdef __APPLE__ // XXXDARWIN
--- a/hotspot/src/os/linux/vm/os_linux.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/os/linux/vm/os_linux.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -1333,17 +1333,15 @@ // Used by VMSelfDestructTimer and the MemProfiler. double os::elapsedTime() { - return (double)(os::elapsed_counter()) * 0.000001; + return ((double)os::elapsed_counter()) / os::elapsed_frequency(); // nanosecond resolution } jlong os::elapsed_counter() { - timeval time; - int status = gettimeofday(&time, NULL); - return jlong(time.tv_sec) * 1000 * 1000 + jlong(time.tv_usec) - initial_time_count; + return javaTimeNanos() - initial_time_count; } jlong os::elapsed_frequency() { - return (1000 * 1000); + return NANOSECS_PER_SEC; // nanosecond resolution } bool os::supports_vtime() { return true; } @@ -4750,7 +4748,7 @@ Linux::_main_thread = pthread_self(); Linux::clock_init(); - initial_time_count = os::elapsed_counter(); + initial_time_count = javaTimeNanos(); // pthread_condattr initialization for monotonic clock int status;
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -79,6 +79,15 @@ # include <pthread_np.h> #endif +// needed by current_stack_region() workaround for Mavericks +#if defined(__APPLE__) +# include <errno.h> +# include <sys/types.h> +# include <sys/sysctl.h> +# define DEFAULT_MAIN_THREAD_STACK_PAGES 2048 +# define OS_X_10_9_0_KERNEL_MAJOR_VERSION 13 +#endif + #ifdef AMD64 #define SPELL_REG_SP "rsp" #define SPELL_REG_FP "rbp" @@ -828,6 +837,21 @@ pthread_t self = pthread_self(); void *stacktop = pthread_get_stackaddr_np(self); *size = pthread_get_stacksize_np(self); + // workaround for OS X 10.9.0 (Mavericks) + // pthread_get_stacksize_np returns 128 pages even though the actual size is 2048 pages + if (pthread_main_np() == 1) { + if ((*size) < (DEFAULT_MAIN_THREAD_STACK_PAGES * (size_t)getpagesize())) { + char kern_osrelease[256]; + size_t kern_osrelease_size = sizeof(kern_osrelease); + int ret = sysctlbyname("kern.osrelease", kern_osrelease, &kern_osrelease_size, NULL, 0); + if (ret == 0) { + // get the major number, atoi will ignore the minor amd micro portions of the version string + if (atoi(kern_osrelease) >= OS_X_10_9_0_KERNEL_MAJOR_VERSION) { + *size = (DEFAULT_MAIN_THREAD_STACK_PAGES*getpagesize()); + } + } + } + } *bottom = (address) stacktop - *size; #elif defined(__OpenBSD__) stack_t ss;
--- a/hotspot/src/share/vm/asm/assembler.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/asm/assembler.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -122,7 +122,7 @@ void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) { if (UseStackBanging) { // Each code entry causes one stack bang n pages down the stack where n - // is configurable by StackBangPages. The setting depends on the maximum + // is configurable by StackShadowPages. The setting depends on the maximum // depth of VM call stack or native before going back into java code, // since only java code can raise a stack overflow exception using the // stack banging mechanism. The VM and native code does not detect stack
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -1873,7 +1873,7 @@ // number of implementors for decl_interface is 0 or 1. If // it's 0 then no class implements decl_interface and there's // no point in inlining. - if (!holder->is_loaded() || decl_interface->nof_implementors() != 1) { + if (!holder->is_loaded() || decl_interface->nof_implementors() != 1 || decl_interface->has_default_methods()) { singleton = NULL; } }
--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -1138,8 +1138,10 @@ } } } - - } else if (opr_type != T_LONG) { + // We want to sometimes use logical operations on pointers, in particular in GC barriers. + // Since 64bit logical operations do not current support operands on stack, we have to make sure + // T_OBJECT doesn't get spilled along with T_LONG. + } else if (opr_type != T_LONG LP64_ONLY(&& opr_type != T_OBJECT)) { // integer instruction (note: long operands must always be in register) switch (op->code()) { case lir_cmp:
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -57,6 +57,7 @@ _init_state = ik->init_state(); _nonstatic_field_size = ik->nonstatic_field_size(); _has_nonstatic_fields = ik->has_nonstatic_fields(); + _has_default_methods = ik->has_default_methods(); _nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields: _implementor = NULL; // we will fill these lazily
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -52,6 +52,7 @@ bool _has_finalizer; bool _has_subklass; bool _has_nonstatic_fields; + bool _has_default_methods; ciFlags _flags; jint _nonstatic_field_size; @@ -171,6 +172,11 @@ } } + bool has_default_methods() { + assert(is_loaded(), "must be loaded"); + return _has_default_methods; + } + ciInstanceKlass* get_canonical_holder(int offset); ciField* get_field_by_offset(int field_offset, bool is_static); ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static);
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -131,6 +131,17 @@ } } +void ClassLoaderData::loaded_classes_do(KlassClosure* klass_closure) { + // Lock to avoid classes being modified/added/removed during iteration + MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag); + for (Klass* k = _klasses; k != NULL; k = k->next_link()) { + // Do not filter ArrayKlass oops here... + if (k->oop_is_array() || (k->oop_is_instance() && InstanceKlass::cast(k)->is_loaded())) { + klass_closure->do_klass(k); + } + } +} + void ClassLoaderData::classes_do(void f(InstanceKlass*)) { for (Klass* k = _klasses; k != NULL; k = k->next_link()) { if (k->oop_is_instance()) { @@ -600,6 +611,12 @@ } } +void ClassLoaderDataGraph::loaded_classes_do(KlassClosure* klass_closure) { + for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) { + cld->loaded_classes_do(klass_closure); + } +} + void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) { assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!"); for (ClassLoaderData* cld = _unloading; cld != NULL; cld = cld->next()) {
--- a/hotspot/src/share/vm/classfile/classLoaderData.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -78,6 +78,7 @@ static void keep_alive_oops_do(OopClosure* blk, KlassClosure* klass_closure, bool must_claim); static void classes_do(KlassClosure* klass_closure); static void classes_do(void f(Klass* const)); + static void loaded_classes_do(KlassClosure* klass_closure); static void classes_unloading_do(void f(Klass* const)); static bool do_unloading(BoolObjectClosure* is_alive); @@ -186,6 +187,7 @@ bool keep_alive() const { return _keep_alive; } bool is_alive(BoolObjectClosure* is_alive_closure) const; void classes_do(void f(Klass*)); + void loaded_classes_do(KlassClosure* klass_closure); void classes_do(void f(InstanceKlass*)); // Deallocate free list during class unloading.
--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -392,10 +392,16 @@ } GrowableArray<Method*> qualified_methods; + int num_defaults = 0; + int default_index = -1; for (int i = 0; i < _members.length(); ++i) { Pair<Method*,QualifiedState> entry = _members.at(i); if (entry.second == QUALIFIED) { qualified_methods.append(entry.first); + default_index++; + if (entry.first->is_default_method()) { + num_defaults++; + } } } @@ -408,6 +414,9 @@ if (!method->is_abstract()) { _selected_target = qualified_methods.at(0); } + // If only one qualified method is default, select that + } else if (num_defaults == 1) { + _selected_target = qualified_methods.at(default_index); } else { _exception_message = generate_conflicts_message(&qualified_methods,CHECK); _exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
--- a/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/classfile/metadataOnStackMark.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -27,6 +27,7 @@ #include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "oops/metadata.hpp" +#include "prims/jvmtiImpl.hpp" #include "runtime/synchronizer.hpp" #include "runtime/thread.hpp" #include "utilities/growableArray.hpp" @@ -48,6 +49,7 @@ Threads::metadata_do(Metadata::mark_on_stack); CodeCache::alive_nmethods_do(nmethod::mark_on_stack); CompileBroker::mark_on_stack(); + JvmtiCurrentBreakpoints::metadata_do(Metadata::mark_on_stack); } MetadataOnStackMark::~MetadataOnStackMark() {
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -173,8 +173,6 @@ /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \ \ - do_klass(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt ) \ - \ /* Preload boxing klasses */ \ do_klass(Boolean_klass, java_lang_Boolean, Pre ) \ do_klass(Character_klass, java_lang_Character, Pre ) \
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -780,6 +780,10 @@ void CompileBroker::compilation_init() { _last_method_compiled[0] = '\0'; + // No need to initialize compilation system if we do not use it. + if (!UseCompiler) { + return; + } #ifndef SHARK // Set the interface to the current compiler(s). int c1_count = CompilationPolicy::policy()->compiler_count(CompLevel_simple);
--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -158,8 +158,8 @@ // Runtime support // length = invoke bytecode length (to advance to next bytecode) - static address deopt_entry (TosState state, int length) { ShouldNotReachHere(); return NULL; } - static address return_entry (TosState state, int length) { ShouldNotReachHere(); return NULL; } + static address deopt_entry(TosState state, int length) { ShouldNotReachHere(); return NULL; } + static address return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotReachHere(); return NULL; } static address rethrow_exception_entry() { return _rethrow_exception_entry; }
--- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -78,7 +78,7 @@ static address stack_result_to_stack(int index) { return _stack_to_stack[index]; } static address stack_result_to_native(int index) { return _stack_to_native_abi[index]; } - static address return_entry (TosState state, int length); + static address return_entry (TosState state, int length, Bytecodes::Code code); static address deopt_entry (TosState state, int length); #ifdef TARGET_ARCH_x86
--- a/hotspot/src/share/vm/interpreter/interpreter.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -329,15 +329,21 @@ //------------------------------------------------------------------------------------------------------------------------ // Deoptimization support -// If deoptimization happens, this function returns the point of next bytecode to continue execution +/** + * If a deoptimization happens, this function returns the point of next bytecode to continue execution. + */ address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { assert(method->contains(bcp), "just checkin'"); - Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); + + // Get the original and rewritten bytecode. + Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); - int bci = method->bci_from(bcp); - int length = -1; // initial value for debugging + + const int bci = method->bci_from(bcp); + // compute continuation length - length = Bytecodes::length_at(method, bcp); + const int length = Bytecodes::length_at(method, bcp); + // compute result type BasicType type = T_ILLEGAL; @@ -393,7 +399,7 @@ return is_top_frame ? Interpreter::deopt_entry (as_TosState(type), length) - : Interpreter::return_entry(as_TosState(type), length); + : Interpreter::return_entry(as_TosState(type), length, code); } // If deoptimization happens, this function returns the point where the interpreter reexecutes
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -184,8 +184,9 @@ EntryPoint TemplateInterpreter::_continuation_entry; EntryPoint TemplateInterpreter::_safept_entry; -address TemplateInterpreter::_return_3_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; -address TemplateInterpreter::_return_5_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invoke_return_entry[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invokeinterface_return_entry[TemplateInterpreter::number_of_return_addrs]; +address TemplateInterpreter::_invokedynamic_return_entry[TemplateInterpreter::number_of_return_addrs]; DispatchTable TemplateInterpreter::_active_table; DispatchTable TemplateInterpreter::_normal_table; @@ -237,22 +238,37 @@ #endif // !PRODUCT { CodeletMark cm(_masm, "return entry points"); + const int index_size = sizeof(u2); for (int i = 0; i < Interpreter::number_of_return_entries; i++) { Interpreter::_return_entry[i] = EntryPoint( - generate_return_entry_for(itos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(atos, i), - generate_return_entry_for(itos, i), - generate_return_entry_for(ltos, i), - generate_return_entry_for(ftos, i), - generate_return_entry_for(dtos, i), - generate_return_entry_for(vtos, i) + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(atos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(ltos, i, index_size), + generate_return_entry_for(ftos, i, index_size), + generate_return_entry_for(dtos, i, index_size), + generate_return_entry_for(vtos, i, index_size) ); } } + { CodeletMark cm(_masm, "invoke return entry points"); + const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos}; + const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic); + const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface); + const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic); + + for (int i = 0; i < Interpreter::number_of_return_addrs; i++) { + TosState state = states[i]; + Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2)); + Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2)); + Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4)); + } + } + { CodeletMark cm(_masm, "earlyret entry points"); Interpreter::_earlyret_entry = EntryPoint( @@ -298,13 +314,6 @@ } } - for (int j = 0; j < number_of_states; j++) { - const TosState states[] = {btos, ctos, stos, itos, ltos, ftos, dtos, atos, vtos}; - int index = Interpreter::TosState_as_index(states[j]); - Interpreter::_return_3_addrs_by_index[index] = Interpreter::return_entry(states[j], 3); - Interpreter::_return_5_addrs_by_index[index] = Interpreter::return_entry(states[j], 5); - } - { CodeletMark cm(_masm, "continuation entry points"); Interpreter::_continuation_entry = EntryPoint( @@ -534,9 +543,46 @@ //------------------------------------------------------------------------------------------------------------------------ // Entry points -address TemplateInterpreter::return_entry(TosState state, int length) { +/** + * Returns the return entry table for the given invoke bytecode. + */ +address* TemplateInterpreter::invoke_return_entry_table_for(Bytecodes::Code code) { + switch (code) { + case Bytecodes::_invokestatic: + case Bytecodes::_invokespecial: + case Bytecodes::_invokevirtual: + case Bytecodes::_invokehandle: + return Interpreter::invoke_return_entry_table(); + case Bytecodes::_invokeinterface: + return Interpreter::invokeinterface_return_entry_table(); + case Bytecodes::_invokedynamic: + return Interpreter::invokedynamic_return_entry_table(); + default: + fatal(err_msg("invalid bytecode: %s", Bytecodes::name(code))); + return NULL; + } +} + +/** + * Returns the return entry address for the given top-of-stack state and bytecode. + */ +address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { guarantee(0 <= length && length < Interpreter::number_of_return_entries, "illegal length"); - return _return_entry[length].entry(state); + const int index = TosState_as_index(state); + switch (code) { + case Bytecodes::_invokestatic: + case Bytecodes::_invokespecial: + case Bytecodes::_invokevirtual: + case Bytecodes::_invokehandle: + return _invoke_return_entry[index]; + case Bytecodes::_invokeinterface: + return _invokeinterface_return_entry[index]; + case Bytecodes::_invokedynamic: + return _invokedynamic_return_entry[index]; + default: + assert(!Bytecodes::is_invoke(code), err_msg("invoke instructions should be handled separately: %s", Bytecodes::name(code))); + return _return_entry[length].entry(state); + } }
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -120,8 +120,9 @@ static EntryPoint _continuation_entry; static EntryPoint _safept_entry; - static address _return_3_addrs_by_index[number_of_return_addrs]; // for invokevirtual return entries - static address _return_5_addrs_by_index[number_of_return_addrs]; // for invokeinterface return entries + static address _invoke_return_entry[number_of_return_addrs]; // for invokestatic, invokespecial, invokevirtual return entries + static address _invokeinterface_return_entry[number_of_return_addrs]; // for invokeinterface return entries + static address _invokedynamic_return_entry[number_of_return_addrs]; // for invokedynamic return entries static DispatchTable _active_table; // the active dispatch table (used by the interpreter for dispatch) static DispatchTable _normal_table; // the normal dispatch table (used to set the active table in normal mode) @@ -161,12 +162,15 @@ static address* normal_table() { return _normal_table.table_for(); } // Support for invokes - static address* return_3_addrs_by_index_table() { return _return_3_addrs_by_index; } - static address* return_5_addrs_by_index_table() { return _return_5_addrs_by_index; } - static int TosState_as_index(TosState state); // computes index into return_3_entry_by_index table + static address* invoke_return_entry_table() { return _invoke_return_entry; } + static address* invokeinterface_return_entry_table() { return _invokeinterface_return_entry; } + static address* invokedynamic_return_entry_table() { return _invokedynamic_return_entry; } + static int TosState_as_index(TosState state); - static address return_entry (TosState state, int length); - static address deopt_entry (TosState state, int length); + static address* invoke_return_entry_table_for(Bytecodes::Code code); + + static address deopt_entry(TosState state, int length); + static address return_entry(TosState state, int length, Bytecodes::Code code); // Safepoint support static void notice_safepoints(); // stops the thread when reaching a safepoint
--- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -53,7 +53,7 @@ address generate_ClassCastException_handler(); address generate_ArrayIndexOutOfBounds_handler(const char* name); address generate_continuation_for(TosState state); - address generate_return_entry_for(TosState state, int step); + address generate_return_entry_for(TosState state, int step, size_t index_size); address generate_earlyret_entry_for(TosState state); address generate_deopt_entry_for(TosState state, int step); address generate_safept_entry_for(TosState state, address runtime_entry);
--- a/hotspot/src/share/vm/memory/metaspace.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/memory/metaspace.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -56,7 +56,7 @@ MetaWord* last_allocated = 0; -size_t Metaspace::_class_metaspace_size; +size_t Metaspace::_compressed_class_space_size; // Used in declarations in SpaceManager and ChunkManager enum ChunkIndex { @@ -2843,6 +2843,8 @@ #define VIRTUALSPACEMULTIPLIER 2 #ifdef _LP64 +static const uint64_t UnscaledClassSpaceMax = (uint64_t(max_juint) + 1); + void Metaspace::set_narrow_klass_base_and_shift(address metaspace_base, address cds_base) { // Figure out the narrow_klass_base and the narrow_klass_shift. The // narrow_klass_base is the lower of the metaspace base and the cds base @@ -2852,14 +2854,22 @@ address higher_address; if (UseSharedSpaces) { higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()), - (address)(metaspace_base + class_metaspace_size())); + (address)(metaspace_base + compressed_class_space_size())); lower_base = MIN2(metaspace_base, cds_base); } else { - higher_address = metaspace_base + class_metaspace_size(); + higher_address = metaspace_base + compressed_class_space_size(); lower_base = metaspace_base; + + uint64_t klass_encoding_max = UnscaledClassSpaceMax << LogKlassAlignmentInBytes; + // If compressed class space fits in lower 32G, we don't need a base. + if (higher_address <= (address)klass_encoding_max) { + lower_base = 0; // effectively lower base is zero. + } } + Universe::set_narrow_klass_base(lower_base); - if ((uint64_t)(higher_address - lower_base) < (uint64_t)max_juint) { + + if ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax) { Universe::set_narrow_klass_shift(0); } else { assert(!UseSharedSpaces, "Cannot shift with UseSharedSpaces"); @@ -2874,24 +2884,24 @@ assert(UseCompressedClassPointers, "Only use with CompressedKlassPtrs"); address lower_base = MIN2((address)metaspace_base, cds_base); address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()), - (address)(metaspace_base + class_metaspace_size())); - return ((uint64_t)(higher_address - lower_base) < (uint64_t)max_juint); + (address)(metaspace_base + compressed_class_space_size())); + return ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax); } // Try to allocate the metaspace at the requested addr. void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, address cds_base) { assert(using_class_space(), "called improperly"); assert(UseCompressedClassPointers, "Only use with CompressedKlassPtrs"); - assert(class_metaspace_size() < KlassEncodingMetaspaceMax, + assert(compressed_class_space_size() < KlassEncodingMetaspaceMax, "Metaspace size is too big"); - assert_is_ptr_aligned(requested_addr, _reserve_alignment); - assert_is_ptr_aligned(cds_base, _reserve_alignment); - assert_is_size_aligned(class_metaspace_size(), _reserve_alignment); + assert_is_ptr_aligned(requested_addr, _reserve_alignment); + assert_is_ptr_aligned(cds_base, _reserve_alignment); + assert_is_size_aligned(compressed_class_space_size(), _reserve_alignment); // Don't use large pages for the class space. bool large_pages = false; - ReservedSpace metaspace_rs = ReservedSpace(class_metaspace_size(), + ReservedSpace metaspace_rs = ReservedSpace(compressed_class_space_size(), _reserve_alignment, large_pages, requested_addr, 0); @@ -2906,7 +2916,7 @@ while (!metaspace_rs.is_reserved() && (addr + increment > addr) && can_use_cds_with_metaspace_addr(addr + increment, cds_base)) { addr = addr + increment; - metaspace_rs = ReservedSpace(class_metaspace_size(), + metaspace_rs = ReservedSpace(compressed_class_space_size(), _reserve_alignment, large_pages, addr, 0); } } @@ -2917,11 +2927,11 @@ // initialization has happened that depends on UseCompressedClassPointers. // So, UseCompressedClassPointers cannot be turned off at this point. if (!metaspace_rs.is_reserved()) { - metaspace_rs = ReservedSpace(class_metaspace_size(), + metaspace_rs = ReservedSpace(compressed_class_space_size(), _reserve_alignment, large_pages); if (!metaspace_rs.is_reserved()) { vm_exit_during_initialization(err_msg("Could not allocate metaspace: %d bytes", - class_metaspace_size())); + compressed_class_space_size())); } } } @@ -2943,8 +2953,8 @@ if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) { gclog_or_tty->print_cr("Narrow klass base: " PTR_FORMAT ", Narrow klass shift: " SIZE_FORMAT, Universe::narrow_klass_base(), Universe::narrow_klass_shift()); - gclog_or_tty->print_cr("Metaspace Size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT, - class_metaspace_size(), metaspace_rs.base(), requested_addr); + gclog_or_tty->print_cr("Compressed class space size: " SIZE_FORMAT " Address: " PTR_FORMAT " Req Addr: " PTR_FORMAT, + compressed_class_space_size(), metaspace_rs.base(), requested_addr); } } @@ -3010,7 +3020,7 @@ MaxMetaspaceExpansion = restricted_align_down(MaxMetaspaceExpansion, _commit_alignment); CompressedClassSpaceSize = restricted_align_down(CompressedClassSpaceSize, _reserve_alignment); - set_class_metaspace_size(CompressedClassSpaceSize); + set_compressed_class_space_size(CompressedClassSpaceSize); } void Metaspace::global_initialize() { @@ -3039,12 +3049,12 @@ } #ifdef _LP64 - if (cds_total + class_metaspace_size() > (uint64_t)max_juint) { + if (cds_total + compressed_class_space_size() > UnscaledClassSpaceMax) { vm_exit_during_initialization("Unable to dump shared archive.", err_msg("Size of archive (" SIZE_FORMAT ") + compressed class space (" SIZE_FORMAT ") == total (" SIZE_FORMAT ") is larger than compressed " - "klass limit: " SIZE_FORMAT, cds_total, class_metaspace_size(), - cds_total + class_metaspace_size(), (size_t)max_juint)); + "klass limit: " SIZE_FORMAT, cds_total, compressed_class_space_size(), + cds_total + compressed_class_space_size(), UnscaledClassSpaceMax)); } // Set the compressed klass pointer base so that decoding of these pointers works @@ -3092,7 +3102,8 @@ cds_end = (char *)align_ptr_up(cds_end, _reserve_alignment); allocate_metaspace_compressed_klass_ptrs(cds_end, cds_address); } else { - allocate_metaspace_compressed_klass_ptrs((char *)CompressedKlassPointersBase, 0); + char* base = (char*)align_ptr_up(Universe::heap()->reserved_region().end(), _reserve_alignment); + allocate_metaspace_compressed_klass_ptrs(base, 0); } } #endif @@ -3354,6 +3365,11 @@ return result; } +size_t Metaspace::class_chunk_size(size_t word_size) { + assert(using_class_space(), "Has to use class space"); + return class_vsm()->calc_chunk_size(word_size); +} + void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_size, MetadataType mdtype, TRAPS) { // If result is still null, we are out of memory. if (Verbose && TraceMetadataChunkAllocation) { @@ -3365,9 +3381,19 @@ MetaspaceAux::dump(gclog_or_tty); } + bool out_of_compressed_class_space = false; + if (is_class_space_allocation(mdtype)) { + Metaspace* metaspace = loader_data->metaspace_non_null(); + out_of_compressed_class_space = + MetaspaceAux::committed_bytes(Metaspace::ClassType) + + (metaspace->class_chunk_size(word_size) * BytesPerWord) > + CompressedClassSpaceSize; + } + // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support - const char* space_string = is_class_space_allocation(mdtype) ? "Compressed class space" : - "Metadata space"; + const char* space_string = out_of_compressed_class_space ? + "Compressed class space" : "Metaspace"; + report_java_out_of_memory(space_string); if (JvmtiExport::should_post_resource_exhausted()) { @@ -3380,7 +3406,7 @@ vm_exit_during_initialization("OutOfMemoryError", space_string); } - if (is_class_space_allocation(mdtype)) { + if (out_of_compressed_class_space) { THROW_OOP(Universe::out_of_memory_error_class_metaspace()); } else { THROW_OOP(Universe::out_of_memory_error_metaspace());
--- a/hotspot/src/share/vm/memory/metaspace.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/memory/metaspace.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -115,13 +115,13 @@ static size_t align_word_size_up(size_t); // Aligned size of the metaspace. - static size_t _class_metaspace_size; + static size_t _compressed_class_space_size; - static size_t class_metaspace_size() { - return _class_metaspace_size; + static size_t compressed_class_space_size() { + return _compressed_class_space_size; } - static void set_class_metaspace_size(size_t metaspace_size) { - _class_metaspace_size = metaspace_size; + static void set_compressed_class_space_size(size_t size) { + _compressed_class_space_size = size; } static size_t _first_chunk_word_size; @@ -192,6 +192,8 @@ AllocRecord * _alloc_record_head; AllocRecord * _alloc_record_tail; + size_t class_chunk_size(size_t word_size); + public: Metaspace(Mutex* lock, MetaspaceType type); @@ -252,6 +254,7 @@ static bool is_class_space_allocation(MetadataType mdType) { return mdType == ClassType && using_class_space(); } + }; class MetaspaceAux : AllStatic {
--- a/hotspot/src/share/vm/memory/universe.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/memory/universe.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -677,13 +677,13 @@ // HeapBased - Use compressed oops with heap base + encoding. // 4Gb -static const uint64_t NarrowOopHeapMax = (uint64_t(max_juint) + 1); +static const uint64_t UnscaledOopHeapMax = (uint64_t(max_juint) + 1); // 32Gb -// OopEncodingHeapMax == NarrowOopHeapMax << LogMinObjAlignmentInBytes; +// OopEncodingHeapMax == UnscaledOopHeapMax << LogMinObjAlignmentInBytes; char* Universe::preferred_heap_base(size_t heap_size, size_t alignment, NARROW_OOP_MODE mode) { assert(is_size_aligned((size_t)OopEncodingHeapMax, alignment), "Must be"); - assert(is_size_aligned((size_t)NarrowOopHeapMax, alignment), "Must be"); + assert(is_size_aligned((size_t)UnscaledOopHeapMax, alignment), "Must be"); assert(is_size_aligned(heap_size, alignment), "Must be"); uintx heap_base_min_address_aligned = align_size_up(HeapBaseMinAddress, alignment); @@ -702,20 +702,40 @@ // If the total size is small enough to allow UnscaledNarrowOop then // just use UnscaledNarrowOop. } else if ((total_size <= OopEncodingHeapMax) && (mode != HeapBasedNarrowOop)) { - if ((total_size <= NarrowOopHeapMax) && (mode == UnscaledNarrowOop) && + if ((total_size <= UnscaledOopHeapMax) && (mode == UnscaledNarrowOop) && (Universe::narrow_oop_shift() == 0)) { // Use 32-bits oops without encoding and // place heap's top on the 4Gb boundary - base = (NarrowOopHeapMax - heap_size); + base = (UnscaledOopHeapMax - heap_size); } else { // Can't reserve with NarrowOopShift == 0 Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes); + if (mode == UnscaledNarrowOop || - mode == ZeroBasedNarrowOop && total_size <= NarrowOopHeapMax) { + mode == ZeroBasedNarrowOop && total_size <= UnscaledOopHeapMax) { + // Use zero based compressed oops with encoding and // place heap's top on the 32Gb boundary in case // total_size > 4Gb or failed to reserve below 4Gb. - base = (OopEncodingHeapMax - heap_size); + uint64_t heap_top = OopEncodingHeapMax; + + // For small heaps, save some space for compressed class pointer + // space so it can be decoded with no base. + if (UseCompressedClassPointers && !UseSharedSpaces && + OopEncodingHeapMax <= 32*G) { + + uint64_t class_space = align_size_up(CompressedClassSpaceSize, alignment); + assert(is_size_aligned((size_t)OopEncodingHeapMax-class_space, + alignment), "difference must be aligned too"); + uint64_t new_top = OopEncodingHeapMax-class_space; + + if (total_size <= new_top) { + heap_top = new_top; + } + } + + // Align base to the adjusted top of the heap + base = heap_top - heap_size; } } } else { @@ -737,7 +757,7 @@ // Set to a non-NULL value so the ReservedSpace ctor computes // the correct no-access prefix. // The final value will be set in initialize_heap() below. - Universe::set_narrow_oop_base((address)NarrowOopHeapMax); + Universe::set_narrow_oop_base((address)UnscaledOopHeapMax); #ifdef _WIN64 if (UseLargePages) { // Cannot allocate guard pages for implicit checks in indexed @@ -833,7 +853,7 @@ Universe::set_narrow_oop_use_implicit_null_checks(true); } #endif // _WIN64 - if((uint64_t)Universe::heap()->reserved_region().end() > NarrowOopHeapMax) { + if((uint64_t)Universe::heap()->reserved_region().end() > UnscaledOopHeapMax) { // Can't reserve heap below 4Gb. Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes); } else { @@ -1029,7 +1049,7 @@ Handle msg = java_lang_String::create_from_str("Java heap space", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_java_heap, msg()); - msg = java_lang_String::create_from_str("Metadata space", CHECK_false); + msg = java_lang_String::create_from_str("Metaspace", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_metaspace, msg()); msg = java_lang_String::create_from_str("Compressed class space", CHECK_false); java_lang_Throwable::set_message(Universe::_out_of_memory_error_class_metaspace, msg());
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -2393,15 +2393,38 @@ const char* InstanceKlass::signature_name() const { + int hash_len = 0; + char hash_buf[40]; + + // If this is an anonymous class, append a hash to make the name unique + if (is_anonymous()) { + assert(EnableInvokeDynamic, "EnableInvokeDynamic was not set."); + intptr_t hash = (java_mirror() != NULL) ? java_mirror()->identity_hash() : 0; + sprintf(hash_buf, "/" UINTX_FORMAT, (uintx)hash); + hash_len = (int)strlen(hash_buf); + } + + // Get the internal name as a c string const char* src = (const char*) (name()->as_C_string()); const int src_length = (int)strlen(src); - char* dest = NEW_RESOURCE_ARRAY(char, src_length + 3); - int src_index = 0; + + char* dest = NEW_RESOURCE_ARRAY(char, src_length + hash_len + 3); + + // Add L as type indicator int dest_index = 0; dest[dest_index++] = 'L'; - while (src_index < src_length) { + + // Add the actual class name + for (int src_index = 0; src_index < src_length; ) { dest[dest_index++] = src[src_index++]; } + + // If we have a hash, append it + for (int hash_index = 0; hash_index < hash_len; ) { + dest[dest_index++] = hash_buf[hash_index++]; + } + + // Add the semicolon and the NULL dest[dest_index++] = ';'; dest[dest_index] = '\0'; return dest;
--- a/hotspot/src/share/vm/oops/method.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/oops/method.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -1515,7 +1515,10 @@ return bp->orig_bytecode(); } } - ShouldNotReachHere(); + { + ResourceMark rm; + fatal(err_msg("no original bytecode found in %s at bci %d", name_and_sig_as_C_string(), bci)); + } return Bytecodes::_shouldnotreachhere; }
--- a/hotspot/src/share/vm/opto/compile.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/opto/compile.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -848,6 +848,7 @@ } #endif + NOT_PRODUCT( verify_barriers(); ) // Now that we know the size of all the monitors we can add a fixed slot // for the original deopt pc. @@ -3018,12 +3019,17 @@ // Phi nodes shouldn't be moved. They would only match below if they // had the same control as the MathExactNode. The only time that // would happen is if the Phi is also an input to the MathExact - if (!out->is_Phi()) { - if (out->in(0) == NULL) { - out->set_req(0, non_throwing); - } else if (out->in(0) == ctrl) { - out->set_req(0, non_throwing); - } + // + // Cmp nodes shouldn't have control set at all. + if (out->is_Phi() || + out->is_Cmp()) { + continue; + } + + if (out->in(0) == NULL) { + out->set_req(0, non_throwing); + } else if (out->in(0) == ctrl) { + out->set_req(0, non_throwing); } } } @@ -3368,6 +3374,72 @@ } } } + +// Verify GC barriers consistency +// Currently supported: +// - G1 pre-barriers (see GraphKit::g1_write_barrier_pre()) +void Compile::verify_barriers() { + if (UseG1GC) { + // Verify G1 pre-barriers + const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_active()); + + ResourceArea *area = Thread::current()->resource_area(); + Unique_Node_List visited(area); + Node_List worklist(area); + // We're going to walk control flow backwards starting from the Root + worklist.push(_root); + while (worklist.size() > 0) { + Node* x = worklist.pop(); + if (x == NULL || x == top()) continue; + if (visited.member(x)) { + continue; + } else { + visited.push(x); + } + + if (x->is_Region()) { + for (uint i = 1; i < x->req(); i++) { + worklist.push(x->in(i)); + } + } else { + worklist.push(x->in(0)); + // We are looking for the pattern: + // /->ThreadLocal + // If->Bool->CmpI->LoadB->AddP->ConL(marking_offset) + // \->ConI(0) + // We want to verify that the If and the LoadB have the same control + // See GraphKit::g1_write_barrier_pre() + if (x->is_If()) { + IfNode *iff = x->as_If(); + if (iff->in(1)->is_Bool() && iff->in(1)->in(1)->is_Cmp()) { + CmpNode *cmp = iff->in(1)->in(1)->as_Cmp(); + if (cmp->Opcode() == Op_CmpI && cmp->in(2)->is_Con() && cmp->in(2)->bottom_type()->is_int()->get_con() == 0 + && cmp->in(1)->is_Load()) { + LoadNode* load = cmp->in(1)->as_Load(); + if (load->Opcode() == Op_LoadB && load->in(2)->is_AddP() && load->in(2)->in(2)->Opcode() == Op_ThreadLocal + && load->in(2)->in(3)->is_Con() + && load->in(2)->in(3)->bottom_type()->is_intptr_t()->get_con() == marking_offset) { + + Node* if_ctrl = iff->in(0); + Node* load_ctrl = load->in(0); + + if (if_ctrl != load_ctrl) { + // Skip possible CProj->NeverBranch in infinite loops + if ((if_ctrl->is_Proj() && if_ctrl->Opcode() == Op_CProj) + && (if_ctrl->in(0)->is_MultiBranch() && if_ctrl->in(0)->Opcode() == Op_NeverBranch)) { + if_ctrl = if_ctrl->in(0)->in(0); + } + } + assert(load_ctrl != NULL && if_ctrl == load_ctrl, "controls must match"); + } + } + } + } + } + } + } +} + #endif // The Compile object keeps track of failure reasons separately from the ciEnv.
--- a/hotspot/src/share/vm/opto/compile.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/opto/compile.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -1148,6 +1148,9 @@ // graph is strongly connected from root in both directions. void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN; + // Verify GC barrier patterns + void verify_barriers() PRODUCT_RETURN; + // End-of-run dumps. static void print_statistics() PRODUCT_RETURN;
--- a/hotspot/src/share/vm/opto/library_call.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/opto/library_call.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -2006,9 +2006,9 @@ Node* arg2 = NULL; if (is_increment) { - arg2 = intcon(1); + arg2 = intcon(1); } else { - arg2 = argument(1); + arg2 = argument(1); } Node* add = _gvn.transform( new(C) AddExactINode(NULL, arg1, arg2) ); @@ -2056,7 +2056,7 @@ if (is_decrement) { arg2 = longcon(1); } else { - Node* arg2 = argument(2); // type long + arg2 = argument(2); // type long // argument(3) == TOP }
--- a/hotspot/src/share/vm/opto/loopTransform.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/opto/loopTransform.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -713,6 +713,10 @@ case Op_ModL: body_size += 30; break; case Op_DivL: body_size += 30; break; case Op_MulL: body_size += 10; break; + case Op_FlagsProj: + // Can't handle unrolling of loops containing + // nodes that generate a FlagsProj at the moment + return false; case Op_StrComp: case Op_StrEquals: case Op_StrIndexOf: @@ -1960,7 +1964,7 @@ // Find loads off the surviving projection; remove their control edge for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) { Node* cd = dp->fast_out(i); // Control-dependent node - if( cd->is_Load() ) { // Loads can now float around in the loop + if (cd->is_Load() && cd->depends_only_on_test()) { // Loads can now float around in the loop // Allow the load to float around in the loop, or before it // but NOT before the pre-loop. _igvn.replace_input_of(cd, 0, ctrl); // ctrl, not NULL
--- a/hotspot/src/share/vm/opto/memnode.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/opto/memnode.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -204,6 +204,17 @@ protected: const Type* load_array_final_field(const TypeKlassPtr *tkls, ciKlass* klass) const; + // depends_only_on_test is almost always true, and needs to be almost always + // true to enable key hoisting & commoning optimizations. However, for the + // special case of RawPtr loads from TLS top & end, and other loads performed by + // GC barriers, the control edge carries the dependence preventing hoisting past + // a Safepoint instead of the memory edge. (An unfortunate consequence of having + // Safepoints not set Raw Memory; itself an unfortunate consequence of having Nodes + // which produce results (new raw memory state) inside of loops preventing all + // manner of other optimizations). Basically, it's ugly but so is the alternative. + // See comment in macro.cpp, around line 125 expand_allocate_common(). + virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; } + }; //------------------------------LoadBNode-------------------------------------- @@ -370,16 +381,6 @@ virtual uint ideal_reg() const { return Op_RegP; } virtual int store_Opcode() const { return Op_StoreP; } virtual BasicType memory_type() const { return T_ADDRESS; } - // depends_only_on_test is almost always true, and needs to be almost always - // true to enable key hoisting & commoning optimizations. However, for the - // special case of RawPtr loads from TLS top & end, the control edge carries - // the dependence preventing hoisting past a Safepoint instead of the memory - // edge. (An unfortunate consequence of having Safepoints not set Raw - // Memory; itself an unfortunate consequence of having Nodes which produce - // results (new raw memory state) inside of loops preventing all manner of - // other optimizations). Basically, it's ugly but so is the alternative. - // See comment in macro.cpp, around line 125 expand_allocate_common(). - virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; } }; @@ -393,16 +394,6 @@ virtual uint ideal_reg() const { return Op_RegN; } virtual int store_Opcode() const { return Op_StoreN; } virtual BasicType memory_type() const { return T_NARROWOOP; } - // depends_only_on_test is almost always true, and needs to be almost always - // true to enable key hoisting & commoning optimizations. However, for the - // special case of RawPtr loads from TLS top & end, the control edge carries - // the dependence preventing hoisting past a Safepoint instead of the memory - // edge. (An unfortunate consequence of having Safepoints not set Raw - // Memory; itself an unfortunate consequence of having Nodes which produce - // results (new raw memory state) inside of loops preventing all manner of - // other optimizations). Basically, it's ugly but so is the alternative. - // See comment in macro.cpp, around line 125 expand_allocate_common(). - virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; } }; //------------------------------LoadKlassNode----------------------------------
--- a/hotspot/src/share/vm/opto/postaloc.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/opto/postaloc.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -97,7 +97,8 @@ static bool expected_yanked_node(Node *old, Node *orig_old) { // This code is expected only next original nodes: // - load from constant table node which may have next data input nodes: - // MachConstantBase, Phi, MachTemp, MachSpillCopy + // MachConstantBase, MachTemp, MachSpillCopy + // - Phi nodes that are considered Junk // - load constant node which may have next data input nodes: // MachTemp, MachSpillCopy // - MachSpillCopy @@ -112,7 +113,9 @@ return (old == orig_old); } else if (old->is_MachTemp()) { return orig_old->is_Con(); - } else if (old->is_Phi() || old->is_MachConstantBase()) { + } else if (old->is_Phi()) { // Junk phi's + return true; + } else if (old->is_MachConstantBase()) { return (orig_old->is_Con() && orig_old->is_MachConstant()); } return false; @@ -522,11 +525,9 @@ u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input } if (u != NodeSentinel) { // Junk Phi. Remove - block->remove_node(j--); + phi->replace_by(u); + j -= yank_if_dead(phi, block, &value, ®nd); phi_dex--; - _cfg.unmap_node_from_block(phi); - phi->replace_by(u); - phi->disconnect_inputs(NULL, C); continue; } // Note that if value[pidx] exists, then we merged no new values here
--- a/hotspot/src/share/vm/opto/type.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/opto/type.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -2787,13 +2787,11 @@ //-----------------------------filter------------------------------------------ // Do not allow interface-vs.-noninterface joins to collapse to top. -const Type *TypeOopPtr::filter( const Type *kills ) const { +const Type *TypeOopPtr::filter(const Type *kills) const { const Type* ft = join(kills); const TypeInstPtr* ftip = ft->isa_instptr(); const TypeInstPtr* ktip = kills->isa_instptr(); - const TypeKlassPtr* ftkp = ft->isa_klassptr(); - const TypeKlassPtr* ktkp = kills->isa_klassptr(); if (ft->empty()) { // Check for evil case of 'this' being a class and 'kills' expecting an @@ -2807,8 +2805,6 @@ // uplift the type. if (!empty() && ktip != NULL && ktip->is_loaded() && ktip->klass()->is_interface()) return kills; // Uplift to interface - if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface()) - return kills; // Uplift to interface return Type::TOP; // Canonical empty value } @@ -2825,14 +2821,6 @@ assert(!ftip->klass_is_exact(), "interface could not be exact"); return ktip->cast_to_ptr_type(ftip->ptr()); } - // Interface klass type could be exact in opposite to interface type, - // return it here instead of incorrect Constant ptr J/L/Object (6894807). - if (ftkp != NULL && ktkp != NULL && - ftkp->is_loaded() && ftkp->klass()->is_interface() && - !ftkp->klass_is_exact() && // Keep exact interface klass - ktkp->is_loaded() && !ktkp->klass()->is_interface()) { - return ktkp->cast_to_ptr_type(ftkp->ptr()); - } return ft; } @@ -4385,6 +4373,33 @@ return (_offset == 0) && !below_centerline(_ptr); } +// Do not allow interface-vs.-noninterface joins to collapse to top. +const Type *TypeKlassPtr::filter(const Type *kills) const { + // logic here mirrors the one from TypeOopPtr::filter. See comments + // there. + const Type* ft = join(kills); + const TypeKlassPtr* ftkp = ft->isa_klassptr(); + const TypeKlassPtr* ktkp = kills->isa_klassptr(); + + if (ft->empty()) { + if (!empty() && ktkp != NULL && ktkp->klass()->is_loaded() && ktkp->klass()->is_interface()) + return kills; // Uplift to interface + + return Type::TOP; // Canonical empty value + } + + // Interface klass type could be exact in opposite to interface type, + // return it here instead of incorrect Constant ptr J/L/Object (6894807). + if (ftkp != NULL && ktkp != NULL && + ftkp->is_loaded() && ftkp->klass()->is_interface() && + !ftkp->klass_is_exact() && // Keep exact interface klass + ktkp->is_loaded() && !ktkp->klass()->is_interface()) { + return ktkp->cast_to_ptr_type(ftkp->ptr()); + } + + return ft; +} + //----------------------compute_klass------------------------------------------ // Compute the defining klass for this class ciKlass* TypeAryPtr::compute_klass(DEBUG_ONLY(bool verify)) const {
--- a/hotspot/src/share/vm/opto/type.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/opto/type.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -63,7 +63,7 @@ class TypeOopPtr; class TypeInstPtr; class TypeAryPtr; -class TypeKlassPtr; +class TypeKlassPtr; class TypeMetadataPtr; //------------------------------Type------------------------------------------- @@ -1202,6 +1202,9 @@ virtual intptr_t get_con() const; + // Do not allow interface-vs.-noninterface joins to collapse to top. + virtual const Type *filter( const Type *kills ) const; + // Convenience common pre-built types. static const TypeKlassPtr* OBJECT; // Not-null object klass or below static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same
--- a/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/prims/jvmtiGetLoadedClasses.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -29,8 +29,43 @@ #include "runtime/thread.hpp" +// The closure for GetLoadedClasses +class LoadedClassesClosure : public KlassClosure { +private: + Stack<jclass, mtInternal> _classStack; + JvmtiEnv* _env; -// The closure for GetLoadedClasses and GetClassLoaderClasses +public: + LoadedClassesClosure(JvmtiEnv* env) { + _env = env; + } + + void do_klass(Klass* k) { + // Collect all jclasses + _classStack.push((jclass) _env->jni_reference(k->java_mirror())); + } + + int extract(jclass* result_list) { + // The size of the Stack will be 0 after extract, so get it here + int count = (int)_classStack.size(); + int i = count; + + // Pop all jclasses, fill backwards + while (!_classStack.is_empty()) { + result_list[--i] = _classStack.pop(); + } + + // Return the number of elements written + return count; + } + + // Return current size of the Stack + int get_count() { + return (int)_classStack.size(); + } +}; + +// The closure for GetClassLoaderClasses class JvmtiGetLoadedClassesClosure : public StackObj { // Since the SystemDictionary::classes_do callback // doesn't pass a closureData pointer, @@ -165,19 +200,6 @@ } } - // Finally, the static methods that are the callbacks - static void increment(Klass* k) { - JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); - if (that->get_initiatingLoader() == NULL) { - for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) { - that->set_count(that->get_count() + 1); - } - } else if (k != NULL) { - // if initiating loader not null, just include the instance with 1 dimension - that->set_count(that->get_count() + 1); - } - } - static void increment_with_loader(Klass* k, ClassLoaderData* loader_data) { JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); oop class_loader = loader_data->class_loader(); @@ -196,24 +218,6 @@ } } - static void add(Klass* k) { - JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); - if (that->available()) { - if (that->get_initiatingLoader() == NULL) { - for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) { - oop mirror = l->java_mirror(); - that->set_element(that->get_index(), mirror); - that->set_index(that->get_index() + 1); - } - } else if (k != NULL) { - // if initiating loader not null, just include the instance with 1 dimension - oop mirror = k->java_mirror(); - that->set_element(that->get_index(), mirror); - that->set_index(that->get_index() + 1); - } - } - } - static void add_with_loader(Klass* k, ClassLoaderData* loader_data) { JvmtiGetLoadedClassesClosure* that = JvmtiGetLoadedClassesClosure::get_this(); if (that->available()) { @@ -255,39 +259,30 @@ jvmtiError JvmtiGetLoadedClasses::getLoadedClasses(JvmtiEnv *env, jint* classCountPtr, jclass** classesPtr) { - // Since SystemDictionary::classes_do only takes a function pointer - // and doesn't call back with a closure data pointer, - // we can only pass static methods. - JvmtiGetLoadedClassesClosure closure; + LoadedClassesClosure closure(env); { // To get a consistent list of classes we need MultiArray_lock to ensure - // array classes aren't created, and SystemDictionary_lock to ensure that - // classes aren't added to the system dictionary, + // array classes aren't created. MutexLocker ma(MultiArray_lock); - MutexLocker sd(SystemDictionary_lock); + + // Iterate through all classes in ClassLoaderDataGraph + // and collect them using the LoadedClassesClosure + ClassLoaderDataGraph::loaded_classes_do(&closure); + } - // First, count the classes - SystemDictionary::classes_do(&JvmtiGetLoadedClassesClosure::increment); - Universe::basic_type_classes_do(&JvmtiGetLoadedClassesClosure::increment); - // Next, fill in the classes - closure.allocate(); - SystemDictionary::classes_do(&JvmtiGetLoadedClassesClosure::add); - Universe::basic_type_classes_do(&JvmtiGetLoadedClassesClosure::add); - // Drop the SystemDictionary_lock, so the results could be wrong from here, - // but we still have a snapshot. + // Return results by extracting the collected contents into a list + // allocated via JvmtiEnv + jclass* result_list; + jvmtiError error = env->Allocate(closure.get_count() * sizeof(jclass), + (unsigned char**)&result_list); + + if (error == JVMTI_ERROR_NONE) { + int count = closure.extract(result_list); + *classCountPtr = count; + *classesPtr = result_list; } - // Post results - jclass* result_list; - jvmtiError err = env->Allocate(closure.get_count() * sizeof(jclass), - (unsigned char**)&result_list); - if (err != JVMTI_ERROR_NONE) { - return err; - } - closure.extract(env, result_list); - *classCountPtr = closure.get_count(); - *classesPtr = result_list; - return JVMTI_ERROR_NONE; + return error; } jvmtiError
--- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -210,6 +210,14 @@ } } +void GrowableCache::metadata_do(void f(Metadata*)) { + int len = _elements->length(); + for (int i=0; i<len; i++) { + GrowableElement *e = _elements->at(i); + e->metadata_do(f); + } +} + void GrowableCache::gc_epilogue() { int len = _elements->length(); for (int i=0; i<len; i++) { @@ -224,20 +232,20 @@ JvmtiBreakpoint::JvmtiBreakpoint() { _method = NULL; _bci = 0; - _class_loader = NULL; + _class_holder = NULL; } JvmtiBreakpoint::JvmtiBreakpoint(Method* m_method, jlocation location) { _method = m_method; - _class_loader = _method->method_holder()->class_loader_data()->class_loader(); + _class_holder = _method->method_holder()->klass_holder(); #ifdef CHECK_UNHANDLED_OOPS - // _class_loader can't be wrapped in a Handle, because JvmtiBreakpoint:s are - // eventually allocated on the heap. + // _class_holder can't be wrapped in a Handle, because JvmtiBreakpoints are + // sometimes allocated on the heap. // - // The code handling JvmtiBreakpoint:s allocated on the stack can't be - // interrupted by a GC until _class_loader is reachable by the GC via the + // The code handling JvmtiBreakpoints allocated on the stack can't be + // interrupted by a GC until _class_holder is reachable by the GC via the // oops_do method. - Thread::current()->allow_unhandled_oop(&_class_loader); + Thread::current()->allow_unhandled_oop(&_class_holder); #endif // CHECK_UNHANDLED_OOPS assert(_method != NULL, "_method != NULL"); _bci = (int) location; @@ -247,7 +255,7 @@ void JvmtiBreakpoint::copy(JvmtiBreakpoint& bp) { _method = bp._method; _bci = bp._bci; - _class_loader = bp._class_loader; + _class_holder = bp._class_holder; } bool JvmtiBreakpoint::lessThan(JvmtiBreakpoint& bp) { @@ -365,6 +373,13 @@ } } +void VM_ChangeBreakpoints::metadata_do(void f(Metadata*)) { + // Walk metadata in breakpoints to keep from being deallocated with RedefineClasses + if (_bp != NULL) { + _bp->metadata_do(f); + } +} + // // class JvmtiBreakpoints // @@ -381,6 +396,10 @@ _bps.oops_do(f); } +void JvmtiBreakpoints::metadata_do(void f(Metadata*)) { + _bps.metadata_do(f); +} + void JvmtiBreakpoints::gc_epilogue() { _bps.gc_epilogue(); } @@ -499,6 +518,12 @@ } } +void JvmtiCurrentBreakpoints::metadata_do(void f(Metadata*)) { + if (_jvmti_breakpoints != NULL) { + _jvmti_breakpoints->metadata_do(f); + } +} + void JvmtiCurrentBreakpoints::gc_epilogue() { if (_jvmti_breakpoints != NULL) { _jvmti_breakpoints->gc_epilogue();
--- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -69,6 +69,7 @@ virtual bool lessThan(GrowableElement *e)=0; virtual GrowableElement *clone() =0; virtual void oops_do(OopClosure* f) =0; + virtual void metadata_do(void f(Metadata*)) =0; }; class GrowableCache VALUE_OBJ_CLASS_SPEC { @@ -115,6 +116,8 @@ void clear(); // apply f to every element and update the cache void oops_do(OopClosure* f); + // walk metadata to preserve for RedefineClasses + void metadata_do(void f(Metadata*)); // update the cache after a full gc void gc_epilogue(); }; @@ -148,6 +151,7 @@ void remove (int index) { _cache.remove(index); } void clear() { _cache.clear(); } void oops_do(OopClosure* f) { _cache.oops_do(f); } + void metadata_do(void f(Metadata*)) { _cache.metadata_do(f); } void gc_epilogue() { _cache.gc_epilogue(); } }; @@ -169,7 +173,7 @@ Method* _method; int _bci; Bytecodes::Code _orig_bytecode; - oop _class_loader; + oop _class_holder; // keeps _method memory from being deallocated public: JvmtiBreakpoint(); @@ -191,9 +195,15 @@ bool lessThan(GrowableElement* e) { Unimplemented(); return false; } bool equals(GrowableElement* e) { return equals((JvmtiBreakpoint&) *e); } void oops_do(OopClosure* f) { - // Mark the method loader as live - f->do_oop(&_class_loader); + // Mark the method loader as live so the Method* class loader doesn't get + // unloaded and Method* memory reclaimed. + f->do_oop(&_class_holder); } + void metadata_do(void f(Metadata*)) { + // walk metadata to preserve for RedefineClasses + f(_method); + } + GrowableElement *clone() { JvmtiBreakpoint *bp = new JvmtiBreakpoint(); bp->copy(*this); @@ -239,6 +249,7 @@ int length(); void oops_do(OopClosure* f); + void metadata_do(void f(Metadata*)); void print(); int set(JvmtiBreakpoint& bp); @@ -288,6 +299,7 @@ static inline bool is_breakpoint(address bcp); static void oops_do(OopClosure* f); + static void metadata_do(void f(Metadata*)); static void gc_epilogue(); }; @@ -332,6 +344,7 @@ VMOp_Type type() const { return VMOp_ChangeBreakpoints; } void doit(); void oops_do(OopClosure* f); + void metadata_do(void f(Metadata*)); };
--- a/hotspot/src/share/vm/runtime/arguments.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/runtime/arguments.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -1988,6 +1988,15 @@ warning("DefaultMaxRAMFraction is deprecated and will likely be removed in a future release. " "Use MaxRAMFraction instead."); } + if (FLAG_IS_CMDLINE(UseCMSCompactAtFullCollection)) { + warning("UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release."); + } + if (FLAG_IS_CMDLINE(CMSFullGCsBeforeCompaction)) { + warning("CMSFullGCsBeforeCompaction is deprecated and will likely be removed in a future release."); + } + if (FLAG_IS_CMDLINE(UseCMSCollectionPassing)) { + warning("UseCMSCollectionPassing is deprecated and will likely be removed in a future release."); + } } // Check stack pages settings
--- a/hotspot/src/share/vm/runtime/handles.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/runtime/handles.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -45,7 +45,7 @@ oop* HandleArea::allocate_handle(oop obj) { assert(_handle_mark_nesting > 1, "memory leak: allocating handle outside HandleMark"); assert(_no_handle_mark_nesting == 0, "allocating handle inside NoHandleMark"); - assert(obj->is_oop(), "sanity check"); + assert(obj->is_oop(), err_msg("not an oop: " INTPTR_FORMAT, (intptr_t*) obj)); return real_allocate_handle(obj); }
--- a/hotspot/src/share/vm/runtime/thread.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/runtime/thread.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -1097,7 +1097,7 @@ // General purpose hook into Java code, run once when the VM is initialized. // The Java library method itself may be changed independently from the VM. static void call_postVMInitHook(TRAPS) { - Klass* k = SystemDictionary::PostVMInitHook_klass(); + Klass* k = SystemDictionary::resolve_or_null(vmSymbols::sun_misc_PostVMInitHook(), THREAD); instanceKlassHandle klass (THREAD, k); if (klass.not_null()) { JavaValue result(T_VOID);
--- a/hotspot/src/share/vm/services/jmm.h Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/services/jmm.h Fri Nov 08 17:39:39 2013 -0800 @@ -78,6 +78,7 @@ JMM_COMPILE_TOTAL_TIME_MS = 8, /* Total accumulated time spent in compilation */ JMM_GC_TIME_MS = 9, /* Total accumulated time spent in collection */ JMM_GC_COUNT = 10, /* Total number of collections */ + JMM_JVM_UPTIME_MS = 11, /* The JVM uptime in milliseconds */ JMM_INTERNAL_ATTRIBUTE_INDEX = 100, JMM_CLASS_LOADED_BYTES = 101, /* Number of bytes loaded instance classes */
--- a/hotspot/src/share/vm/services/management.cpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/services/management.cpp Fri Nov 08 17:39:39 2013 -0800 @@ -1032,6 +1032,9 @@ case JMM_JVM_INIT_DONE_TIME_MS: return Management::vm_init_done_time(); + case JMM_JVM_UPTIME_MS: + return Management::ticks_to_ms(os::elapsed_counter()); + case JMM_COMPILE_TOTAL_TIME_MS: return Management::ticks_to_ms(CompileBroker::total_compilation_ticks());
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp Fri Nov 08 17:39:39 2013 -0800 @@ -368,8 +368,6 @@ // Klass encoding metaspace max size const uint64_t KlassEncodingMetaspaceMax = (uint64_t(max_juint) + 1) << LogKlassAlignmentInBytes; -const jlong CompressedKlassPointersBase = NOT_LP64(0) LP64_ONLY(CONST64(0x800000000)); // 32*G - // Machine dependent stuff #ifdef TARGET_ARCH_x86
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/test/compiler/inlining/InlineDefaultMethod.java Fri Nov 08 17:39:39 2013 -0800 @@ -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 + * @bug 8026735 + * @summary CHA in C1 should make correct decisions about default methods + * @run main/othervm -Xcomp -XX:CompileOnly=InlineDefaultMethod::test -XX:TieredStopAtLevel=1 InlineDefaultMethod + */ + + +interface InterfaceWithDefaultMethod0 { + default public int defaultMethod() { + return 1; + } +} + +interface InterfaceWithDefaultMethod1 extends InterfaceWithDefaultMethod0 { } + +abstract class Subtype implements InterfaceWithDefaultMethod1 { } + +class Decoy extends Subtype { + public int defaultMethod() { + return 2; + } +} + +class Instance extends Subtype { } + +public class InlineDefaultMethod { + public static int test(InterfaceWithDefaultMethod1 x) { + return x.defaultMethod(); + } + public static void main(String[] args) { + InterfaceWithDefaultMethod1 a = new Decoy(); + InterfaceWithDefaultMethod1 b = new Instance(); + if (test(a) != 2 || + test(b) != 1) { + System.err.println("FAILED"); + System.exit(97); + } + System.err.println("PASSED"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/test/compiler/intrinsics/mathexact/CompareTest.java Fri Nov 08 17:39:39 2013 -0800 @@ -0,0 +1,61 @@ +/* + * 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 + * @bug 8026722 + * @summary Verify that the compare after addExact is a signed compare + * @compile CompareTest.java + * @run main CompareTest + * + */ + +public class CompareTest { + public static long store = 0; + public static long addValue = 1231; + + public static void main(String[] args) { + for (int i = 0; i < 20000; ++i) { + runTest(i, i); + runTest(i-1, i); + } + } + + public static long create(long value, int v) { + if ((value | v) == 0) { + return 0; + } + + // C2 turned this test into unsigned test when a control edge was set on the Cmp + if (value < -31557014167219200L || value > 31556889864403199L) { + throw new RuntimeException("error"); + } + + return value; + } + + public static void runTest(long value, int value2) { + long res = Math.addExact(value, addValue); + store = create(res, Math.floorMod(value2, 100000)); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/test/compiler/intrinsics/mathexact/NestedMathExactTest.java Fri Nov 08 17:39:39 2013 -0800 @@ -0,0 +1,54 @@ +/* + * 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 + * @bug 8027444 + * @summary Test nested loops + * @compile NestedMathExactTest.java + * @run main NestedMathExactTest + * + */ + +public class NestedMathExactTest { + public static final int LIMIT = 100; + public static int[] result = new int[LIMIT]; + public static int value = 17; + + public static void main(String[] args) { + for (int i = 0; i < 100; ++i) { + result[i] = runTest(); + } + } + + public static int runTest() { + int sum = 0; + for (int j = 0; j < 100000; j = Math.addExact(j, 1)) { + sum = 1; + for (int i = 0; i < 5; ++i) { + sum *= value; + } + } + return sum; + } +}
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLConstantTest.java Fri Nov 08 17:39:39 2013 -0800 @@ -24,6 +24,7 @@ /* * @test * @bug 8026844 + * @bug 8027353 * @summary Test constant subtractExact * @compile SubExactLConstantTest.java Verify.java * @run main SubExactLConstantTest
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java Thu Nov 07 18:11:12 2013 +0530 +++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactLNonConstantTest.java Fri Nov 08 17:39:39 2013 -0800 @@ -24,6 +24,7 @@ /* * @test * @bug 8026844 + * @bug 8027353 * @summary Test non constant subtractExact * @compile SubExactLNonConstantTest.java Verify.java * @run main SubExactLNonConstantTest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java Fri Nov 08 17:39:39 2013 -0800 @@ -0,0 +1,82 @@ +/* + * 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 + * @bug 8027445 + * @summary String.equals() may be called with a length whose upper bits are not cleared + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestStringEqualsBadLength + * + */ + +import java.util.Arrays; + +public class TestStringEqualsBadLength { + + int v1; + int v2; + + boolean m(String s1) { + int l = v2 - v1; // 0 - (-1) = 1. On 64 bit: 0xffffffff00000001 + char[] arr = new char[l]; + arr[0] = 'a'; + String s2 = new String(arr); + // The string length is not reloaded but the value computed is + // reused so pointer computation must not use + // 0xffffffff00000001 + return s2.equals(s1); + } + + // Same thing with String.compareTo() + int m2(String s1) { + int l = v2 - v1; + char[] arr = new char[l+1]; + arr[0] = 'a'; + arr[1] = 'b'; + String s2 = new String(arr); + return s2.compareTo(s1); + } + + // Same thing with equals() for arrays + boolean m3(char[] arr1) { + int l = v2 - v1; // 0 - (-1) = 1. On 64 bit: 0xffffffff00000001 + char[] arr2 = new char[l]; + arr2[0] = 'a'; + return Arrays.equals(arr2, arr1); + } + + static public void main(String[] args) { + TestStringEqualsBadLength tse = new TestStringEqualsBadLength(); + tse.v1 = -1; + tse.v2 = 0; + char[] arr = new char[1]; + arr[0] = 'a'; + for (int i = 0; i < 20000; i++) { + tse.m("a"); + tse.m2("ab"); + tse.m3(arr); + } + + System.out.println("TEST PASSED"); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java Fri Nov 08 17:39:39 2013 -0800 @@ -0,0 +1,45 @@ +/* + * 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 + * @bug 8027751 + * @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetObject() intrinsic because of the new value spill + * @run main/othervm -XX:+UseG1GC C1ObjectSpillInLogicOp + * + * G1 barriers use logical operators (xor) on T_OBJECT mixed with T_LONG or T_INT. + * The current implementation of logical operations on x86 in C1 doesn't allow for long operands to be on stack. + * There is a special code in the register allocator that forces long arguments in registers on x86. However T_OBJECT + * can be spilled just fine, and in that case the xor emission will fail. + */ + +import java.util.concurrent.atomic.*; +class C1ObjectSpillInLogicOp { + static public void main(String[] args) { + AtomicReferenceArray<Integer> x = new AtomicReferenceArray(128); + Integer y = new Integer(0); + for (int i = 0; i < 50000; i++) { + x.getAndSet(i % x.length(), y); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/test/compiler/startup/StartupOutput.java Fri Nov 08 17:39:39 2013 -0800 @@ -0,0 +1,44 @@ +/* + * 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 + * @bug 8026949 + * @summary Test ensures correct VM output during startup + * @library ../../testlibrary + * + */ +import com.oracle.java.testlibrary.*; + +public class StartupOutput { + public static void main(String[] args) throws Exception { + ProcessBuilder pb; + OutputAnalyzer out; + + pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); + out = new OutputAnalyzer(pb.start()); + out.shouldNotContain("no space to run compilers"); + + out.shouldHaveExitValue(0); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java Fri Nov 08 17:39:39 2013 -0800 @@ -0,0 +1,10908 @@ +/* + * 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 + * @bug 8026775 + * @summary Uncommon trap blob did not bang all the stack shadow pages + * + * @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -XX:+TieredCompilation UncommonTrapStackBang + * @run main/othervm -server -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation UncommonTrapStackBang + * + * + * Note: This test does not reproduce the problem with absolute + * certainty. Empirically the bug reproduces on Windows some 80+% of + * the time. Setting everything up to fail in 100% of the cases turns + * out to be tricky at best. + * + * + * The goal of this test is to set up the following stack: + * + * doIt() + * eatStack() + * ... + * eatStack() + * run() + * + * + * When doIt() gets executed it will hit an uncommon trap and expand + * into a huge interpreter frame. The doIt method then calls the + * compiled version of StringBuilder.<init>() which does a single + * stack bang StackShadowPages down. + * + * The uncommon trap blob is supposed to prepare for the interpreter + * by pre-touching stack pages. The bug was that it didn't correctly + * pre-touch all the stack shadow pages, leaving a "hole" on the stack + * which raises an exception on Windows when the stack bang in + * StringBuilder is performed. + */ +public class UncommonTrapStackBang extends Thread { + class Foo { } + + public static void main(String[] args) throws Exception { + doWarmup(); + + // Fork off a new thread to increase odds of the stack being unmapped + UncommonTrapStackBang htsb = new UncommonTrapStackBang(); + htsb.run(); + htsb.join(); + } + + // Make sure: + // + // a) StringBuilder.<init>()V is compiled + // b) doIt() is compiled with an uncommon trap in the unlikely path + public static void doWarmup() { + for (int i = 0; i < 100_000; i++) { + new StringBuilder(); + + doIt(false); + } + } + + public void run() { + eatStack(200); + } + + // Consume some stack to get down to some unused/unmapped pages, + // then call doIt and provoke the uncommon trap/deoptimization + private void eatStack(int n) { + if (n <= 0) { + doIt(true); + return; + } + + eatStack(n - 1); + } + + static public void doIt(boolean unlikely) { + int i0; + int i1; + int i2; + int i3; + int i4; + int i5; + int i6; + int i7; + int i8; + int i9; + int i10; + int i11; + int i12; + int i13; + int i14; + int i15; + int i16; + int i17; + int i18; + int i19; + int i20; + int i21; + int i22; + int i23; + int i24; + int i25; + int i26; + int i27; + int i28; + int i29; + int i30; + int i31; + int i32; + int i33; + int i34; + int i35; + int i36; + int i37; + int i38; + int i39; + int i40; + int i41; + int i42; + int i43; + int i44; + int i45; + int i46; + int i47; + int i48; + int i49; + int i50; + int i51; + int i52; + int i53; + int i54; + int i55; + int i56; + int i57; + int i58; + int i59; + int i60; + int i61; + int i62; + int i63; + int i64; + int i65; + int i66; + int i67; + int i68; + int i69; + int i70; + int i71; + int i72; + int i73; + int i74; + int i75; + int i76; + int i77; + int i78; + int i79; + int i80; + int i81; + int i82; + int i83; + int i84; + int i85; + int i86; + int i87; + int i88; + int i89; + int i90; + int i91; + int i92; + int i93; + int i94; + int i95; + int i96; + int i97; + int i98; + int i99; + int i100; + int i101; + int i102; + int i103; + int i104; + int i105; + int i106; + int i107; + int i108; + int i109; + int i110; + int i111; + int i112; + int i113; + int i114; + int i115; + int i116; + int i117; + int i118; + int i119; + int i120; + int i121; + int i122; + int i123; + int i124; + int i125; + int i126; + int i127; + int i128; + int i129; + int i130; + int i131; + int i132; + int i133; + int i134; + int i135; + int i136; + int i137; + int i138; + int i139; + int i140; + int i141; + int i142; + int i143; + int i144; + int i145; + int i146; + int i147; + int i148; + int i149; + int i150; + int i151; + int i152; + int i153; + int i154; + int i155; + int i156; + int i157; + int i158; + int i159; + int i160; + int i161; + int i162; + int i163; + int i164; + int i165; + int i166; + int i167; + int i168; + int i169; + int i170; + int i171; + int i172; + int i173; + int i174; + int i175; + int i176; + int i177; + int i178; + int i179; + int i180; + int i181; + int i182; + int i183; + int i184; + int i185; + int i186; + int i187; + int i188; + int i189; + int i190; + int i191; + int i192; + int i193; + int i194; + int i195; + int i196; + int i197; + int i198; + int i199; + int i200; + int i201; + int i202; + int i203; + int i204; + int i205; + int i206; + int i207; + int i208; + int i209; + int i210; + int i211; + int i212; + int i213; + int i214; + int i215; + int i216; + int i217; + int i218; + int i219; + int i220; + int i221; + int i222; + int i223; + int i224; + int i225; + int i226; + int i227; + int i228; + int i229; + int i230; + int i231; + int i232; + int i233; + int i234; + int i235; + int i236; + int i237; + int i238; + int i239; + int i240; + int i241; + int i242; + int i243; + int i244; + int i245; + int i246; + int i247; + int i248; + int i249; + int i250; + int i251; + int i252; + int i253; + int i254; + int i255; + int i256; + int i257; + int i258; + int i259; + int i260; + int i261; + int i262; + int i263; + int i264; + int i265; + int i266; + int i267; + int i268; + int i269; + int i270; + int i271; + int i272; + int i273; + int i274; + int i275; + int i276; + int i277; + int i278; + int i279; + int i280; + int i281; + int i282; + int i283; + int i284; + int i285; + int i286; + int i287; + int i288; + int i289; + int i290; + int i291; + int i292; + int i293; + int i294; + int i295; + int i296; + int i297; + int i298; + int i299; + int i300; + int i301; + int i302; + int i303; + int i304; + int i305; + int i306; + int i307; + int i308; + int i309; + int i310; + int i311; + int i312; + int i313; + int i314; + int i315; + int i316; + int i317; + int i318; + int i319; + int i320; + int i321; + int i322; + int i323; + int i324; + int i325; + int i326; + int i327; + int i328; + int i329; + int i330; + int i331; + int i332; + int i333; + int i334; + int i335; + int i336; + int i337; + int i338; + int i339; + int i340; + int i341; + int i342; + int i343; + int i344; + int i345; + int i346; + int i347; + int i348; + int i349; + int i350; + int i351; + int i352; + int i353; + int i354; + int i355; + int i356; + int i357; + int i358; + int i359; + int i360; + int i361; + int i362; + int i363; + int i364; + int i365; + int i366; + int i367; + int i368; + int i369; + int i370; + int i371; + int i372; + int i373; + int i374; + int i375; + int i376; + int i377; + int i378; + int i379; + int i380; + int i381; + int i382; + int i383; + int i384; + int i385; + int i386; + int i387; + int i388; + int i389; + int i390; + int i391; + int i392; + int i393; + int i394; + int i395; + int i396; + int i397; + int i398; + int i399; + int i400; + int i401; + int i402; + int i403; + int i404; + int i405; + int i406; + int i407; + int i408; + int i409; + int i410; + int i411; + int i412; + int i413; + int i414; + int i415; + int i416; + int i417; + int i418; + int i419; + int i420; + int i421; + int i422; + int i423; + int i424; + int i425; + int i426; + int i427; + int i428; + int i429; + int i430; + int i431; + int i432; + int i433; + int i434; + int i435; + int i436; + int i437; + int i438; + int i439; + int i440; + int i441; + int i442; + int i443; + int i444; + int i445; + int i446; + int i447; + int i448; + int i449; + int i450; + int i451; + int i452; + int i453; + int i454; + int i455; + int i456; + int i457; + int i458; + int i459; + int i460; + int i461; + int i462; + int i463; + int i464; + int i465; + int i466; + int i467; + int i468; + int i469; + int i470; + int i471; + int i472; + int i473; + int i474; + int i475; + int i476; + int i477; + int i478; + int i479; + int i480; + int i481; + int i482; + int i483; + int i484; + int i485; + int i486; + int i487; + int i488; + int i489; + int i490; + int i491; + int i492; + int i493; + int i494; + int i495; + int i496; + int i497; + int i498; + int i499; + int i500; + int i501; + int i502; + int i503; + int i504; + int i505; + int i506; + int i507; + int i508; + int i509; + int i510; + int i511; + int i512; + int i513; + int i514; + int i515; + int i516; + int i517; + int i518; + int i519; + int i520; + int i521; + int i522; + int i523; + int i524; + int i525; + int i526; + int i527; + int i528; + int i529; + int i530; + int i531; + int i532; + int i533; + int i534; + int i535; + int i536; + int i537; + int i538; + int i539; + int i540; + int i541; + int i542; + int i543; + int i544; + int i545; + int i546; + int i547; + int i548; + int i549; + int i550; + int i551; + int i552; + int i553; + int i554; + int i555; + int i556; + int i557; + int i558; + int i559; + int i560; + int i561; + int i562; + int i563; + int i564; + int i565; + int i566; + int i567; + int i568; + int i569; + int i570; + int i571; + int i572; + int i573; + int i574; + int i575; + int i576; + int i577; + int i578; + int i579; + int i580; + int i581; + int i582; + int i583; + int i584; + int i585; + int i586; + int i587; + int i588; + int i589; + int i590; + int i591; + int i592; + int i593; + int i594; + int i595; + int i596; + int i597; + int i598; + int i599; + int i600; + int i601; + int i602; + int i603; + int i604; + int i605; + int i606; + int i607; + int i608; + int i609; + int i610; + int i611; + int i612; + int i613; + int i614; + int i615; + int i616; + int i617; + int i618; + int i619; + int i620; + int i621; + int i622; + int i623; + int i624; + int i625; + int i626; + int i627; + int i628; + int i629; + int i630; + int i631; + int i632; + int i633; + int i634; + int i635; + int i636; + int i637; + int i638; + int i639; + int i640; + int i641; + int i642; + int i643; + int i644; + int i645; + int i646; + int i647; + int i648; + int i649; + int i650; + int i651; + int i652; + int i653; + int i654; + int i655; + int i656; + int i657; + int i658; + int i659; + int i660; + int i661; + int i662; + int i663; + int i664; + int i665; + int i666; + int i667; + int i668; + int i669; + int i670; + int i671; + int i672; + int i673; + int i674; + int i675; + int i676; + int i677; + int i678; + int i679; + int i680; + int i681; + int i682; + int i683; + int i684; + int i685; + int i686; + int i687; + int i688; + int i689; + int i690; + int i691; + int i692; + int i693; + int i694; + int i695; + int i696; + int i697; + int i698; + int i699; + int i700; + int i701; + int i702; + int i703; + int i704; + int i705; + int i706; + int i707; + int i708; + int i709; + int i710; + int i711; + int i712; + int i713; + int i714; + int i715; + int i716; + int i717; + int i718; + int i719; + int i720; + int i721; + int i722; + int i723; + int i724; + int i725; + int i726; + int i727; + int i728; + int i729; + int i730; + int i731; + int i732; + int i733; + int i734; + int i735; + int i736; + int i737; + int i738; + int i739; + int i740; + int i741; + int i742; + int i743; + int i744; + int i745; + int i746; + int i747; + int i748; + int i749; + int i750; + int i751; + int i752; + int i753; + int i754; + int i755; + int i756; + int i757; + int i758; + int i759; + int i760; + int i761; + int i762; + int i763; + int i764; + int i765; + int i766; + int i767; + int i768; + int i769; + int i770; + int i771; + int i772; + int i773; + int i774; + int i775; + int i776; + int i777; + int i778; + int i779; + int i780; + int i781; + int i782; + int i783; + int i784; + int i785; + int i786; + int i787; + int i788; + int i789; + int i790; + int i791; + int i792; + int i793; + int i794; + int i795; + int i796; + int i797; + int i798; + int i799; + int i800; + int i801; + int i802; + int i803; + int i804; + int i805; + int i806; + int i807; + int i808; + int i809; + int i810; + int i811; + int i812; + int i813; + int i814; + int i815; + int i816; + int i817; + int i818; + int i819; + int i820; + int i821; + int i822; + int i823; + int i824; + int i825; + int i826; + int i827; + int i828; + int i829; + int i830; + int i831; + int i832; + int i833; + int i834; + int i835; + int i836; + int i837; + int i838; + int i839; + int i840; + int i841; + int i842; + int i843; + int i844; + int i845; + int i846; + int i847; + int i848; + int i849; + int i850; + int i851; + int i852; + int i853; + int i854; + int i855; + int i856; + int i857; + int i858; + int i859; + int i860; + int i861; + int i862; + int i863; + int i864; + int i865; + int i866; + int i867; + int i868; + int i869; + int i870; + int i871; + int i872; + int i873; + int i874; + int i875; + int i876; + int i877; + int i878; + int i879; + int i880; + int i881; + int i882; + int i883; + int i884; + int i885; + int i886; + int i887; + int i888; + int i889; + int i890; + int i891; + int i892; + int i893; + int i894; + int i895; + int i896; + int i897; + int i898; + int i899; + int i900; + int i901; + int i902; + int i903; + int i904; + int i905; + int i906; + int i907; + int i908; + int i909; + int i910; + int i911; + int i912; + int i913; + int i914; + int i915; + int i916; + int i917; + int i918; + int i919; + int i920; + int i921; + int i922; + int i923; + int i924; + int i925; + int i926; + int i927; + int i928; + int i929; + int i930; + int i931; + int i932; + int i933; + int i934; + int i935; + int i936; + int i937; + int i938; + int i939; + int i940; + int i941; + int i942; + int i943; + int i944; + int i945; + int i946; + int i947; + int i948; + int i949; + int i950; + int i951; + int i952; + int i953; + int i954; + int i955; + int i956; + int i957; + int i958; + int i959; + int i960; + int i961; + int i962; + int i963; + int i964; + int i965; + int i966; + int i967; + int i968; + int i969; + int i970; + int i971; + int i972; + int i973; + int i974; + int i975; + int i976; + int i977; + int i978; + int i979; + int i980; + int i981; + int i982; + int i983; + int i984; + int i985; + int i986; + int i987; + int i988; + int i989; + int i990; + int i991; + int i992; + int i993; + int i994; + int i995; + int i996; + int i997; + int i998; + int i999; + int i1000; + int i1001; + int i1002; + int i1003; + int i1004; + int i1005; + int i1006; + int i1007; + int i1008; + int i1009; + int i1010; + int i1011; + int i1012; + int i1013; + int i1014; + int i1015; + int i1016; + int i1017; + int i1018; + int i1019; + int i1020; + int i1021; + int i1022; + int i1023; + int i1024; + int i1025; + int i1026; + int i1027; + int i1028; + int i1029; + int i1030; + int i1031; + int i1032; + int i1033; + int i1034; + int i1035; + int i1036; + int i1037; + int i1038; + int i1039; + int i1040; + int i1041; + int i1042; + int i1043; + int i1044; + int i1045; + int i1046; + int i1047; + int i1048; + int i1049; + int i1050; + int i1051; + int i1052; + int i1053; + int i1054; + int i1055; + int i1056; + int i1057; + int i1058; + int i1059; + int i1060; + int i1061; + int i1062; + int i1063; + int i1064; + int i1065; + int i1066; + int i1067; + int i1068; + int i1069; + int i1070; + int i1071; + int i1072; + int i1073; + int i1074; + int i1075; + int i1076; + int i1077; + int i1078; + int i1079; + int i1080; + int i1081; + int i1082; + int i1083; + int i1084; + int i1085; + int i1086; + int i1087; + int i1088; + int i1089; + int i1090; + int i1091; + int i1092; + int i1093; + int i1094; + int i1095; + int i1096; + int i1097; + int i1098; + int i1099; + int i1100; + int i1101; + int i1102; + int i1103; + int i1104; + int i1105; + int i1106; + int i1107; + int i1108; + int i1109; + int i1110; + int i1111; + int i1112; + int i1113; + int i1114; + int i1115; + int i1116; + int i1117; + int i1118; + int i1119; + int i1120; + int i1121; + int i1122; + int i1123; + int i1124; + int i1125; + int i1126; + int i1127; + int i1128; + int i1129; + int i1130; + int i1131; + int i1132; + int i1133; + int i1134; + int i1135; + int i1136; + int i1137; + int i1138; + int i1139; + int i1140; + int i1141; + int i1142; + int i1143; + int i1144; + int i1145; + int i1146; + int i1147; + int i1148; + int i1149; + int i1150; + int i1151; + int i1152; + int i1153; + int i1154; + int i1155; + int i1156; + int i1157; + int i1158; + int i1159; + int i1160; + int i1161; + int i1162; + int i1163; + int i1164; + int i1165; + int i1166; + int i1167; + int i1168; + int i1169; + int i1170; + int i1171; + int i1172; + int i1173; + int i1174; + int i1175; + int i1176; + int i1177; + int i1178; + int i1179; + int i1180; + int i1181; + int i1182; + int i1183; + int i1184; + int i1185; + int i1186; + int i1187; + int i1188; + int i1189; + int i1190; + int i1191; + int i1192; + int i1193; + int i1194; + int i1195; + int i1196; + int i1197; + int i1198; + int i1199; + int i1200; + int i1201; + int i1202; + int i1203; + int i1204; + int i1205; + int i1206; + int i1207; + int i1208; + int i1209; + int i1210; + int i1211; + int i1212; + int i1213; + int i1214; + int i1215; + int i1216; + int i1217; + int i1218; + int i1219; + int i1220; + int i1221; + int i1222; + int i1223; + int i1224; + int i1225; + int i1226; + int i1227; + int i1228; + int i1229; + int i1230; + int i1231; + int i1232; + int i1233; + int i1234; + int i1235; + int i1236; + int i1237; + int i1238; + int i1239; + int i1240; + int i1241; + int i1242; + int i1243; + int i1244; + int i1245; + int i1246; + int i1247; + int i1248; + int i1249; + int i1250; + int i1251; + int i1252; + int i1253; + int i1254; + int i1255; + int i1256; + int i1257; + int i1258; + int i1259; + int i1260; + int i1261; + int i1262; + int i1263; + int i1264; + int i1265; + int i1266; + int i1267; + int i1268; + int i1269; + int i1270; + int i1271; + int i1272; + int i1273; + int i1274; + int i1275; + int i1276; + int i1277; + int i1278; + int i1279; + int i1280; + int i1281; + int i1282; + int i1283; + int i1284; + int i1285; + int i1286; + int i1287; + int i1288; + int i1289; + int i1290; + int i1291; + int i1292; + int i1293; + int i1294; + int i1295; + int i1296; + int i1297; + int i1298; + int i1299; + int i1300; + int i1301; + int i1302; + int i1303; + int i1304; + int i1305; + int i1306; + int i1307; + int i1308; + int i1309; + int i1310; + int i1311; + int i1312; + int i1313; + int i1314; + int i1315; + int i1316; + int i1317; + int i1318; + int i1319; + int i1320; + int i1321; + int i1322; + int i1323; + int i1324; + int i1325; + int i1326; + int i1327; + int i1328; + int i1329; + int i1330; + int i1331; + int i1332; + int i1333; + int i1334; + int i1335; + int i1336; + int i1337; + int i1338; + int i1339; + int i1340; + int i1341; + int i1342; + int i1343; + int i1344; + int i1345; + int i1346; + int i1347; + int i1348; + int i1349; + int i1350; + int i1351; + int i1352; + int i1353; + int i1354; + int i1355; + int i1356; + int i1357; + int i1358; + int i1359; + int i1360; + int i1361; + int i1362; + int i1363; + int i1364; + int i1365; + int i1366; + int i1367; + int i1368; + int i1369; + int i1370; + int i1371; + int i1372; + int i1373; + int i1374; + int i1375; + int i1376; + int i1377; + int i1378; + int i1379; + int i1380; + int i1381; + int i1382; + int i1383; + int i1384; + int i1385; + int i1386; + int i1387; + int i1388; + int i1389; + int i1390; + int i1391; + int i1392; + int i1393; + int i1394; + int i1395; + int i1396; + int i1397; + int i1398; + int i1399; + int i1400; + int i1401; + int i1402; + int i1403; + int i1404; + int i1405; + int i1406; + int i1407; + int i1408; + int i1409; + int i1410; + int i1411; + int i1412; + int i1413; + int i1414; + int i1415; + int i1416; + int i1417; + int i1418; + int i1419; + int i1420; + int i1421; + int i1422; + int i1423; + int i1424; + int i1425; + int i1426; + int i1427; + int i1428; + int i1429; + int i1430; + int i1431; + int i1432; + int i1433; + int i1434; + int i1435; + int i1436; + int i1437; + int i1438; + int i1439; + int i1440; + int i1441; + int i1442; + int i1443; + int i1444; + int i1445; + int i1446; + int i1447; + int i1448; + int i1449; + int i1450; + int i1451; + int i1452; + int i1453; + int i1454; + int i1455; + int i1456; + int i1457; + int i1458; + int i1459; + int i1460; + int i1461; + int i1462; + int i1463; + int i1464; + int i1465; + int i1466; + int i1467; + int i1468; + int i1469; + int i1470; + int i1471; + int i1472; + int i1473; + int i1474; + int i1475; + int i1476; + int i1477; + int i1478; + int i1479; + int i1480; + int i1481; + int i1482; + int i1483; + int i1484; + int i1485; + int i1486; + int i1487; + int i1488; + int i1489; + int i1490; + int i1491; + int i1492; + int i1493; + int i1494; + int i1495; + int i1496; + int i1497; + int i1498; + int i1499; + int i1500; + int i1501; + int i1502; + int i1503; + int i1504; + int i1505; + int i1506; + int i1507; + int i1508; + int i1509; + int i1510; + int i1511; + int i1512; + int i1513; + int i1514; + int i1515; + int i1516; + int i1517; + int i1518; + int i1519; + int i1520; + int i1521; + int i1522; + int i1523; + int i1524; + int i1525; + int i1526; + int i1527; + int i1528; + int i1529; + int i1530; + int i1531; + int i1532; + int i1533; + int i1534; + int i1535; + int i1536; + int i1537; + int i1538; + int i1539; + int i1540; + int i1541; + int i1542; + int i1543; + int i1544; + int i1545; + int i1546; + int i1547; + int i1548; + int i1549; + int i1550; + int i1551; + int i1552; + int i1553; + int i1554; + int i1555; + int i1556; + int i1557; + int i1558; + int i1559; + int i1560; + int i1561; + int i1562; + int i1563; + int i1564; + int i1565; + int i1566; + int i1567; + int i1568; + int i1569; + int i1570; + int i1571; + int i1572; + int i1573; + int i1574; + int i1575; + int i1576; + int i1577; + int i1578; + int i1579; + int i1580; + int i1581; + int i1582; + int i1583; + int i1584; + int i1585; + int i1586; + int i1587; + int i1588; + int i1589; + int i1590; + int i1591; + int i1592; + int i1593; + int i1594; + int i1595; + int i1596; + int i1597; + int i1598; + int i1599; + int i1600; + int i1601; + int i1602; + int i1603; + int i1604; + int i1605; + int i1606; + int i1607; + int i1608; + int i1609; + int i1610; + int i1611; + int i1612; + int i1613; + int i1614; + int i1615; + int i1616; + int i1617; + int i1618; + int i1619; + int i1620; + int i1621; + int i1622; + int i1623; + int i1624; + int i1625; + int i1626; + int i1627; + int i1628; + int i1629; + int i1630; + int i1631; + int i1632; + int i1633; + int i1634; + int i1635; + int i1636; + int i1637; <