changeset 53974:86d31e02427e lworld

[lworld] Fix value type benchmarks, make compilable and working
author skuksenko
date Tue, 29 Jan 2019 17:01:21 -0800
parents 1049b319f14c
children 5ce4b99e7bf1
files test/benchmarks/pom.xml test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/listsum/Listsum1.java test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/listsum/Listsum2.java test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/listsum/Listsum8.java test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/types/Wrapper1.java test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/types/Wrapper2.java test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/types/Wrapper8.java test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/util/HashMapIteratorCursor.java test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/util/HashMapValueEntry.java test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/util/HashMapValueTotal.java
diffstat 10 files changed, 10 insertions(+), 133 deletions(-) [+]
line wrap: on
line diff
--- a/test/benchmarks/pom.xml	Mon Jan 28 15:15:45 2019 +0100
+++ b/test/benchmarks/pom.xml	Tue Jan 29 17:01:21 2019 -0800
@@ -15,7 +15,6 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <jmh.version>1.21</jmh.version>
-        <javac.target>12</javac.target>
         <uberjar.name>benchmarks</uberjar.name>
     </properties>
     
@@ -83,17 +82,12 @@
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>3.1</version>
                 <configuration>
-                    <compilerVersion>${javac.target}</compilerVersion>
-                    <source>12</source>
-                    <target>12</target>
+                    <compilerVersion>13</compilerVersion>
+                    <source>13</source>
+                    <target>13</target>
                     <compilerArgs>
-                       <arg>-XDallowFlattenabilityModifiers</arg>
                        <arg>-XDallowWithFieldOperator</arg>
                     </compilerArgs>
-<!--                    <compilerArgs>
-                         <arg>-XDenableValueTypes</arg>
-			 <arg>add-modules</arg><arg>jdk.incubator.mvt</arg>
-             </compilerArgs>		    -->
                 </configuration>
             </plugin>
             <plugin>
