Skip to content

Commit 7ae3038

Browse files
author
SendaoYan
committed
8342958: Use jvmArgs consistently in microbenchmarks
8343345: Use -jvmArgsPrepend when running microbenchmarks in RunTests.gmk Reviewed-by: phh Backport-of: 90bd544
1 parent bdc3a33 commit 7ae3038

File tree

94 files changed

+119
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+119
-119
lines changed

make/RunTests.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ define SetupRunMicroTestBody
602602
$1_JMH_JVM_ARGS += $$(MICRO_VM_OPTIONS) $$(MICRO_JAVA_OPTIONS)
603603
endif
604604

605-
$1_MICRO_VM_OPTIONS := -jvmArgs $(call ShellQuote,$$($1_JMH_JVM_ARGS))
605+
$1_MICRO_VM_OPTIONS := -jvmArgsPrepend $(call ShellQuote,$$($1_JMH_JVM_ARGS))
606606

607607
ifneq ($$(MICRO_ITER), )
608608
$1_MICRO_ITER := -i $$(MICRO_ITER)

test/micro/org/openjdk/bench/java/lang/ObjectHashCode.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,37 +50,37 @@ public int mode_default() {
5050
// Experimental hashCode generation schemes. See synchronizer.cpp get_next_hash
5151
/*
5252
@Benchmark
53-
@Fork(jvmArgsPrepend = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=0"})
53+
@Fork(jvmArgs = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=0"})
5454
public int mode_0() {
5555
return System.identityHashCode(new Object());
5656
}
5757
5858
@Benchmark
59-
@Fork(jvmArgsPrepend = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=1"})
59+
@Fork(jvmArgs = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=1"})
6060
public int mode_1() {
6161
return System.identityHashCode(new Object());
6262
}
6363
6464
@Benchmark
65-
@Fork(jvmArgsPrepend = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=2"})
65+
@Fork(jvmArgs = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=2"})
6666
public int mode_2() {
6767
return System.identityHashCode(new Object());
6868
}
6969
7070
@Benchmark
71-
@Fork(jvmArgsPrepend = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=3"})
71+
@Fork(jvmArgs = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=3"})
7272
public int mode_3() {
7373
return System.identityHashCode(new Object());
7474
}
7575
7676
@Benchmark
77-
@Fork(jvmArgsPrepend = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=4"})
77+
@Fork(jvmArgs = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=4"})
7878
public int mode_4() {
7979
return System.identityHashCode(new Object());
8080
}
8181
8282
@Benchmark
83-
@Fork(jvmArgsPrepend = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=5"})
83+
@Fork(jvmArgs = {"-XX:+UnlockExperimentalVMOptions", "-XX:hashCode=5"})
8484
public int mode_5() {
8585
return System.identityHashCode(new Object());
8686
}

test/micro/org/openjdk/bench/java/lang/ScopedValues.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
@Measurement(iterations=10, time=1)
4242
@Threads(1)
4343
@Fork(value = 1,
44-
jvmArgsPrepend = {"-Djmh.executor.class=org.openjdk.bench.java.lang.ScopedValuesExecutorService",
44+
jvmArgs = {"-Djmh.executor.class=org.openjdk.bench.java.lang.ScopedValuesExecutorService",
4545
"-Djmh.executor=CUSTOM",
4646
"-Djmh.blackhole.mode=COMPILER",
4747
"--enable-preview"})

test/micro/org/openjdk/bench/java/lang/StringHashCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public int empty() {
9696
@State(Scope.Thread)
9797
@Warmup(iterations = 5, time = 1)
9898
@Measurement(iterations = 5, time = 1)
99-
@Fork(value = 3, jvmArgsAppend = {"--add-exports", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED"})
99+
@Fork(value = 3, jvmArgs = {"--add-exports", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED"})
100100
public static class Algorithm {
101101

102102
private final static String alphabet = "abcdefghijklmnopqrstuvwxyz";

test/micro/org/openjdk/bench/java/lang/StringTemplateFMT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
@State(Scope.Benchmark)
4646
@Warmup(iterations = 5, time = 1)
4747
@Measurement(iterations = 5, time = 1)
48-
@Fork(value = 3, jvmArgsAppend = "--enable-preview")
48+
@Fork(value = 3, jvmArgs = "--enable-preview")
4949
public class StringTemplateFMT {
5050

5151
public String s = "str";

test/micro/org/openjdk/bench/java/lang/foreign/BulkOps.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
5252
@State(org.openjdk.jmh.annotations.Scope.Thread)
5353
@OutputTimeUnit(TimeUnit.MILLISECONDS)
54-
@Fork(value = 3, jvmArgsAppend = "--enable-preview")
54+
@Fork(value = 3, jvmArgs = "--enable-preview")
5555
public class BulkOps {
5656

5757
static final Unsafe unsafe = Utils.unsafe;

test/micro/org/openjdk/bench/java/lang/foreign/CallOverheadConstant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
4242
@State(org.openjdk.jmh.annotations.Scope.Thread)
4343
@OutputTimeUnit(TimeUnit.NANOSECONDS)
44-
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "--enable-preview" })
44+
@Fork(value = 3, jvmArgs = { "--enable-native-access=ALL-UNNAMED", "--enable-preview" })
4545
public class CallOverheadConstant {
4646

4747
@Benchmark

test/micro/org/openjdk/bench/java/lang/foreign/CallOverheadVirtual.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
4242
@State(org.openjdk.jmh.annotations.Scope.Thread)
4343
@OutputTimeUnit(TimeUnit.NANOSECONDS)
44-
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "--enable-preview" })
44+
@Fork(value = 3, jvmArgs = { "--enable-native-access=ALL-UNNAMED", "--enable-preview" })
4545
public class CallOverheadVirtual {
4646

4747
@Benchmark

test/micro/org/openjdk/bench/java/lang/foreign/LinkUpcall.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
4848
@State(Scope.Benchmark)
4949
@OutputTimeUnit(TimeUnit.MICROSECONDS)
50-
@Fork(value = 3, jvmArgsAppend = { "--enable-native-access=ALL-UNNAMED", "--enable-preview" })
50+
@Fork(value = 3, jvmArgs = { "--enable-native-access=ALL-UNNAMED", "--enable-preview" })
5151
public class LinkUpcall extends CLayouts {
5252

5353
static final Linker LINKER = Linker.nativeLinker();

test/micro/org/openjdk/bench/java/lang/foreign/LoopOverConstant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
@Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
4949
@State(org.openjdk.jmh.annotations.Scope.Thread)
5050
@OutputTimeUnit(TimeUnit.MILLISECONDS)
51-
@Fork(value = 3, jvmArgsAppend = "--enable-preview")
51+
@Fork(value = 3, jvmArgs = "--enable-preview")
5252
public class LoopOverConstant extends JavaLayouts {
5353

5454
static final Unsafe unsafe = Utils.unsafe;

0 commit comments

Comments
 (0)