diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index 6298bcae416..1a6a040965b 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -93,8 +93,25 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS], ) fi - CFLAGS_DEBUG_SYMBOLS="-g -gdwarf-4" - ASFLAGS_DEBUG_SYMBOLS="-g" + # Enough to produce viable backtrace without blowing up debug info size. + GCC_DEBUG_LEVEL=1 + + case $DEBUG_LEVEL in + slowdebug ) + # Default to produce debuggable binaries + GCC_DEBUG_LEVEL=2 + ;; + esac + + UTIL_ARG_WITH(NAME: gcc-debug-level, TYPE: string, + DEFAULT: ${GCC_DEBUG_LEVEL}, + RESULT: GCC_DEBUG_LEVEL, + DESC: [Sets the GCC debug level, when debug info generation is enabled], + DEFAULT_DESC: [from build debug level]) + AC_SUBST(GCC_DEBUG_LEVEL) + + CFLAGS_DEBUG_SYMBOLS="-gdwarf-4 -g${GCC_DEBUG_LEVEL}" + ASFLAGS_DEBUG_SYMBOLS="-g${GCC_DEBUG_LEVEL}" elif test "x$TOOLCHAIN_TYPE" = xclang; then if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then # Check if compiler supports -fdebug-prefix-map. If so, use that to make diff --git a/make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java b/make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java index fe5938ce0e3..220face0868 100644 --- a/make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java +++ b/make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java @@ -282,6 +282,8 @@ public void createSymbols(String ctDescriptionFileExtra, String ctDescriptionFil try (OutputStream fos = new FileOutputStream(ctSymLocation); OutputStream bos = new BufferedOutputStream(fos); ZipOutputStream jos = new ZipOutputStream(bos)) { + // Do not compress ct.sym, allow external compressor to work on it. + jos.setLevel(0); for (Entry> e : directory2FileData.entrySet()) { jos.putNextEntry(createZipEntry(e.getKey(), timestamp)); for (FileData fd : e.getValue()) { diff --git a/src/hotspot/share/compiler/compiler_globals.hpp b/src/hotspot/share/compiler/compiler_globals.hpp index 3919c596d74..fa5cd97c540 100644 --- a/src/hotspot/share/compiler/compiler_globals.hpp +++ b/src/hotspot/share/compiler/compiler_globals.hpp @@ -388,6 +388,11 @@ "If compilation is stopped with an error, capture diagnostic " \ "information at the bailout point") \ \ + product(bool, InlineColdMethods, false, DIAGNOSTIC, \ + "Inline cold methods that would otherwise be rejected based" \ + "on profile information. Only useful for compiler testing.") \ + \ + // end of COMPILER_FLAGS DECLARE_FLAGS(COMPILER_FLAGS) diff --git a/src/hotspot/share/opto/bytecodeInfo.cpp b/src/hotspot/share/opto/bytecodeInfo.cpp index 5b48b33aa46..98f5cb23990 100644 --- a/src/hotspot/share/opto/bytecodeInfo.cpp +++ b/src/hotspot/share/opto/bytecodeInfo.cpp @@ -295,6 +295,11 @@ bool InlineTree::should_not_inline(ciMethod* callee_method, ciMethod* caller_met return false; } + // accept cold methods if requested + if (InlineColdMethods) { + return false; + } + // don't use counts with -Xcomp if (UseInterpreter) { if (!callee_method->has_compiled_code() && @@ -331,6 +336,9 @@ bool InlineTree::is_not_reached(ciMethod* callee_method, ciMethod* caller_method if (!UseInterpreter) { return false; // -Xcomp } + if (InlineColdMethods) { + return false; // CTW + } if (profile.count() > 0) { return false; // reachable according to profile } diff --git a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java index 11694f72837..6a5d9d4e950 100644 --- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java +++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java @@ -307,6 +307,8 @@ private String[] cmd(long classStart, long classStop) { // Expand the optimization scope by disallowing most traps. "-XX:PerMethodTrapLimit=0", "-XX:PerMethodSpecTrapLimit=0", + // Artificially expand the scope of inlining in the absence of reasonable profile. + "-XX:+InlineColdMethods", // Do not pay extra stack trace generation cost for normally thrown exceptions "-XX:-StackTraceInThrowable", "-XX:+IgnoreUnrecognizedVMOptions",