changeset 14082:88a6e49ec676

Remove vnewarray + multivnewarray, add more tests and fixes
author dsimms
date Thu, 15 Dec 2016 12:23:20 +0100
parents 6d7136544168
children 94d536aaf185
files src/java.base/share/classes/jdk/experimental/bytecode/CodeBuilder.java src/java.base/share/classes/jdk/experimental/bytecode/Opcode.java src/java.base/share/classes/jdk/experimental/bytecode/TypedCodeBuilder.java src/java.base/share/classes/jdk/experimental/value/ValueType.java src/java.base/share/classes/valhalla/model3/classfile/Opcode.java test/TEST.groups test/valhalla/mvt/MVTTest.java
diffstat 7 files changed, 7 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/jdk/experimental/bytecode/CodeBuilder.java	Mon Dec 12 17:47:00 2016 +0000
+++ b/src/java.base/share/classes/jdk/experimental/bytecode/CodeBuilder.java	Thu Dec 15 12:23:20 2016 +0100
@@ -129,12 +129,6 @@
         return thisBuilder();
     }
 
-    public C vnewarray(S array) {
-        emitOp(Opcode.VNEWARRAY, array);
-        code.writeChar(poolHelper.putClass(array));
-        return thisBuilder();
-    }
-
     public C newarray(TypeTag tag) {
         emitOp(Opcode.NEWARRAY, tag);
         int newarraycode = tag.newarraycode;
@@ -169,12 +163,6 @@
         return thisBuilder();
     }
 
-    public C multivnewarray(S array, byte dims) {
-        emitOp(Opcode.MULTIVNEWARRAY, new Object[]{array, dims});
-        code.writeChar(poolHelper.putClass(array)).writeByte(dims);
-        return thisBuilder();
-    }
-
     public C vbox(S target) {
         emitOp(Opcode.VBOX, target);
         code.writeChar(poolHelper.putClass(target));
--- a/src/java.base/share/classes/jdk/experimental/bytecode/Opcode.java	Mon Dec 12 17:47:00 2016 +0000
+++ b/src/java.base/share/classes/jdk/experimental/bytecode/Opcode.java	Thu Dec 15 12:23:20 2016 +0100
@@ -236,8 +236,6 @@
     VALOAD(205),
     VASTORE(206),
     VNEW(207),
-    VNEWARRAY(208),
-    MULTIVNEWARRAY(209),
     VRETURN(210),
     VGETFIELD(211),
     TYPED(212),
--- a/src/java.base/share/classes/jdk/experimental/bytecode/TypedCodeBuilder.java	Mon Dec 12 17:47:00 2016 +0000
+++ b/src/java.base/share/classes/jdk/experimental/bytecode/TypedCodeBuilder.java	Thu Dec 15 12:23:20 2016 +0100
@@ -835,13 +835,11 @@
                 state.pop();
                 state.push(typeHelper.arrayOf(typeHelper.arrayOf(typeHelper.type((S)optValue))));
                 break;
-            case VNEWARRAY:
             case VBOX:
             case VUNBOX:
                 state.pop();
                 state.push(typeHelper.type((S) optValue));
                 break;
-            case MULTIVNEWARRAY:
             case MULTIANEWARRAY:
                 for (int i = 0; i < (byte) ((Object[]) optValue)[1]; i++) {
                     state.pop();
--- a/src/java.base/share/classes/jdk/experimental/value/ValueType.java	Mon Dec 12 17:47:00 2016 +0000
+++ b/src/java.base/share/classes/jdk/experimental/value/ValueType.java	Thu Dec 15 12:23:20 2016 +0100
@@ -328,7 +328,7 @@
         if (result == null) {
             result = MethodHandleBuilder.loadCode(lookup, "newArray" + sourceClass().getName(), MethodType.methodType(arrayValueClass, int.class),
                     C -> {
-                        C.load(0).vnewarray(arrayValueClass).areturn();
+                        C.load(0).anewarray(valueClass()).areturn();
                     });
             handleMap.put(key, result);
         }
@@ -375,7 +375,7 @@
                         for (int i = 0 ; i < dims ; i++) {
                             C.load(i);
                         }
-                        C.multivnewarray(arrayValueClass, (byte)dims).areturn();
+                        C.multianewarray(arrayValueClass, (byte)dims).areturn();
                     });
             handleMap.put(key, result);
         }
--- a/src/java.base/share/classes/valhalla/model3/classfile/Opcode.java	Mon Dec 12 17:47:00 2016 +0000
+++ b/src/java.base/share/classes/valhalla/model3/classfile/Opcode.java	Thu Dec 15 12:23:20 2016 +0100
@@ -251,8 +251,6 @@
     VALOAD(205),
     VASTORE(206),
     VNEW(207, CPREF_W),
-    VNEWARRAY(208, CPREF_W),
-    MULTIVNEWARRAY(209, CPREF_W_UBYTE),
     VRETURN(210),
     VGETFIELD(211, CPREF_W),
 
--- a/test/TEST.groups	Mon Dec 12 17:47:00 2016 +0000
+++ b/test/TEST.groups	Thu Dec 15 12:23:20 2016 +0100
@@ -88,6 +88,9 @@
 jdk_valhalla = \
     valhalla
 
+jdk_valhalla_mvt = \
+    valhalla/mvt
+
 # All util components not part of some other util category
 jdk_util_other = \
     java/util \
--- a/test/valhalla/mvt/MVTTest.java	Mon Dec 12 17:47:00 2016 +0000
+++ b/test/valhalla/mvt/MVTTest.java	Thu Dec 15 12:23:20 2016 +0100
@@ -25,7 +25,8 @@
 
 /*
  * @test
- * @run main/othervm -Xverify:none MVTTest
+ * @run main/othervm -Xint -Xverify:none -XX:+ValueArrayFlatten MVTTest
+ * @run main/othervm -Xint -Xverify:none -XX:-ValueArrayFlatten MVTTest
  */
 
 import jdk.experimental.value.ValueType;