changeset 898:2f7e02bfeb19

Expose @Fork.jvm(), rewire the handling of jvm/jvmArgs.
author shade
date Mon, 07 Jul 2014 16:11:37 +0400
parents 9cc73b474ede
children 90b9bf0da12d
files jmh-core/src/main/java/org/openjdk/jmh/annotations/Fork.java jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java jmh-core/src/main/java/org/openjdk/jmh/generators/core/MethodGroup.java jmh-core/src/main/java/org/openjdk/jmh/infra/BenchmarkParams.java jmh-core/src/main/java/org/openjdk/jmh/runner/BenchmarkListEntry.java jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java jmh-core/src/main/java/org/openjdk/jmh/util/Utils.java jmh-core/src/test/java/org/openjdk/jmh/results/TestAggregateResult.java jmh-core/src/test/java/org/openjdk/jmh/results/format/ResultFormatTest.java jmh-core/src/test/java/org/openjdk/jmh/runner/RunnerTest.java
diffstat 10 files changed, 107 insertions(+), 83 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/annotations/Fork.java	Thu Jul 03 16:12:50 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/annotations/Fork.java	Mon Jul 07 16:11:37 2014 +0400
@@ -55,6 +55,9 @@
     /** @return number of times harness should fork and ignore the results */
     int warmups() default BLANK_FORKS;
 
+    /** @return JVM executable to run with */
+    String jvm() default BLANK_ARGS;
+
     /** @return JVM arguments to replace in the command line */
     String[] jvmArgs() default { BLANK_ARGS };
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java	Thu Jul 03 16:12:50 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/BenchmarkGenerator.java	Mon Jul 07 16:11:37 2014 +0400
@@ -156,6 +156,7 @@
                             group.getMeasurementBatchSize(),
                             group.getForks(),
                             group.getWarmupForks(),
+                            group.getJvm(),
                             group.getJvmArgs(),
                             group.getJvmArgsPrepend(),
                             group.getJvmArgsAppend(),
--- a/jmh-core/src/main/java/org/openjdk/jmh/generators/core/MethodGroup.java	Thu Jul 03 16:12:50 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/generators/core/MethodGroup.java	Mon Jul 07 16:11:37 2014 +0400
@@ -216,6 +216,14 @@
         return Optional.none();
     }
 
+    public Optional<String> getJvm() {
+        Fork ann = getFinal(Fork.class);
+        if (ann != null && !(ann.jvm().equals(Fork.BLANK_ARGS))) {
+            return Optional.of(ann.jvm());
+        }
+        return Optional.none();
+    }
+
     public Optional<Collection<String>> getJvmArgs() {
         Fork ann = getFinal(Fork.class);
         if (ann != null && !(ann.jvmArgs().length == 1 && ann.jvmArgs()[0].equals(Fork.BLANK_ARGS))) {
--- a/jmh-core/src/main/java/org/openjdk/jmh/infra/BenchmarkParams.java	Thu Jul 03 16:12:50 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/infra/BenchmarkParams.java	Mon Jul 07 16:11:37 2014 +0400
@@ -61,7 +61,7 @@
         Utils.check(BenchmarkParams.class, "warmup", "measurement");
         Utils.check(BenchmarkParams.class, "mode", "params");
         Utils.check(BenchmarkParams.class, "timeUnit", "opsPerInvocation");
-        Utils.check(BenchmarkParams.class, "jvmArgsPrepend", "jvmArgs", "jvmArgsAppend");
+        Utils.check(BenchmarkParams.class, "jvm", "jvmArgs");
     }
 
     public BenchmarkParams(BenchmarkParams other) {
@@ -73,13 +73,13 @@
                              IterationParams warmup, IterationParams measurement,
                              Mode mode, WorkloadParams params,
                              TimeUnit timeUnit, int opsPerInvocation,
-                             Collection<String> jvmArgsPrepend, Collection<String> jvmArgs, Collection<String> jvmArgsAppend) {
+                             String jvm, Collection<String> jvmArgs) {
         super(benchmark, generatedTarget, synchIterations,
                 threads, threadGroups, forks, warmupForks,
                 warmup, measurement,
                 mode, params,
                 timeUnit, opsPerInvocation,
-                jvmArgsPrepend, jvmArgs, jvmArgsAppend);
+                jvm, jvmArgs);
     }
 }
 
