# HG changeset patch # User kvn # Date 1533778714 25200 # Node ID 09cc8813ae51300dcada74746c50a9744edb0b74 # Parent 818768cd1c6c514bc71d753fb85c9109690d0e0d 8207965: C2-only debug build fails Reviewed-by: kvn, iignatyev Contributed-by: xxinliu@amazon.com diff -r 818768cd1c6c -r 09cc8813ae51 make/hotspot/src/native/dtrace/generateJvmOffsets.cpp --- a/make/hotspot/src/native/dtrace/generateJvmOffsets.cpp Wed Aug 08 15:34:32 2018 -0700 +++ b/make/hotspot/src/native/dtrace/generateJvmOffsets.cpp Wed Aug 08 18:38:34 2018 -0700 @@ -40,6 +40,7 @@ #include #include "gc/shared/collectedHeap.hpp" +#include "memory/heap.hpp" #include "runtime/vmStructs.hpp" typedef enum GEN_variant { diff -r 818768cd1c6c -r 09cc8813ae51 src/hotspot/share/aot/aotCodeHeap.cpp --- a/src/hotspot/share/aot/aotCodeHeap.cpp Wed Aug 08 15:34:32 2018 -0700 +++ b/src/hotspot/share/aot/aotCodeHeap.cpp Wed Aug 08 18:38:34 2018 -0700 @@ -714,7 +714,7 @@ void AOTCodeHeap::sweep_method(AOTCompiledMethod *aot) { int indexes[] = {aot->method_index()}; sweep_dependent_methods(indexes, 1); - vmassert(aot->method()->code() != aot && aot->method()->aot_code() == NULL, "method still active"); + vmassert(aot->method()->code() != aot TIERED_ONLY( && aot->method()->aot_code() == NULL), "method still active"); } diff -r 818768cd1c6c -r 09cc8813ae51 src/hotspot/share/aot/aotCompiledMethod.cpp --- a/src/hotspot/share/aot/aotCompiledMethod.cpp Wed Aug 08 15:34:32 2018 -0700 +++ b/src/hotspot/share/aot/aotCompiledMethod.cpp Wed Aug 08 18:38:34 2018 -0700 @@ -206,6 +206,7 @@ return true; } +#ifdef TIERED bool AOTCompiledMethod::make_entrant() { assert(!method()->is_old(), "reviving evolved method!"); assert(*_state_adr != not_entrant, "%s", method()->has_aot_code() ? "has_aot_code() not cleared" : "caller didn't check has_aot_code()"); @@ -240,6 +241,7 @@ return true; } +#endif // TIERED // We don't have full dependencies for AOT methods, so flushing is // more conservative than for nmethods. diff -r 818768cd1c6c -r 09cc8813ae51 src/hotspot/share/aot/aotCompiledMethod.hpp --- a/src/hotspot/share/aot/aotCompiledMethod.hpp Wed Aug 08 15:34:32 2018 -0700 +++ b/src/hotspot/share/aot/aotCompiledMethod.hpp Wed Aug 08 18:38:34 2018 -0700 @@ -194,7 +194,7 @@ virtual address verified_entry_point() const { return _code + _meta->verified_entry_offset(); } virtual void log_identity(xmlStream* stream) const; virtual void log_state_change() const; - virtual bool make_entrant(); + virtual bool make_entrant() NOT_TIERED({ ShouldNotReachHere(); return false; }); virtual bool make_not_entrant() { return make_not_entrant_helper(not_entrant); } virtual bool make_not_used() { return make_not_entrant_helper(not_used); } virtual address entry_point() const { return _code + _meta->entry_offset(); } diff -r 818768cd1c6c -r 09cc8813ae51 src/hotspot/share/compiler/compilerDirectives.cpp --- a/src/hotspot/share/compiler/compilerDirectives.cpp Wed Aug 08 15:34:32 2018 -0700 +++ b/src/hotspot/share/compiler/compilerDirectives.cpp Wed Aug 08 18:38:34 2018 -0700 @@ -442,7 +442,7 @@ char str[] = "*.*"; const char* error_msg = NULL; _default_directives->add_match(str, error_msg); -#ifdef COMPILER1 +#if defined(COMPILER1) || INCLUDE_JVMCI _default_directives->_c1_store->EnableOption = true; #endif #ifdef COMPILER2 diff -r 818768cd1c6c -r 09cc8813ae51 src/hotspot/share/gc/z/zBarrierSet.cpp --- a/src/hotspot/share/gc/z/zBarrierSet.cpp Wed Aug 08 15:34:32 2018 -0700 +++ b/src/hotspot/share/gc/z/zBarrierSet.cpp Wed Aug 08 18:38:34 2018 -0700 @@ -22,8 +22,12 @@ */ #include "precompiled.hpp" +#ifdef COMPILER1 #include "gc/z/c1/zBarrierSetC1.hpp" +#endif +#ifdef COMPILER2 #include "gc/z/c2/zBarrierSetC2.hpp" +#endif #include "gc/z/zBarrierSet.hpp" #include "gc/z/zBarrierSetAssembler.hpp" #include "gc/z/zGlobals.hpp" @@ -33,8 +37,8 @@ ZBarrierSet::ZBarrierSet() : BarrierSet(make_barrier_set_assembler(), - make_barrier_set_c1(), - make_barrier_set_c2(), + COMPILER1_PRESENT( make_barrier_set_c1() ) NOT_COMPILER1(NULL), + COMPILER2_PRESENT( make_barrier_set_c2() ) NOT_COMPILER2(NULL), BarrierSet::FakeRtti(BarrierSet::ZBarrierSet)) {} ZBarrierSetAssembler* ZBarrierSet::assembler() { diff -r 818768cd1c6c -r 09cc8813ae51 test/hotspot/jtreg/TEST.ROOT --- a/test/hotspot/jtreg/TEST.ROOT Wed Aug 08 15:34:32 2018 -0700 +++ b/test/hotspot/jtreg/TEST.ROOT Wed Aug 08 18:38:34 2018 -0700 @@ -62,6 +62,8 @@ vm.cds.custom.loaders \ vm.cds.archived.java.heap \ vm.graal.enabled \ + vm.compiler1.enabled \ + vm.compiler2.enabled \ docker.support # Minimum jtreg version diff -r 818768cd1c6c -r 09cc8813ae51 test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java --- a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java Wed Aug 08 15:34:32 2018 -0700 +++ b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java Wed Aug 08 18:38:34 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, 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 @@ -29,6 +29,7 @@ * * @build sun.hotspot.WhiteBox * @requires !(vm.cpu.features ~= ".*aes.*") + * @requires vm.compiler1.enabled | !vm.graal.enabled * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff -r 818768cd1c6c -r 09cc8813ae51 test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java --- a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java Wed Aug 08 15:34:32 2018 -0700 +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWait.java Wed Aug 08 18:38:34 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright 2016 Azul Systems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -40,29 +40,14 @@ public class TestOnSpinWait { public static void main(String[] args) throws Exception { - - // Test C1 compiler + // Test C2 compiler ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", - "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch", - "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", - "-XX:+PrintInlining", Launcher.class.getName()); - - OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); - - analyzer.shouldHaveExitValue(0); - - // The test is applicable only to C1 (present in Server VM). - analyzer.shouldContain("java.lang.Thread::onSpinWait (1 bytes) intrinsic"); - - // Test C2 compiler - pb = ProcessTools.createJavaProcessBuilder( - "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", Launcher.class.getName()); - analyzer = new OutputAnalyzer(pb.start()); + OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); analyzer.shouldHaveExitValue(0); diff -r 818768cd1c6c -r 09cc8813ae51 test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitC1.java Wed Aug 08 18:38:34 2018 -0700 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright 2016 Azul Systems, Inc. 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 TestOnSpinWaitC1 + * @summary (x86 only) checks that java.lang.Thread.onSpinWait is intrinsified + * @bug 8147844 + * @library /test/lib + * @modules java.base/jdk.internal.misc + * @requires os.arch=="x86" | os.arch=="amd64" | os.arch=="x86_64" + * @requires vm.compiler1.enabled + * @run driver compiler.onSpinWait.TestOnSpinWait + */ + +package compiler.onSpinWait; + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class TestOnSpinWaitC1 { + + public static void main(String[] args) throws Exception { + + // Test C1 compiler + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", + "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch", + "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", + "-XX:+PrintInlining", Launcher.class.getName()); + + OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); + + analyzer.shouldHaveExitValue(0); + analyzer.shouldContain("java.lang.Thread::onSpinWait (1 bytes) intrinsic"); + } + + static class Launcher { + + public static void main(final String[] args) throws Exception { + int end = 20_000; + + for (int i=0; i < end; i++) { + test(); + } + } + static void test() { + java.lang.Thread.onSpinWait(); + } + } +} diff -r 818768cd1c6c -r 09cc8813ae51 test/hotspot/jtreg/compiler/runtime/Test6859338.java --- a/test/hotspot/jtreg/compiler/runtime/Test6859338.java Wed Aug 08 15:34:32 2018 -0700 +++ b/test/hotspot/jtreg/compiler/runtime/Test6859338.java Wed Aug 08 18:38:34 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, 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 @@ -26,6 +26,7 @@ * @bug 6859338 * @summary Assertion failure in sharedRuntime.cpp * + * @requires vm.compiler1.enabled | !vm.graal.enabled * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions * -XX:-InlineObjectHash -Xbatch -XX:-ProfileInterpreter * compiler.runtime.Test6859338 diff -r 818768cd1c6c -r 09cc8813ae51 test/hotspot/jtreg/compiler/types/TestMeetIncompatibleInterfaceArrays.java --- a/test/hotspot/jtreg/compiler/types/TestMeetIncompatibleInterfaceArrays.java Wed Aug 08 15:34:32 2018 -0700 +++ b/test/hotspot/jtreg/compiler/types/TestMeetIncompatibleInterfaceArrays.java Wed Aug 08 18:38:34 2018 -0700 @@ -362,6 +362,12 @@ System.out.println((j + 1) + ". invokation of " + baseClassName + i + "ASM.test() [::" + r.getName() + "() should be '" + tier[pass][j] + "' compiled]"); + // Skip Profiling compilation (C1) when Tiered is disabled. + boolean profile = (level[pass][j] == CompilerWhiteBoxTest.COMP_LEVEL_FULL_PROFILE); + if (profile && CompilerWhiteBoxTest.skipOnTieredCompilation(false)) { + continue; + } + WB.enqueueMethodForCompilation(r, level[pass][j]); try { diff -r 818768cd1c6c -r 09cc8813ae51 test/hotspot/jtreg/compiler/whitebox/BlockingCompilation.java --- a/test/hotspot/jtreg/compiler/whitebox/BlockingCompilation.java Wed Aug 08 15:34:32 2018 -0700 +++ b/test/hotspot/jtreg/compiler/whitebox/BlockingCompilation.java Wed Aug 08 18:38:34 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 SAP SE. All rights reserved. + * Copyright (c) 2016, 2018, SAP SE. 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 @@ -25,6 +25,7 @@ * @test * @bug 8150646 8153013 * @summary Add support for blocking compiles through whitebox API + * @requires vm.compiler1.enabled | !vm.graal.enabled * @modules java.base/jdk.internal.misc * @library /test/lib / * @build sun.hotspot.WhiteBox diff -r 818768cd1c6c -r 09cc8813ae51 test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java Wed Aug 08 15:34:32 2018 -0700 +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java Wed Aug 08 18:38:34 2018 -0700 @@ -27,12 +27,12 @@ import java.util.ArrayList; import jdk.test.lib.apps.LingeredApp; - /** * @test * @bug 8193124 * @summary Test the clhsdb 'findpc' command * @requires vm.hasSA + * @requires vm.compiler1.enabled * @library /test/lib * @run main/othervm ClhsdbFindPC */ diff -r 818768cd1c6c -r 09cc8813ae51 test/hotspot/jtreg/vmTestbase/jit/tiered/tieredTest.sh --- a/test/hotspot/jtreg/vmTestbase/jit/tiered/tieredTest.sh Wed Aug 08 15:34:32 2018 -0700 +++ b/test/hotspot/jtreg/vmTestbase/jit/tiered/tieredTest.sh Wed Aug 08 18:38:34 2018 -0700 @@ -46,6 +46,11 @@ exit 0 fi +if grep "TieredCompilation not supported in this VM" $log; then + echo "TEST PASSED: Non-tiered Server VM. The test is useless" + exit 0 +fi + if ! egrep '^[0-9.]+: \[compile level=[0-9]' $log; then if [ "${tiered}" == "on" ]; then echo "TEST FAILED: No PrintTieredEvents output" diff -r 818768cd1c6c -r 09cc8813ae51 test/jdk/TEST.ROOT --- a/test/jdk/TEST.ROOT Wed Aug 08 15:34:32 2018 -0700 +++ b/test/jdk/TEST.ROOT Wed Aug 08 18:38:34 2018 -0700 @@ -39,6 +39,8 @@ java.runtime.name \ vm.gc.Z \ vm.graal.enabled \ + vm.compiler1.enabled \ + vm.compiler2.enabled \ vm.cds \ vm.hasSA \ vm.hasSAandCanAttach \ diff -r 818768cd1c6c -r 09cc8813ae51 test/jtreg-ext/requires/VMProps.java --- a/test/jtreg-ext/requires/VMProps.java Wed Aug 08 15:34:32 2018 -0700 +++ b/test/jtreg-ext/requires/VMProps.java Wed Aug 08 18:38:34 2018 -0700 @@ -92,6 +92,8 @@ map.put("vm.cds.archived.java.heap", vmCDSForArchivedJavaHeap()); // vm.graal.enabled is true if Graal is used as JIT map.put("vm.graal.enabled", isGraalEnabled()); + map.put("vm.compiler1.enabled", isCompiler1Enabled()); + map.put("vm.compiler2.enabled", isCompiler2Enabled()); map.put("docker.support", dockerSupport()); map.put("release.implementor", implementor()); vmGC(map); // vm.gc.X = true/false @@ -390,6 +392,23 @@ return Compiler.isGraalEnabled() ? "true" : "false"; } + /** + * Check if Compiler1 is present. + * + * @return true if Compiler1 is used as JIT compiler, either alone or as part of the tiered system. + */ + protected String isCompiler1Enabled() { + return Compiler.isC1Enabled() ? "true" : "false"; + } + + /** + * Check if Compiler2 is present. + * + * @return true if Compiler2 is used as JIT compiler, either alone or as part of the tiered system. + */ + protected String isCompiler2Enabled() { + return Compiler.isC2Enabled() ? "true" : "false"; + } /** * A simple check for docker support