< prev index next >

test/micro/org/openjdk/bench/jdk/incubator/foreign/VarHandleExact.java

Print this page
*** 38,11 ***
  
  import java.lang.invoke.VarHandle;
  import java.nio.ByteOrder;
  import java.util.concurrent.TimeUnit;
  
! import static jdk.incubator.foreign.MemoryLayouts.JAVA_INT;
  
  @BenchmarkMode(Mode.AverageTime)
  @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
  @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
  @State(org.openjdk.jmh.annotations.Scope.Thread)
--- 38,11 ---
  
  import java.lang.invoke.VarHandle;
  import java.nio.ByteOrder;
  import java.util.concurrent.TimeUnit;
  
! import static jdk.incubator.foreign.ValueLayout.JAVA_INT;
  
  @BenchmarkMode(Mode.AverageTime)
  @Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS)
  @Measurement(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS)
  @State(org.openjdk.jmh.annotations.Scope.Thread)

*** 52,11 ***
  
      static final VarHandle exact;
      static final VarHandle generic;
  
      static {
!         generic = MemoryHandles.varHandle(int.class, ByteOrder.nativeOrder());
          exact = generic.withInvokeExactBehavior();
      }
  
      MemorySegment data;
  
--- 52,11 ---
  
      static final VarHandle exact;
      static final VarHandle generic;
  
      static {
!         generic = MemoryHandles.varHandle(JAVA_INT);
          exact = generic.withInvokeExactBehavior();
      }
  
      MemorySegment data;
  
< prev index next >