@@ -90,13 +90,13 @@
                              IterationParams warmup, IterationParams measurement,
                              Mode mode, WorkloadParams params,
                              TimeUnit timeUnit, int opsPerInvocation,
-                             Collection<String> jvmArgsPrepend, Collection<String> jvmArgs, Collection<String> jvmArgsAppend) {
+                             String jvm, Collection<String> jvmArgs) {
         super(benchmark, generatedTarget, synchIterations,
                 threads, threadGroups, forks, warmupForks,
                 warmup, measurement,
                 mode, params,
                 timeUnit, opsPerInvocation,
-                jvmArgsPrepend, jvmArgs, jvmArgsAppend);
+                jvm, jvmArgs);
     }
 
     public BenchmarkParamsL4(BenchmarkParams other) {
@@ -127,13 +127,13 @@
                              IterationParams warmup, IterationParams measurement,
                              Mode mode, WorkloadParams params,
                              TimeUnit timeUnit, int opsPerInvocation,
-                             Collection<String> jvmArgsPrepend, Collection<String> jvmArgs, Collection<String> jvmArgsAppend) {
+                             String jvm, Collection<String> jvmArgs) {
         super(benchmark, generatedTarget, synchIterations,
                 threads, threadGroups, forks, warmupForks,
                 warmup, measurement,
                 mode, params,
                 timeUnit, opsPerInvocation,
-                jvmArgsPrepend, jvmArgs, jvmArgsAppend);
+                jvm, jvmArgs);
     }
 
     public BenchmarkParamsL3(BenchmarkParams other) {
@@ -178,16 +178,15 @@
     protected final WorkloadParams params;
     protected final TimeUnit timeUnit;
     protected final int opsPerInvocation;
-    protected final Collection<String> jvmArgsPrepend;
+    protected final String jvm;
     protected final Collection<String> jvmArgs;
-    protected final Collection<String> jvmArgsAppend;
 
     public BenchmarkParamsL2(String benchmark, String generatedTarget, boolean synchIterations,
                              int threads, int[] threadGroups, int forks, int warmupForks,
                              IterationParams warmup, IterationParams measurement,
                              Mode mode, WorkloadParams params,
                              TimeUnit timeUnit, int opsPerInvocation,
-                             Collection<String> jvmArgsPrepend, Collection<String> jvmArgs, Collection<String> jvmArgsAppend) {
+                             String jvm, Collection<String> jvmArgs) {
         this.benchmark = benchmark;
         this.generatedTarget = generatedTarget;
         this.synchIterations = synchIterations;
@@ -201,9 +200,8 @@
         this.params = params;
         this.timeUnit = timeUnit;
         this.opsPerInvocation = opsPerInvocation;
-        this.jvmArgsPrepend = jvmArgsPrepend;
+        this.jvm = jvm;
         this.jvmArgs = jvmArgs;
-        this.jvmArgsAppend = jvmArgsAppend;
     }
 
     public BenchmarkParamsL2(BenchmarkParams other) {
@@ -220,9 +218,8 @@
         this.params = other.params;
         this.timeUnit = other.timeUnit;
         this.opsPerInvocation = other.opsPerInvocation;
-        this.jvmArgsPrepend = other.jvmArgsPrepend;
+        this.jvm = other.jvm;
         this.jvmArgs = other.jvmArgs;
-        this.jvmArgsAppend = other.jvmArgsAppend;
     }
 
     /**
@@ -329,11 +326,8 @@
         return generatedTarget;
     }
 
-    /**
-     * @return prepended JVM options
-     */
-    public Collection<String> getJvmArgsPrepend() {
-        return Collections.unmodifiableCollection(jvmArgsPrepend);
+    public String getJvm() {
+        return jvm;
     }
 
     /**
@@ -343,13 +337,6 @@
         return Collections.unmodifiableCollection(jvmArgs);
     }
 
-    /**
-     * @return appended JVM options
-     */
-    public Collection<String> getJvmArgsAppend() {
-        return Collections.unmodifiableCollection(jvmArgsAppend);
-    }
-
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
@@ -401,4 +388,5 @@
         }
         return sb.toString();
     }
