< prev index next >

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

Print this page
@@ -20,10 +20,11 @@
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  package org.openjdk.bench.jdk.incubator.foreign;
  
+ import jdk.incubator.foreign.Addressable;
  import jdk.incubator.foreign.MemoryAddress;
  import jdk.incubator.foreign.MemorySegment;
  import org.openjdk.jmh.annotations.Benchmark;
  import org.openjdk.jmh.annotations.BenchmarkMode;
  import org.openjdk.jmh.annotations.Fork;

@@ -53,15 +54,10 @@
      @Benchmark
      public void panama_blank() throws Throwable {
          func.invokeExact();
      }
  
-     @Benchmark
-     public void panama_blank_trivial() throws Throwable {
-         func_trivial.invokeExact();
-     }
- 
      @Benchmark
      public int jni_identity() throws Throwable {
          return identity(10);
      }
  

@@ -69,22 +65,77 @@
      public int panama_identity() throws Throwable {
          return (int) identity.invokeExact(10);
      }
  
      @Benchmark
-     public int panama_identity_trivial() throws Throwable {
-         return (int) identity_trivial.invokeExact(10);
+     public MemorySegment panama_identity_struct_confined() throws Throwable {
+         return (MemorySegment) identity_struct.invokeExact(recycling_allocator, confinedPoint);
+     }
+ 
+     @Benchmark
+     public MemorySegment panama_identity_struct_shared() throws Throwable {
+         return (MemorySegment) identity_struct.invokeExact(recycling_allocator, sharedPoint);
+     }
+ 
+     @Benchmark
+     public MemorySegment panama_identity_struct_confined_3() throws Throwable {
+         return (MemorySegment) identity_struct_3.invokeExact(recycling_allocator, confinedPoint, confinedPoint, confinedPoint);
+     }
+ 
+     @Benchmark
+     public MemorySegment panama_identity_struct_shared_3() throws Throwable {
+         return (MemorySegment) identity_struct_3.invokeExact(recycling_allocator, sharedPoint, sharedPoint, sharedPoint);
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_memory_address_shared() throws Throwable {
+         return (MemoryAddress) identity_memory_address.invokeExact((Addressable)sharedPoint.address());
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_memory_address_confined() throws Throwable {
+         return (MemoryAddress) identity_memory_address.invokeExact((Addressable)confinedPoint.address());
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_memory_address_shared_3() throws Throwable {
+         return (MemoryAddress) identity_memory_address_3.invokeExact((Addressable)sharedPoint.address(), (Addressable)sharedPoint.address(), (Addressable)sharedPoint.address());
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_memory_address_confined_3() throws Throwable {
+         return (MemoryAddress) identity_memory_address_3.invokeExact((Addressable)confinedPoint.address(), (Addressable)confinedPoint.address(), (Addressable)confinedPoint.address());
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_struct_ref_shared() throws Throwable {
+         return (MemoryAddress) identity_memory_address.invokeExact((Addressable)sharedPoint);
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_struct_ref_confined() throws Throwable {
+         return (MemoryAddress) identity_memory_address.invokeExact((Addressable)confinedPoint);
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_struct_ref_shared_3() throws Throwable {
+         return (MemoryAddress) identity_memory_address_3.invokeExact((Addressable)sharedPoint, (Addressable)sharedPoint, (Addressable)sharedPoint);
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_struct_ref_confined_3() throws Throwable {
+         return (MemoryAddress) identity_memory_address_3.invokeExact((Addressable)confinedPoint, (Addressable)confinedPoint, (Addressable)confinedPoint);
      }
  
      @Benchmark
-     public MemorySegment panama_identity_struct() throws Throwable {
-         return (MemorySegment) identity_struct.invokeExact(recycling_allocator, point);
+     public MemoryAddress panama_identity_memory_address_null() throws Throwable {
+         return (MemoryAddress) identity_memory_address.invokeExact((Addressable)MemoryAddress.NULL);
      }
  
      @Benchmark
-     public MemoryAddress panama_identity_memory_address() throws Throwable {
-         return (MemoryAddress) identity_memory_address.invokeExact(MemoryAddress.NULL);
+     public MemoryAddress panama_identity_memory_address_null_non_exact() throws Throwable {
+         return (MemoryAddress) identity_memory_address.invoke(MemoryAddress.NULL);
      }
  
      @Benchmark
      public void panama_args_01() throws Throwable {
          args1.invokeExact(10L);
< prev index next >