Skip to content

Commit 6ed940b

Browse files
Boris UlasevichPaul Hohensee
authored andcommitted
8320682: [AArch64] C1 compilation fails with "Field too big for insn"
Reviewed-by: phh Backport-of: 69014cd55b59a0a63f4918fad575a6887640573e
1 parent fbfe11f commit 6ed940b

File tree

2 files changed

+71
-2
lines changed

2 files changed

+71
-2
lines changed

src/hotspot/share/c1/c1_globals.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -275,9 +275,11 @@
275275
develop(bool, InstallMethods, true, \
276276
"Install methods at the end of successful compilations") \
277277
\
278+
/* The compiler assumes, in many places, that methods are at most 1MB. */ \
279+
/* Therefore, we restrict this flag to at most 1MB. */ \
278280
develop(intx, NMethodSizeLimit, (64*K)*wordSize, \
279281
"Maximum size of a compiled method.") \
280-
range(0, max_jint) \
282+
range(0, 1*M) \
281283
\
282284
develop(bool, TraceFPUStack, false, \
283285
"Trace emulation of the FPU stack (intel only)") \
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/**
25+
* @test
26+
* @bug 8316653
27+
* @requires vm.debug
28+
* @summary Test flag with max value.
29+
*
30+
* @run main/othervm -XX:NMethodSizeLimit=1M
31+
* compiler.arguments.TestC1Globals
32+
*/
33+
34+
/**
35+
* @test
36+
* @bug 8318817
37+
* @requires vm.debug
38+
* @requires os.family == "linux"
39+
* @summary Test flag with max value combined with transparent huge pages on
40+
* Linux.
41+
*
42+
* @run main/othervm -XX:NMethodSizeLimit=1M
43+
* -XX:+UseTransparentHugePages
44+
* compiler.arguments.TestC1Globals
45+
*/
46+
47+
/**
48+
* @test
49+
* @bug 8320682
50+
* @requires vm.debug
51+
* @summary Test flag with max value and specific compilation.
52+
*
53+
* @run main/othervm -XX:NMethodSizeLimit=1M
54+
* -XX:CompileOnly=java.util.HashMap::putMapEntries
55+
* -Xcomp
56+
* compiler.arguments.TestC1Globals
57+
*
58+
*/
59+
60+
package compiler.arguments;
61+
62+
public class TestC1Globals {
63+
64+
public static void main(String args[]) {
65+
System.out.println("Passed");
66+
}
67+
}

0 commit comments

Comments
 (0)