+
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/BenchmarkListEntry.java	Thu Jul 03 16:12:50 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/BenchmarkListEntry.java	Mon Jul 07 16:11:37 2014 +0400
@@ -52,6 +52,7 @@
     private final Optional<Integer> measurementBatchSize;
     private final Optional<Integer> forks;
     private final Optional<Integer> warmupForks;
+    private final Optional<String> jvm;
     private final Optional<Collection<String>> jvmArgs;
     private final Optional<Collection<String>> jvmArgsPrepend;
     private final Optional<Collection<String>> jvmArgsAppend;
@@ -64,7 +65,8 @@
     public BenchmarkListEntry(String userName, String generatedName, Mode mode, int[] threadGroups, Optional<Integer> threads,
                               Optional<Integer> warmupIterations, Optional<TimeValue> warmupTime, Optional<Integer> warmupBatchSize,
                               Optional<Integer> measurementIterations, Optional<TimeValue> measurementTime, Optional<Integer> measurementBatchSize,
-                              Optional<Integer> forks, Optional<Integer> warmupForks, Optional<Collection<String>> jvmArgs, Optional<Collection<String>> jvmArgsPrepend, Optional<Collection<String>> jvmArgsAppend,
+                              Optional<Integer> forks, Optional<Integer> warmupForks,
+                              Optional<String> jvm, Optional<Collection<String>> jvmArgs, Optional<Collection<String>> jvmArgsPrepend, Optional<Collection<String>> jvmArgsAppend,
                               Optional<Map<String, String[]>> params, Optional<TimeUnit> tu, Optional<Integer> opsPerInv) {
         this.userName = userName;
         this.generatedName = generatedName;
@@ -79,6 +81,7 @@
         this.measurementBatchSize = measurementBatchSize;
         this.forks = forks;
         this.warmupForks = warmupForks;
+        this.jvm = jvm;
         this.jvmArgs = jvmArgs;
         this.jvmArgsPrepend = jvmArgsPrepend;
         this.jvmArgsAppend = jvmArgsAppend;
@@ -91,7 +94,7 @@
     public BenchmarkListEntry(String line) {
         String[] args = line.split(BR_SEPARATOR);
 
-        if (args.length != 19) {
+        if (args.length != 20) {
             throw new IllegalStateException("Mismatched format for the line: " + line);
         }
 
@@ -109,18 +112,20 @@
         this.measurementBatchSize = Optional.of(args[10], INTEGER_UNMARSHALLER);
         this.forks = Optional.of(args[11], INTEGER_UNMARSHALLER);
         this.warmupForks = Optional.of(args[12], INTEGER_UNMARSHALLER);
-        this.jvmArgs = Optional.of(args[13], STRING_COLLECTION_UNMARSHALLER);
-        this.jvmArgsPrepend = Optional.of(args[14], STRING_COLLECTION_UNMARSHALLER);
-        this.jvmArgsAppend = Optional.of(args[15], STRING_COLLECTION_UNMARSHALLER);
-        this.params = Optional.of(args[16], PARAM_COLLECTION_UNMARSHALLER);
-        this.tu = Optional.of(args[17], TIMEUNIT_UNMARSHALLER);
-        this.opsPerInvocation = Optional.of(args[18], INTEGER_UNMARSHALLER);
+        this.jvm = Optional.of(args[13], STRING_UNMARSHALLER);
+        this.jvmArgs = Optional.of(args[14], STRING_COLLECTION_UNMARSHALLER);
+        this.jvmArgsPrepend = Optional.of(args[15], STRING_COLLECTION_UNMARSHALLER);
+        this.jvmArgsAppend = Optional.of(args[16], STRING_COLLECTION_UNMARSHALLER);
+        this.params = Optional.of(args[17], PARAM_COLLECTION_UNMARSHALLER);
+        this.tu = Optional.of(args[18], TIMEUNIT_UNMARSHALLER);
+        this.opsPerInvocation = Optional.of(args[19], INTEGER_UNMARSHALLER);
     }
 
     public BenchmarkListEntry(String userName, String generatedName, Mode mode) {
         this(userName, generatedName, mode, new int[]{}, Optional.<Integer>none(),
                 Optional.<Integer>none(), Optional.<TimeValue>none(), Optional.<Integer>none(), Optional.<Integer>none(), Optional.<TimeValue>none(), Optional.<Integer>none(),
-                Optional.<Integer>none(), Optional.<Integer>none(), Optional.<Collection<String>>none(), Optional.<Collection<String>>none(), Optional.<Collection<String>>none(),
+                Optional.<Integer>none(), Optional.<Integer>none(),
+                Optional.<String>none(), Optional.<Collection<String>>none(), Optional.<Collection<String>>none(), Optional.<Collection<String>>none(),
                 Optional.<Map<String, String[]>>none(), Optional.<TimeUnit>none(), Optional.<Integer>none());
     }
 
@@ -129,6 +134,7 @@
                 threads + BR_SEPARATOR + warmupIterations + BR_SEPARATOR + warmupTime + BR_SEPARATOR + warmupBatchSize + BR_SEPARATOR +
                 measurementIterations + BR_SEPARATOR + measurementTime + BR_SEPARATOR + measurementBatchSize + BR_SEPARATOR +
                 forks + BR_SEPARATOR + warmupForks + BR_SEPARATOR +
+                jvm.toString(STRING_MARSHALLER) + BR_SEPARATOR +
                 jvmArgs.toString(STRING_COLLECTION_MARSHALLER) + BR_SEPARATOR +
                 jvmArgsPrepend.toString(STRING_COLLECTION_MARSHALLER) + BR_SEPARATOR +
                 jvmArgsAppend.toString(STRING_COLLECTION_MARSHALLER) + BR_SEPARATOR +
@@ -140,14 +146,18 @@
         return new BenchmarkListEntry(userName, generatedName, mode, threadGroups, threads,
                 warmupIterations, warmupTime, warmupBatchSize,
                 measurementIterations, measurementTime, measurementBatchSize,
-                forks, warmupForks, jvmArgs, jvmArgsPrepend, jvmArgsAppend, params, tu, opsPerInvocation);
+                forks, warmupForks,
+                jvm, jvmArgs, jvmArgsPrepend, jvmArgsAppend,
+                params, tu, opsPerInvocation);
     }
 
     public BenchmarkListEntry cloneWith(WorkloadParams p) {
         BenchmarkListEntry br = new BenchmarkListEntry(userName, generatedName, mode, threadGroups, threads,
                 warmupIterations, warmupTime, warmupBatchSize,
                 measurementIterations, measurementTime, measurementBatchSize,
-                forks, warmupForks, jvmArgs, jvmArgsPrepend, jvmArgsAppend, params, tu, opsPerInvocation);
+                forks, warmupForks,
+                jvm, jvmArgs, jvmArgsPrepend, jvmArgsAppend,
+                params, tu, opsPerInvocation);
         br.workloadParams = p;
         return br;
     }
