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 Single {
15 
16     static final Target SRC = new Target();
17     Target dst;
18 
19     @Setup
20     public void setup() {
21         dst = new Target();
22     }
23 
24     @Benchmark
25     @CompilerControl(CompilerControl.Mode.DONT_INLINE)
26     public void test() {
27         dst.x1 = SRC;
28     }
29 
30     static class Target {
31         Object x1;
32     }
33 
34 }