1 /* 2 * Copyright (c) 2017, 2024, 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 package compiler.valhalla.inlinetypes; 25 26 import jdk.test.lib.Utils; 27 import compiler.lib.ir_framework.Scenario; 28 import compiler.lib.ir_framework.TestFramework; 29 30 public class InlineTypes { 31 public static final int rI = Utils.getRandomInstance().nextInt() % 1000; 32 public static final long rL = Utils.getRandomInstance().nextLong() % 1000; 33 public static final double rD = Utils.getRandomInstance().nextDouble() % 1000; 34 35 public static final Scenario[] DEFAULT_SCENARIOS = { 36 new Scenario(0, 37 "--enable-preview", 38 "--add-exports", "java.base/jdk.internal.value=ALL-UNNAMED", 39 "--add-exports", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED", 40 "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", 41 "-XX:+IgnoreUnrecognizedVMOptions", 42 "-XX:-UseACmpProfile", 43 "-XX:+AlwaysIncrementalInline", 44 "-XX:FlatArrayElementMaxOops=5", 45 "-XX:+UseArrayFlattening", 46 "-XX:-UseArrayLoadStoreProfile", 47 "-XX:+UseFieldFlattening", 48 "-XX:+InlineTypePassFieldsAsArgs", 49 "-XX:+InlineTypeReturnedAsFields" 50 ), 51 new Scenario(1, 52 "--enable-preview", 53 "--add-exports", "java.base/jdk.internal.value=ALL-UNNAMED", 54 "--add-exports", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED", 55 "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", 56 "-XX:+IgnoreUnrecognizedVMOptions", 57 "-XX:-UseACmpProfile", 58 "-XX:-UseCompressedOops", 59 "-XX:FlatArrayElementMaxOops=5", 60 "-XX:+UseArrayFlattening", 61 "-XX:-UseArrayLoadStoreProfile", 62 "-XX:+UseFieldFlattening", 63 "-XX:-InlineTypePassFieldsAsArgs", 64 "-XX:-InlineTypeReturnedAsFields" 65 ), 66 new Scenario(2, 67 "--enable-preview", 68 "--add-exports", "java.base/jdk.internal.value=ALL-UNNAMED", 69 "--add-exports", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED", 70 "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", 71 "-XX:+IgnoreUnrecognizedVMOptions", 72 "-XX:-UseACmpProfile", 73 "-XX:-UseCompressedOops", 74 "-XX:FlatArrayElementMaxOops=0", 75 "-XX:-UseArrayFlattening", 76 "-XX:-UseArrayLoadStoreProfile", 77 "-XX:+UseFieldFlattening", 78 "-XX:+InlineTypePassFieldsAsArgs", 79 "-XX:+InlineTypeReturnedAsFields", 80 "-XX:+StressInlineTypeReturnedAsFields" 81 ), 82 new Scenario(3, 83 "--enable-preview", 84 "--add-exports", "java.base/jdk.internal.value=ALL-UNNAMED", 85 "--add-exports", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED", 86 "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", 87 "-XX:+IgnoreUnrecognizedVMOptions", 88 "-DVerifyIR=false", 89 "-XX:+AlwaysIncrementalInline", 90 "-XX:FlatArrayElementMaxOops=0", 91 "-XX:-UseArrayFlattening", 92 "-XX:-UseFieldFlattening", 93 "-XX:+InlineTypePassFieldsAsArgs", 94 "-XX:+InlineTypeReturnedAsFields" 95 ), 96 new Scenario(4, 97 "--enable-preview", 98 "--add-exports", "java.base/jdk.internal.value=ALL-UNNAMED", 99 "--add-exports", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED", 100 "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", 101 "-XX:+IgnoreUnrecognizedVMOptions", 102 "-DVerifyIR=false", 103 "-XX:FlatArrayElementMaxOops=-1", 104 "-XX:+UseArrayFlattening", 105 "-XX:-UseFieldFlattening", 106 "-XX:+InlineTypePassFieldsAsArgs", 107 "-XX:-InlineTypeReturnedAsFields", 108 "-XX:-ReduceInitialCardMarks" 109 ), 110 new Scenario(5, 111 "--enable-preview", 112 "--add-exports", "java.base/jdk.internal.value=ALL-UNNAMED", 113 "--add-exports", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED", 114 "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", 115 "-XX:+IgnoreUnrecognizedVMOptions", 116 "-XX:-UseACmpProfile", 117 "-XX:+AlwaysIncrementalInline", 118 "-XX:FlatArrayElementMaxOops=5", 119 "-XX:+UseArrayFlattening", 120 "-XX:-UseArrayLoadStoreProfile", 121 "-XX:+UseFieldFlattening", 122 "-XX:-InlineTypePassFieldsAsArgs", 123 "-XX:-InlineTypeReturnedAsFields" 124 ) 125 }; 126 127 public static TestFramework getFramework() { 128 StackWalker walker = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE); 129 return new TestFramework(walker.getCallerClass()).setDefaultWarmup(251); 130 } 131 }