@@ -255,6 +265,10 @@
         return warmupForks;
     }
 
+    public Optional<String> getJvm() {
+        return jvm;
+    }
+
     public Optional<Collection<String>> getJvmArgs() {
         return jvmArgs;
     }
@@ -311,6 +325,20 @@
         }
     };
 
+    static final Optional.Unmarshaller<String> STRING_UNMARSHALLER = new Optional.Unmarshaller<String>() {
+        @Override
+        public String valueOf(String s) {
+            return s;
+        }
+    };
+
+    static final Optional.Marshaller<String> STRING_MARSHALLER = new Optional.Marshaller<String>() {
+        @Override
+        public String valueOf(String s) {
+            return s;
+        }
+    };
+
     static final Optional.Unmarshaller<Collection<String>> STRING_COLLECTION_UNMARSHALLER = new Optional.Unmarshaller<Collection<String>>() {
         @Override
         public Collection<String> valueOf(String s) {
@@ -366,5 +394,4 @@
             return sb.toString();
         }
     };
-
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Thu Jul 03 16:12:50 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Mon Jul 07 16:11:37 2014 +0400
@@ -375,22 +375,24 @@
                 benchmark.getOperationsPerInvocation().orElse(
                         Defaults.OPS_PER_INVOCATION));
 
-        Collection<String> jvmArgsPrepend = options.getJvmArgsPrepend().orElse(
-                benchmark.getJvmArgsPrepend().orElse(
-                        Collections.<String>emptyList()));
+        String jvm = options.getJvm().orElse(
+                benchmark.getJvm().orElse(Utils.getCurrentJvm()));
 
