< prev index next >

test/micro/org/openjdk/bench/jdk/incubator/foreign/CallOverheadVirtual.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;

@@ -54,37 +55,86 @@
      public void panama_blank() throws Throwable {
          func_v.invokeExact(func_addr);
      }
  
      @Benchmark
-     public void panama_blank_trivial() throws Throwable {
-         func_trivial_v.invokeExact(func_addr);
+     public int jni_identity() throws Throwable {
+         return identity(10);
+     }
+ 
+     public MemorySegment panama_identity_struct_confined() throws Throwable {
+         return (MemorySegment) identity_struct_v.invokeExact(identity_struct_addr, recycling_allocator, confinedPoint);
      }
  
      @Benchmark
-     public int jni_identity() throws Throwable {
-         return identity(10);
+     public MemorySegment panama_identity_struct_shared() throws Throwable {
+         return (MemorySegment) identity_struct_v.invokeExact(identity_struct_addr, recycling_allocator, sharedPoint);
      }
  
      @Benchmark
-     public int panama_identity() throws Throwable {
-         return (int) identity_v.invokeExact(identity_addr, 10);
+     public MemorySegment panama_identity_struct_confined_3() throws Throwable {
+         return (MemorySegment) identity_struct_3_v.invokeExact(identity_struct_3_addr, recycling_allocator, confinedPoint, confinedPoint, confinedPoint);
      }
  
      @Benchmark
-     public int panama_identity_trivial() throws Throwable {
-         return (int) identity_trivial_v.invokeExact(identity_addr, 10);
+     public MemorySegment panama_identity_struct_shared_3() throws Throwable {
+         return (MemorySegment) identity_struct_3_v.invokeExact(identity_struct_3_addr, recycling_allocator, sharedPoint, sharedPoint, sharedPoint);
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_memory_address_shared() throws Throwable {
+         return (MemoryAddress) identity_memory_address_v.invokeExact(identity_memory_address_addr, (Addressable)sharedPoint.address());
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_memory_address_confined() throws Throwable {
+         return (MemoryAddress) identity_memory_address_v.invokeExact(identity_memory_address_addr, (Addressable)confinedPoint.address());
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_memory_address_shared_3() throws Throwable {
+         return (MemoryAddress) identity_memory_address_3_v.invokeExact(identity_memory_address_3_addr, (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_v.invokeExact(identity_memory_address_3_addr, (Addressable)confinedPoint.address(), (Addressable)confinedPoint.address(), (Addressable)confinedPoint.address());
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_struct_ref_shared() throws Throwable {
+         return (MemoryAddress) identity_memory_address_v.invokeExact(identity_struct_addr, (Addressable)sharedPoint);
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_struct_ref_confined() throws Throwable {
+         return (MemoryAddress) identity_memory_address_v.invokeExact(identity_struct_addr, (Addressable)confinedPoint);
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_struct_ref_shared_3() throws Throwable {
+         return (MemoryAddress) identity_memory_address_3_v.invokeExact(identity_struct_3_addr, (Addressable)sharedPoint, (Addressable)sharedPoint, (Addressable)sharedPoint);
+     }
+ 
+     @Benchmark
+     public MemoryAddress panama_identity_struct_ref_confined_3() throws Throwable {
+         return (MemoryAddress) identity_memory_address_3_v.invokeExact(identity_struct_3_addr, (Addressable)confinedPoint, (Addressable)confinedPoint, (Addressable)confinedPoint);
+     }
+ 
+     @Benchmark
+     public int panama_identity() throws Throwable {
+         return (int) identity_v.invokeExact(identity_addr, 10);
      }
  
      @Benchmark
      public MemorySegment panama_identity_struct() throws Throwable {
          return (MemorySegment) identity_struct_v.invokeExact(identity_struct_addr, recycling_allocator, point);
      }
  
      @Benchmark
-     public MemoryAddress panama_identity_memory_address() throws Throwable {
-         return (MemoryAddress) identity_memory_address_v.invokeExact(identity_memory_address_addr, MemoryAddress.NULL);
+     public MemoryAddress panama_identity_memory_address_null() throws Throwable {
+         return (MemoryAddress) identity_memory_address_v.invokeExact(identity_memory_address_addr, (Addressable)MemoryAddress.NULL);
      }
  
      @Benchmark
      public void panama_args_01() throws Throwable {
          args1_v.invokeExact(args1_addr, 10L);
< prev index next >