< prev index next >

test/hotspot/jtreg/compiler/sharedstubs/SharedTrampolineTest.java

Print this page
@@ -26,10 +26,11 @@
   * @test SharedTrampolineTest id=C2
   * @summary Checks that trampolines can be shared for static method.
   * @bug 8280152
   * @library /test/lib
   *
+  * @requires vm.compiler2.enabled
   * @requires vm.opt.TieredCompilation == null
   * @requires os.arch=="aarch64" | os.arch=="riscv64"
   * @requires vm.debug
   *
   * @run driver compiler.sharedstubs.SharedTrampolineTest -XX:-TieredCompilation

@@ -44,13 +45,14 @@
  import jdk.test.lib.process.ProcessTools;
  
  public class SharedTrampolineTest {
      private final static int ITERATIONS_TO_HEAT_LOOP = 20_000;
  
-     private static void runTest(String test) throws Exception {
+     private static void runTest(String compiler, String test) throws Exception {
          String testClassName = SharedTrampolineTest.class.getName() + "$" + test;
          ArrayList<String> command = new ArrayList<String>();
+         command.add(compiler);
          command.add("-XX:+UnlockDiagnosticVMOptions");
          command.add("-Xbatch");
          command.add("-XX:+PrintRelocations");
          command.add("-XX:CompileCommand=compileonly," + testClassName + "::" + "test");
          command.add("-XX:CompileCommand=dontinline," + testClassName + "::" + "test");

@@ -70,11 +72,11 @@
      }
  
      public static void main(String[] args) throws Exception {
          String[] tests = new String[] {"StaticMethodTest"};
          for (String test : tests) {
-             runTest(test);
+             runTest(args[0], test);
          }
      }
  
      private static void checkOutput(OutputAnalyzer output) {
          List<String> addrs = Pattern.compile("\\(trampoline_stub\\) addr=(\\w+) .*\\[trampoline owner")
< prev index next >