-        Collection<String> jvmArgs = options.getJvmArgs().orElse(
-                benchmark.getJvmArgs().orElse(
-                        ManagementFactory.getRuntimeMXBean().getInputArguments()));
+        Collection<String> jvmArgs = new ArrayList<String>();
 
-        Collection<String> jvmArgsAppend = options.getJvmArgsAppend().orElse(
-                benchmark.getJvmArgsAppend().orElse(
-                        Collections.<String>emptyList()));
+        jvmArgs.addAll(options.getJvmArgsPrepend().orElse(
+                benchmark.getJvmArgsPrepend().orElse(Collections.<String>emptyList())));
+
+        jvmArgs.addAll(options.getJvmArgs().orElse(
+                benchmark.getJvmArgs().orElse(ManagementFactory.getRuntimeMXBean().getInputArguments())));
+
+        jvmArgs.addAll(options.getJvmArgsAppend().orElse(
+                benchmark.getJvmArgsAppend().orElse(Collections.<String>emptyList())));
 
         return new BenchmarkParams(benchmark.getUsername(), benchmark.generatedTarget(), synchIterations,
                 threads, threadGroups, forks, warmupForks,
                 warmup, measurement, benchmark.getMode(), benchmark.getWorkloadParams(), timeUnit, opsPerInvocation,
-                jvmArgsPrepend, jvmArgs, jvmArgsAppend);
+                jvm, jvmArgs);
     }
 
     private List<WorkloadParams> explodeAllParams(BenchmarkListEntry br) throws RunnerException {
@@ -509,14 +511,12 @@
             printErr = forcePrint || printErr;
 
             String[] commandString = getSeparateExecutionCommand(params, server.getHost(), server.getPort(), javaInvokeOptions, javaOptions);
-            String opts = Utils.join(getJvmArgs(params), " ");
+            String opts = Utils.join(params.getJvmArgs(), " ");
             if (opts.trim().isEmpty()) {
                 opts = "<none>";
             }
 
-            String jvm = options.getJvm().orElse(getDefaultJvm());
-
-            out.println("# VM invoker: " + jvm);
+            out.println("# VM invoker: " + params.getJvm());
             out.println("# VM options: " + opts);
             out.startBenchmark(params);
             out.println("");
@@ -686,10 +686,10 @@
         command.addAll(javaInvokeOptions);
 
         // use supplied jvm, if given
-        command.add(options.getJvm().orElse(getDefaultJvm()));
+        command.add(benchmark.getJvm());
 
         // use supplied jvm args, if given
-        command.addAll(getJvmArgs(benchmark));
+        command.addAll(benchmark.getJvmArgs());
 
         // add profiler JVM commands, if any profiler wants it
         command.addAll(javaOptions);
@@ -699,7 +699,7 @@
 
         // assemble final process command
         command.add("-cp");
-        if (isWindows()) {
+        if (Utils.isWindows()) {
             command.add('"' + System.getProperty("java.class.path") + '"');
         } else {
             command.add(System.getProperty("java.class.path"));
@@ -715,25 +715,4 @@
         return command.toArray(new String[command.size()]);
     }
 
-    private boolean isWindows() {
-        return System.getProperty("os.name").contains("indows");
-    }
-
-    private String getDefaultJvm() {
-        return System.getProperty("java.home") +
-                File.separator +
-                "bin" +
-                File.separator +
-                "java" +
-                (isWindows() ? ".exe" : "");
-    }
-
-    private Collection<String> getJvmArgs(BenchmarkParams benchmark) {
-        Collection<String> res = new ArrayList<String>();
-        res.addAll(benchmark.getJvmArgsPrepend());
-        res.addAll(benchmark.getJvmArgs());
-        res.addAll(benchmark.getJvmArgsAppend());
-        return res;
-    }
-
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/util/Utils.java	Thu Jul 03 16:12:50 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/util/Utils.java	Mon Jul 07 16:11:37 2014 +0400
@@ -26,6 +26,7 @@
 
 import sun.misc.Unsafe;
 
+import java.io.File;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -188,4 +189,17 @@
         throw new IllegalStateException("Can't find field \"" + fieldName + "\"");
     }
 
+    public static boolean isWindows() {
+        return System.getProperty("os.name").contains("indows");
+    }
+
+    public static String getCurrentJvm() {
+        return System.getProperty("java.home") +
+                File.separator +
+                "bin" +
+                File.separator +
+                "java" +
+                (isWindows() ? ".exe" : "");
+    }
+
 }
