--- old/test/hotspot/jtreg/TEST.ROOT 2019-01-23 10:47:47.000000000 -0800 +++ new/test/hotspot/jtreg/TEST.ROOT 2019-01-23 10:47:47.000000000 -0800 @@ -59,6 +59,7 @@ vm.rtm.cpu \ vm.rtm.compiler \ vm.aot \ + vm.aot.modules \ vm.cds \ vm.cds.custom.loaders \ vm.cds.archived.java.heap \ --- old/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMulAdd.java 2019-01-23 10:47:51.000000000 -0800 +++ new/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMulAdd.java 2019-01-23 10:47:50.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, 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 @@ -25,6 +25,8 @@ * @test * @bug 8081778 * @summary Add C2 x86 intrinsic for BigInteger::mulAdd() method + * @comment the test disables intrinsics, so can't be run w/ AOT'ed java.base + * @requires !(vm.aot.modules ~= " java\\.base ") * * @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch * -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-UseSquareToLenIntrinsic -XX:-UseMultiplyToLenIntrinsic --- old/test/jtreg-ext/requires/VMProps.java 2019-01-23 10:47:53.000000000 -0800 +++ new/test/jtreg-ext/requires/VMProps.java 2019-01-23 10:47:53.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, 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 @@ -31,6 +31,7 @@ import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -86,6 +87,7 @@ map.put("vm.rtm.cpu", vmRTMCPU()); map.put("vm.rtm.compiler", vmRTMCompiler()); map.put("vm.aot", vmAOT()); + map.put("vm.aot.modules", vmAotModules()); // vm.cds is true if the VM is compiled with cds support. map.put("vm.cds", vmCDS()); map.put("vm.cds.custom.loaders", vmCDSForCustomLoaders()); @@ -334,6 +336,33 @@ return "" + Files.exists(jaotc); } + /* + * @return a space-separeted list of AOT'ed modules with a space character + * at the beginning and end, or an empty string if there are none. + */ + protected String vmAotModules() { + String modules = System.getenv().get("TEST_OPTS_AOT_MODULES"); + if (modules == null || modules.equals("")) { + // there is nothing in 'TEST_OPTS_AOT_MODULES', let's try 'JTREG' + String e = System.getenv().get("JTREG"); + if (e == null) { + return ""; + } + + // 'JTREG' is a semicolon-separated list of '=' pairs + modules = Arrays.stream(e.split(";")) + .filter(s -> "AOT_MODULES".equals(s.substring(0, s.indexOf("=")))) + .map(s -> s.substring(s.indexOf("=") + 1)) + .findAny() + .orElse(null); + } + + if (modules != null && !"".equals(modules)) { + return " " + modules.trim() + " "; + } + return ""; + } + /** * Check for CDS support. *