--- a/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/listsum/Listsum1.java	Mon Jan 28 15:15:45 2019 +0100
+++ b/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/listsum/Listsum1.java	Tue Jan 29 17:01:21 2019 -0800
@@ -8,7 +8,7 @@
 public class Listsum1 extends ListsumBase {
 
     static class Node {
-        public __Flattenable Value1 value;
+        public Value1.val value;
         public Node next;
 
 
--- a/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/listsum/Listsum2.java	Mon Jan 28 15:15:45 2019 +0100
+++ b/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/listsum/Listsum2.java	Tue Jan 29 17:01:21 2019 -0800
@@ -8,7 +8,7 @@
 public class Listsum2 extends ListsumBase {
 
     static class Node {
-        public __Flattenable Value2 value;
+        public Value2.val value;
         public Node next;
 
 
--- a/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/listsum/Listsum8.java	Mon Jan 28 15:15:45 2019 +0100
+++ b/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/listsum/Listsum8.java	Tue Jan 29 17:01:21 2019 -0800
@@ -8,7 +8,7 @@
 public class Listsum8 extends ListsumBase {
 
     static class Node {
-        public __Flattenable Value8 value;
+        public Value8.val value;
         public Node next;
 
 
--- a/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/types/Wrapper1.java	Mon Jan 28 15:15:45 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-package oracle.micro.valhalla.lworld.types;
-
-import oracle.micro.valhalla.types.Total;
-
-public class Wrapper1 implements Total {
-
-    public __Flattenable final Value1 value;
-
-    public Wrapper1(Value1 value) {
-        this.value = value;
-    }
-
-    public Wrapper1(int f0) {
-        this.value = Value1.of(f0);
-    }
-
-    public int f0() {
-        return value.f0();
-    }
-
-    // Used to provide usages of both fields in bechmarks
-    public int totalsum() {
-        return value.totalsum();
-    }
-
-    @Override
-    public int hashCode() {
-        return value.hashCode();
-    }
-
-}
--- a/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/types/Wrapper2.java	Mon Jan 28 15:15:45 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-package oracle.micro.valhalla.lworld.types;
-
-import oracle.micro.valhalla.types.Total;
-
-public class Wrapper2 implements Total {
-
-    public __Flattenable final Value2 value;
-
-    public Wrapper2(Value2 value) {
-        this.value = value;
-    }
-
-    public Wrapper2(int f0, int f1) {
-        this.value = Value2.of(f0, f1);
-    }
-
-    public int f0() {
-        return value.f0();
-    }
-    public int f1() {
-        return value.f1();
-    }
-
-    public int re() {
-        return value.re();
-    }
-
-    public int im() {
-        return value.im();
-    }
-
-    public Wrapper2 add(Wrapper2 v) {
-        return new Wrapper2(value.add(v.value));
-    }
-
-    public Wrapper2 mul(Wrapper2 v) {
-        return new Wrapper2(value.mul(v.value));
-    }
-
-    // Used to provide usages of both fields in bechmarks
-    public int totalsum() {
-        return value.totalsum();
-    }
-
-    @Override
-    public int hashCode() {
-        return value.hashCode();
-    }
-
-}
--- a/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/types/Wrapper8.java	Mon Jan 28 15:15:45 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-package oracle.micro.valhalla.lworld.types;
-
-import oracle.micro.valhalla.types.Total;
-
-public class Wrapper8 implements Total {
-
-    public __Flattenable final Value8 value;
-
-    public Wrapper8(Value8 value) {
-        this.value = value;
-    }
-
-    public Wrapper8(int f0, int f1, int f2, int f3, int f4, int f5, int f6, int f7) {
-        this.value = Value8.of(f0, f1, f2, f3, f4, f5, f6, f7);
-    }
-
-    public int f0() {   return value.f0();   }
-    public int f1() {   return value.f1();   }
-    public int f2() {   return value.f2();   }
-    public int f3() {   return value.f3();   }
-    public int f4() {   return value.f4();   }
-    public int f5() {   return value.f5();   }
-    public int f6() {   return value.f6();   }
-    public int f7() {   return value.f7();   }
-
-    // Used to provide usages of both fields in bechmarks
-    public int totalsum() {
-        return value.totalsum();
-    }
-
-    @Override
-    public int hashCode() {
-        return value.hashCode();
-    }
-
-}
--- a/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/util/HashMapIteratorCursor.java	Mon Jan 28 15:15:45 2019 +0100
+++ b/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/util/HashMapIteratorCursor.java	Tue Jan 29 17:01:21 2019 -0800
@@ -174,7 +174,7 @@
     }
 
     private class HashIterator  {
-        __Flattenable EntryCursor<K,V> cursor;
+        EntryCursor.val<K,V> cursor;
 
         HashIterator() {
             cursor = EntryCursor.of(HashMapIteratorCursor.this);
--- a/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/util/HashMapValueEntry.java	Mon Jan 28 15:15:45 2019 +0100
+++ b/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/util/HashMapValueEntry.java	Tue Jan 29 17:01:21 2019 -0800
@@ -94,7 +94,7 @@
 
     public static final class HEntry<K, V> implements Map.Entry<K, V> {
 
-        __Flattenable Entry <K, V> entry;
+        Entry.val <K, V> entry;
 
         public HEntry(Entry<K, V> e) {
             this.entry = e;
--- a/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/util/HashMapValueTotal.java	Mon Jan 28 15:15:45 2019 +0100
+++ b/test/benchmarks/src/main/java/oracle/micro/valhalla/lworld/util/HashMapValueTotal.java	Tue Jan 29 17:01:21 2019 -0800
@@ -94,7 +94,7 @@
 
     public static final class HEntry<K, V> implements Map.Entry<K, V> {
 
-        __Flattenable Entry <K, V> entry;
+        Entry.val <K, V> entry;
 
         public HEntry(Entry<K, V> e) {
             this.entry = e;
@@ -294,7 +294,7 @@
     }
 
     private class HashIterator  {
-        __Flattenable EntryCursor<K,V> cursor;
+        EntryCursor.val<K,V> cursor;
 
         HashIterator() {
             cursor = EntryCursor.of(HashMapValueTotal.this);