--- a/jmh-core/src/test/java/org/openjdk/jmh/results/TestAggregateResult.java	Thu Jul 03 16:12:50 2014 +0400
+++ b/jmh-core/src/test/java/org/openjdk/jmh/results/TestAggregateResult.java	Mon Jul 07 16:11:37 2014 +0400
@@ -30,7 +30,9 @@
 import org.openjdk.jmh.infra.BenchmarkParams;
 import org.openjdk.jmh.infra.IterationParams;
 import org.openjdk.jmh.runner.IterationType;
+import org.openjdk.jmh.runner.Runner;
 import org.openjdk.jmh.runner.options.TimeValue;
+import org.openjdk.jmh.util.Utils;
 
 import java.util.Collections;
 import java.util.concurrent.TimeUnit;
@@ -52,7 +54,7 @@
                         new IterationParams(IterationType.WARMUP, 1, TimeValue.seconds(1), 1),
                         new IterationParams(IterationType.MEASUREMENT, 1, TimeValue.seconds(1), 1),
                         Mode.Throughput, null, TimeUnit.SECONDS, 1,
-                        Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList()),
+                        Utils.getCurrentJvm(), Collections.<String>emptyList()),
                 new IterationParams(IterationType.MEASUREMENT, 1, TimeValue.days(1), 1)
         );
         for (double d : values) {
--- a/jmh-core/src/test/java/org/openjdk/jmh/results/format/ResultFormatTest.java	Thu Jul 03 16:12:50 2014 +0400
+++ b/jmh-core/src/test/java/org/openjdk/jmh/results/format/ResultFormatTest.java	Mon Jul 07 16:11:37 2014 +0400
@@ -38,6 +38,7 @@
 import org.openjdk.jmh.runner.WorkloadParams;
 import org.openjdk.jmh.runner.options.TimeValue;
 import org.openjdk.jmh.util.FileUtils;
+import org.openjdk.jmh.util.Utils;
 
 import java.io.BufferedReader;
 import java.io.FileReader;
@@ -79,7 +80,8 @@
                     Mode.Throughput,
                     ps,
                     TimeUnit.SECONDS, 1,
-                    Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList());
+                    Utils.getCurrentJvm(),
+                    Collections.<String>emptyList());
 
             Collection<BenchmarkResult> benchmarkResults = new ArrayList<BenchmarkResult>();
             for (int f = 0; f < r.nextInt(10); f++) {
--- a/jmh-core/src/test/java/org/openjdk/jmh/runner/RunnerTest.java	Thu Jul 03 16:12:50 2014 +0400
+++ b/jmh-core/src/test/java/org/openjdk/jmh/runner/RunnerTest.java	Mon Jul 07 16:11:37 2014 +0400
@@ -31,6 +31,7 @@
 import org.openjdk.jmh.runner.options.OptionsBuilder;
 import org.openjdk.jmh.runner.options.TimeValue;
 import org.openjdk.jmh.util.FileUtils;
+import org.openjdk.jmh.util.Utils;
 
 import java.io.File;
 import java.io.IOException;
@@ -60,7 +61,7 @@
                 new IterationParams(IterationType.WARMUP,      1, TimeValue.seconds(1), 1),
                 new IterationParams(IterationType.MEASUREMENT, 1, TimeValue.seconds(1), 1),
                 Mode.Throughput, null, TimeUnit.SECONDS, 1,
-                Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList());
+                Utils.getCurrentJvm(), Collections.<String>emptyList());
         String[] command = blade.getSeparateExecutionCommand(bp, DUMMY_HOST, DUMMY_PORT, Collections.<String>emptyList(), Collections.<String>emptyList());
 
         // expecting 1 compile command file
