1 package org.openjdk.bench.vm.gc.barriers.writes;
2
3 import org.openjdk.jmh.annotations.*;
4
5 import java.util.concurrent.TimeUnit;
6
7 @Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS)
8 @Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS)
9 @Fork(3)
10 @BenchmarkMode(Mode.AverageTime)
11 @OutputTimeUnit(TimeUnit.NANOSECONDS)
12 @State(Scope.Thread)
13 public class MultipleKnownNulls {
14
15 Target dst;
16
17 @Setup
18 public void setup() {
19 dst = new Target();
20 }
21
22 @Benchmark
23 @CompilerControl(CompilerControl.Mode.DONT_INLINE)
24 public void test() {
25 dst.x1 = null;
26 dst.x2 = null;
27 dst.x3 = null;
28 dst.x4 = null;
29 }
30
31 static class Target {
32 Object x1;
33 Object x2;
34 Object x3;
35 Object x4;
36 }
37
38 }