From 1f9273ca3b5f7cec2867c48b9a10446d40ed2d30 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Thu, 7 Apr 2016 16:51:21 +0200 Subject: [PATCH 1/3] 8153514: Whitebox API should allow compilation of Added Whitebox API method to trigger compilation of static initializer. Reviewed-by: zmajo, kvn, iignatyev --- test/lib/sun/hotspot/WhiteBox.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java index f2c85fb95a1..e706574359a 100644 --- a/test/lib/sun/hotspot/WhiteBox.java +++ b/test/lib/sun/hotspot/WhiteBox.java @@ -307,6 +307,11 @@ public class WhiteBox { Objects.requireNonNull(method); return enqueueMethodForCompilation0(method, compLevel, entry_bci); } + private native boolean enqueueInitializerForCompilation0(Class aClass, int compLevel); + public boolean enqueueInitializerForCompilation(Class aClass, int compLevel) { + Objects.requireNonNull(aClass); + return enqueueInitializerForCompilation0(aClass, compLevel); + } private native void clearMethodState0(Executable method); public void clearMethodState(Executable method) { Objects.requireNonNull(method); From 147073aa09e7b68d548c1287608c231b3c7db691 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Tue, 19 Apr 2016 13:19:41 +0200 Subject: [PATCH 2/3] 8154251: ANSI-C Quoting bug in hotspot.m4 during configure on SLES 10 and 11 Reviewed-by: erikj --- common/autoconf/generated-configure.sh | 15 +++++++++++---- common/autoconf/hotspot.m4 | 13 ++++++++++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 69e7160dfa3..d1d9b90a0f5 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -5056,7 +5056,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1460538705 +DATE_WHEN_GENERATED=1461064700 ############################################################################### # @@ -16277,7 +16277,10 @@ $as_echo "$JVM_VARIANTS" >&6; } # Check that the selected variants are valid # grep filter function inspired by a comment to http://stackoverflow.com/a/1617326 - INVALID_VARIANTS=`$GREP -Fvx "${VALID_JVM_VARIANTS// /$'\n'}" <<< "${JVM_VARIANTS// /$'\n'}"` + # Notice that the original variant failes on SLES 10 and 11 + NEEDLE=${VALID_JVM_VARIANTS// /$'\n'} + STACK=${JVM_VARIANTS// /$'\n'} + INVALID_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"` if test "x$INVALID_VARIANTS" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Unknown variant(s) specified: $INVALID_VARIANTS" >&5 $as_echo "$as_me: Unknown variant(s) specified: $INVALID_VARIANTS" >&6;} @@ -16286,7 +16289,9 @@ $as_echo "$as_me: Unknown variant(s) specified: $INVALID_VARIANTS" >&6;} # All "special" variants share the same output directory ("server") VALID_MULTIPLE_JVM_VARIANTS="server client minimal" - INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}" <<< "${JVM_VARIANTS// /$'\n'}"` + NEEDLE=${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'} + STACK=${JVM_VARIANTS// /$'\n'} + INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"` if test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then as_fn_error $? "You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS." "$LINENO" 5 fi @@ -65556,7 +65561,9 @@ $as_echo_n "checking JVM features for JVM variant '$variant'... " >&6; } JVM_FEATURES_TO_TEST=${!features_var_name} { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JVM_FEATURES_TO_TEST" >&5 $as_echo "$JVM_FEATURES_TO_TEST" >&6; } - INVALID_FEATURES=`$GREP -Fvx "${VALID_JVM_FEATURES// /$'\n'}" <<< "${JVM_FEATURES_TO_TEST// /$'\n'}"` + NEEDLE=${VALID_JVM_FEATURES// /$'\n'} + STACK=${JVM_FEATURES_TO_TEST// /$'\n'} + INVALID_FEATURES=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"` if test "x$INVALID_FEATURES" != x; then as_fn_error $? "Invalid JVM feature(s): $INVALID_FEATURES" "$LINENO" 5 fi diff --git a/common/autoconf/hotspot.m4 b/common/autoconf/hotspot.m4 index 4fffa86983d..1917624df7a 100644 --- a/common/autoconf/hotspot.m4 +++ b/common/autoconf/hotspot.m4 @@ -93,7 +93,10 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS], # Check that the selected variants are valid # grep filter function inspired by a comment to http://stackoverflow.com/a/1617326 - INVALID_VARIANTS=`$GREP -Fvx "${VALID_JVM_VARIANTS// /$'\n'}" <<< "${JVM_VARIANTS// /$'\n'}"` + # Notice that the original variant failes on SLES 10 and 11 + NEEDLE=${VALID_JVM_VARIANTS// /$'\n'} + STACK=${JVM_VARIANTS// /$'\n'} + INVALID_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"` if test "x$INVALID_VARIANTS" != x; then AC_MSG_NOTICE([Unknown variant(s) specified: $INVALID_VARIANTS]) AC_MSG_ERROR([The available JVM variants are: $VALID_JVM_VARIANTS]) @@ -101,7 +104,9 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS], # All "special" variants share the same output directory ("server") VALID_MULTIPLE_JVM_VARIANTS="server client minimal" - INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}" <<< "${JVM_VARIANTS// /$'\n'}"` + NEEDLE=${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'} + STACK=${JVM_VARIANTS// /$'\n'} + INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"` if test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.]) fi @@ -293,7 +298,9 @@ AC_DEFUN_ONCE([HOTSPOT_VALIDATE_JVM_FEATURES], features_var_name=JVM_FEATURES_$variant JVM_FEATURES_TO_TEST=${!features_var_name} AC_MSG_RESULT([$JVM_FEATURES_TO_TEST]) - INVALID_FEATURES=`$GREP -Fvx "${VALID_JVM_FEATURES// /$'\n'}" <<< "${JVM_FEATURES_TO_TEST// /$'\n'}"` + NEEDLE=${VALID_JVM_FEATURES// /$'\n'} + STACK=${JVM_FEATURES_TO_TEST// /$'\n'} + INVALID_FEATURES=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"` if test "x$INVALID_FEATURES" != x; then AC_MSG_ERROR([Invalid JVM feature(s): $INVALID_FEATURES]) fi From df65dd52dedf155207b42602233ec0acf89ce4ca Mon Sep 17 00:00:00 2001 From: Kirill Zhaldybin Date: Wed, 20 Apr 2016 19:16:32 +0300 Subject: [PATCH 3/3] 8135200: Add White Box method that enumerates G1 old regions with less than specified liveness and collects statistics Reviewed-by: tschatzl, dfazunen, iignatyev --- test/lib/sun/hotspot/WhiteBox.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java index f2c85fb95a1..ea94568a8d4 100644 --- a/test/lib/sun/hotspot/WhiteBox.java +++ b/test/lib/sun/hotspot/WhiteBox.java @@ -192,6 +192,16 @@ public class WhiteBox { public native long psVirtualSpaceAlignment(); public native long psHeapGenerationAlignment(); + /** + * Enumerates old regions with liveness less than specified and produces some statistics + * @param liveness percent of region's liveness (live_objects / total_region_size * 100). + * @return long[3] array where long[0] - total count of old regions + * long[1] - total memory of old regions + * long[2] - lowest estimation of total memory of old regions to be freed (non-full + * regions are not included) + */ + public native long[] g1GetMixedGCInfo(int liveness); + // NMT public native long NMTMalloc(long size); public native void NMTFree(long mem);