@@ -88,7 +89,7 @@
                 new IterationParams(IterationType.WARMUP,      1, TimeValue.seconds(1), 1),
                 new IterationParams(IterationType.MEASUREMENT, 1, TimeValue.seconds(1), 1),
                 Mode.Throughput, null, TimeUnit.SECONDS, 1,
-                Collections.<String>emptyList(), Arrays.asList(CompilerHints.XX_COMPILE_COMMAND_FILE + tempHints), Collections.<String>emptyList());
+                Utils.getCurrentJvm(), Arrays.asList(CompilerHints.XX_COMPILE_COMMAND_FILE + tempHints));
         String[] command = blade.getSeparateExecutionCommand(bp, DUMMY_HOST, DUMMY_PORT, Collections.<String>emptyList(), Collections.<String>emptyList());
 
         // expecting 1 compile command file
@@ -120,9 +121,8 @@
                 new IterationParams(IterationType.WARMUP,      1, TimeValue.seconds(1), 1),
                 new IterationParams(IterationType.MEASUREMENT, 1, TimeValue.seconds(1), 1),
                 Mode.Throughput, null, TimeUnit.SECONDS, 1,
-                Collections.<String>emptyList(),
-                Arrays.asList(CompilerHints.XX_COMPILE_COMMAND_FILE + tempHints1, CompilerHints.XX_COMPILE_COMMAND_FILE + tempHints2),
-                Collections.<String>emptyList());
+                Utils.getCurrentJvm(),
+                Arrays.asList(CompilerHints.XX_COMPILE_COMMAND_FILE + tempHints1, CompilerHints.XX_COMPILE_COMMAND_FILE + tempHints2));
         String[] command = blade.getSeparateExecutionCommand(bp, DUMMY_HOST, DUMMY_PORT, Collections.<String>emptyList(), Collections.<String>emptyList());
 
         // expecting 1 compile command file