diff --git a/src/hotspot/share/c1/c1_globals.hpp b/src/hotspot/share/c1/c1_globals.hpp index 1c22cf16cfe79..4c73d7536b522 100644 --- a/src/hotspot/share/c1/c1_globals.hpp +++ b/src/hotspot/share/c1/c1_globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2023, 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 @@ -275,9 +275,11 @@ develop(bool, InstallMethods, true, \ "Install methods at the end of successful compilations") \ \ + /* The compiler assumes, in many places, that methods are at most 1MB. */ \ + /* Therefore, we restrict this flag to at most 1MB. */ \ develop(intx, NMethodSizeLimit, (64*K)*wordSize, \ "Maximum size of a compiled method.") \ - range(0, max_jint) \ + range(0, 1*M) \ \ develop(bool, TraceFPUStack, false, \ "Trace emulation of the FPU stack (intel only)") \ diff --git a/test/hotspot/jtreg/compiler/arguments/TestC1Globals.java b/test/hotspot/jtreg/compiler/arguments/TestC1Globals.java index b8ed2c36918ca..ff639a69bd937 100644 --- a/test/hotspot/jtreg/compiler/arguments/TestC1Globals.java +++ b/test/hotspot/jtreg/compiler/arguments/TestC1Globals.java @@ -21,33 +21,13 @@ * questions. */ -/** - * @test - * @bug 8318817 - * @requires vm.debug - * @summary Test flag with large value - * - * @run main/othervm -XX:NMethodSizeLimit=351658240 - * compiler.arguments.TestC1Globals - */ - -/** - * @test - * @bug 8318817 - * @requires vm.debug - * @summary Test flag with large value - * - * @run main/othervm -XX:NMethodSizeLimit=224001703 - * compiler.arguments.TestC1Globals - */ - /** * @test * @bug 8316653 * @requires vm.debug - * @summary Test flag with max value + * @summary Test flag with max value. * - * @run main/othervm -XX:NMethodSizeLimit=2147483647 + * @run main/othervm -XX:NMethodSizeLimit=1M * compiler.arguments.TestC1Globals */ @@ -56,25 +36,23 @@ * @bug 8318817 * @requires vm.debug * @requires os.family == "linux" - * @summary Test flag with large value combined with transparent huge pages on + * @summary Test flag with max value combined with transparent huge pages on * Linux. * - * @run main/othervm -XX:NMethodSizeLimit=351658240 + * @run main/othervm -XX:NMethodSizeLimit=1M * -XX:+UseTransparentHugePages * compiler.arguments.TestC1Globals - * */ /** * @test - * @bug 8318817 + * @bug 8320682 * @requires vm.debug - * @requires os.family == "linux" - * @summary Test flag with large value combined with transparent huge pages on - * Linux. + * @summary Test flag with max value and specific compilation. * - * @run main/othervm -XX:NMethodSizeLimit=224001703 - * -XX:+UseTransparentHugePages + * @run main/othervm -XX:NMethodSizeLimit=1M + * -XX:CompileOnly=java.util.HashMap::putMapEntries + * -Xcomp * compiler.arguments.TestC1Globals * */