1 /*
2 * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2016, 2018 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #ifndef CPU_S390_GLOBALS_S390_HPP
27 #define CPU_S390_GLOBALS_S390_HPP
28
29 #include "utilities/globalDefinitions.hpp"
30 #include "utilities/macros.hpp"
31
32 // Sets the default values for platform dependent flags used by the runtime system.
33 // (see globals.hpp)
34
35 define_pd_global(bool, ImplicitNullChecks, true); // Generate code for implicit null checks.
36 define_pd_global(bool, TrapBasedNullChecks, true);
37 define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap nulls passed to check cast.
38
39 define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_OR_JVMCI);
40
41 define_pd_global(size_t, CodeCacheSegmentSize, 256);
42 // This shall be at least 32 for proper branch target alignment.
43 // Ideally, this is 256 (cache line size). This keeps code end data
44 // on separate lines. But we reduced it to 64 since 256 increased
45 // code size significantly by padding nops between IVC and second UEP.
46 define_pd_global(uint, CodeEntryAlignment, 64);
47 define_pd_global(intx, OptoLoopAlignment, 2);
48 define_pd_global(intx, InlineSmallCode, 2000);
49
50 #define DEFAULT_STACK_YELLOW_PAGES (2)
51 #define DEFAULT_STACK_RED_PAGES (1)
52 // Java_java_net_SocketOutputStream_socketWrite0() uses a 64k buffer on the
53 // stack. To pass stack overflow tests we need 20 shadow pages.
54 #define DEFAULT_STACK_SHADOW_PAGES (20 DEBUG_ONLY(+4))
55 #define DEFAULT_STACK_RESERVED_PAGES (1)
56
57 #define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES
58 #define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES
59 #define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES
60 #define MIN_STACK_RESERVED_PAGES (0)
61
62 define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES);
63 define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES);
64 define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES);
65 define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES);
66
67 define_pd_global(bool, VMContinuations, false);
68
69 define_pd_global(bool, RewriteBytecodes, true);
70 define_pd_global(bool, RewriteFrequentPairs, true);
71
72 define_pd_global(bool, PreserveFramePointer, false);
73
74 define_pd_global(uintx, TypeProfileLevel, 111);
75
76 define_pd_global(bool, CompactStrings, true);
77
78 // 8146801 (Short Array Allocation): No performance work done here yet.
79 define_pd_global(intx, InitArrayShortSize, 1*BytesPerLong);
80
81 define_pd_global(bool, InlineTypePassFieldsAsArgs, false);
82 define_pd_global(bool, InlineTypeReturnedAsFields, false);
83
84 #define ARCH_FLAGS(develop, \
85 product, \
86 range, \
87 constraint) \
88 \
89 /* Reoptimize code-sequences of calls at runtime, e.g. replace an */ \
90 /* indirect call by a direct call. */ \
91 product(bool, ReoptimizeCallSequences, true, DIAGNOSTIC, \
92 "Reoptimize code-sequences of calls at runtime.") \
93 \
94 product(bool, UseByteReverseInstruction, true, DIAGNOSTIC, \
95 "Use byte reverse instruction.") \
96 \
97 product(bool, ExpandLoadingBaseDecode, true, DIAGNOSTIC, \
98 "Expand the assembler instruction required to load the base from " \
99 "DecodeN nodes during matching.") \
100 product(bool, ExpandLoadingBaseDecode_NN, true, DIAGNOSTIC, \
101 "Expand the assembler instruction required to load the base from " \
102 "DecodeN_NN nodes during matching.") \
103 product(bool, ExpandLoadingBaseEncode, true, DIAGNOSTIC, \
104 "Expand the assembler instruction required to load the base from " \
105 "EncodeP nodes during matching.") \
106 product(bool, ExpandLoadingBaseEncode_NN, true, DIAGNOSTIC, \
107 "Expand the assembler instruction required to load the base from " \
108 "EncodeP_NN nodes during matching.") \
109 \
110 /* Seems to pay off with 2 pages already. */ \
111 product(size_t, MVCLEThreshold, +2*(4*K), DIAGNOSTIC, \
112 "Threshold above which page-aligned MVCLE copy/init is used.") \
113 /* special instructions */ \
114 product(bool, SuperwordUseVX, false, \
115 "Use Z15 Vector instructions for superword optimization.") \
116 product(bool, UseSFPV, false, DIAGNOSTIC, \
117 "Use SFPV Vector instructions for superword optimization.") \
118 \
119 product(bool, PreferLAoverADD, false, DIAGNOSTIC, \
120 "Use LA/LAY instructions over ADD instructions (z/Architecture).") \
121 \
122 develop(bool, ZapEmptyStackFields, false, "Write 0x0101... to empty stack" \
123 " fields. Use this to ease stack debugging.") \
124 \
125 product(bool, TraceTraps, false, DIAGNOSTIC, \
126 "Trace all traps the signal handler handles.")
127
128 // end of ARCH_FLAGS
129
130 #endif // CPU_S390_GLOBALS_S390_HPP