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 jdk.test.lib.jittester;
25
26 import java.util.ArrayList;
27 import java.util.List;
28 import java.util.function.Function;
29
30 public class AotTestGeneratorsFactory implements Function<String[], List<TestsGenerator>> {
31 private static final String AOT_OPTIONS = "-XX:+UseAOT -XX:AOTLibrary=./aottest.so";
32 private static final String AOT_COMPILER_BUILD_ACTION
33 = "@build compiler.aot.AotCompiler";
34 private static final String AOT_COMPILER_RUN_ACTION_PREFIX
35 = "@run driver compiler.aot.AotCompiler -libname aottest.so -class ";
36
37 @Override
38 public List<TestsGenerator> apply(String[] input) {
39 List<TestsGenerator> result = new ArrayList<>();
40 for (String generatorName : input) {
41 switch (generatorName) {
42 case "ByteCode":
43 result.add(new ByteCodeGenerator("aot_bytecode_tests",
44 AotTestGeneratorsFactory::generateBytecodeHeader, AOT_OPTIONS));
45 break;
46 case "JavaCode":
47 result.add(new JavaCodeGenerator("aot_java_tests",
48 AotTestGeneratorsFactory::generateJavaHeader, AOT_OPTIONS));
49 break;
50 default:
51 throw new IllegalArgumentException("Unknown generator: " + generatorName);
52 }
53 }
54 return result;
55 }
|
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 jdk.test.lib.jittester;
25
26 import java.util.ArrayList;
27 import java.util.List;
28 import java.util.function.Function;
29
30 public class AotTestGeneratorsFactory implements Function<String[], List<TestsGenerator>> {
31 private static final String AOT_OPTIONS = "-XX:+UseAOT -XX:AOTLibrary=./aottest.so";
32 private static final String AOT_COMPILER_BUILD_ACTION
33 = "@build compiler.aot.AotCompiler";
34 private static final String AOT_COMPILER_RUN_ACTION_PREFIX
35 = "@run driver compiler.aot.AotCompiler -extraopt -Xmixed -libname aottest.so -class ";
36
37 @Override
38 public List<TestsGenerator> apply(String[] input) {
39 List<TestsGenerator> result = new ArrayList<>();
40 for (String generatorName : input) {
41 switch (generatorName) {
42 case "ByteCode":
43 result.add(new ByteCodeGenerator("aot_bytecode_tests",
44 AotTestGeneratorsFactory::generateBytecodeHeader, AOT_OPTIONS));
45 break;
46 case "JavaCode":
47 result.add(new JavaCodeGenerator("aot_java_tests",
48 AotTestGeneratorsFactory::generateJavaHeader, AOT_OPTIONS));
49 break;
50 default:
51 throw new IllegalArgumentException("Unknown generator: " + generatorName);
52 }
53 }
54 return result;
55 }
|