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 @Threads(1)
13 @State(Scope.Thread)
14 public class SingleKnownNull {
15 
16     Target dst;
17 
18     @Setup
19     public void setup() {
20         dst = new Target();
21     }
22 
23     @Benchmark
24     @CompilerControl(CompilerControl.Mode.DONT_INLINE)
25     public void test() {
26         dst.field = null;
27     }
28 
29     static class Target {
30         Object field;
31     }
32 
33 }