changeset 52150:e50862202733 condy-folding

updating to regression tests after changes to DynamicConstantDesc
author vromero
date Wed, 22 Aug 2018 13:09:57 -0700
parents 63c69ded8b60
children 4bf0006135b5
files test/langtools/tools/javac/specialConstantFolding/CondyCodeGenerationTest.java test/langtools/tools/javac/specialConstantFolding/DynamicConstantDescTest.java test/langtools/tools/javac/specialConstantFolding/IntrinsicsTest.java
diffstat 3 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/test/langtools/tools/javac/specialConstantFolding/CondyCodeGenerationTest.java	Wed Aug 22 11:43:59 2018 -0700
+++ b/test/langtools/tools/javac/specialConstantFolding/CondyCodeGenerationTest.java	Wed Aug 22 13:09:57 2018 -0700
@@ -60,7 +60,7 @@
         DirectMethodHandleDesc mh = MethodHandleDesc.of(STATIC, ClassDesc.ofDescriptor("LCondyCodeGenerationTest;"),
                                                           "testNoStaticArgsBSM", methodTypeForMethodHandle);
 
-        DynamicConstantDesc<String> condyDescr = DynamicConstantDesc.<String>of(mh, "constant-name");
+        DynamicConstantDesc<String> condyDescr = DynamicConstantDesc.<String>ofNamed(mh, "constant-name", ConstantDescs.CR_String);
         return (String)ldc(condyDescr);
     }
 
@@ -85,11 +85,12 @@
                 ConstantDescs.CR_MethodHandle);
         DirectMethodHandleDesc mh = MethodHandleDesc.of(STATIC, ClassDesc.ofDescriptor("LCondyCodeGenerationTest;"),
                                                           "testWithStaticArgsBSM", methodTypeForMethodHandle);
-        DynamicConstantDesc<String> condyDescr = DynamicConstantDesc.<String>of(mh, "constant-name").withArgs(1, 2L, 3.0f, 4.0d,
-                                                                                                              ConstantDescs.CR_Number,
-                                                                                                              "something",
-                                                                                                              MethodTypeDesc.ofDescriptor("(IJFD)V"),
-                                                                                                              mh);
+        DynamicConstantDesc<String> condyDescr = DynamicConstantDesc.<String>ofNamed(mh, "constant-name", ConstantDescs.CR_String,
+                                                                            1, 2L, 3.0f, 4.0d,
+                                                                            ConstantDescs.CR_Number,
+                                                                            "something",
+                                                                            MethodTypeDesc.ofDescriptor("(IJFD)V"),
+                                                                            mh);
         return (String)ldc(condyDescr);
     }
 
@@ -121,7 +122,7 @@
         DirectMethodHandleDesc c_primitiveClassBSM_MH =
                 MethodHandleDesc.of(STATIC, ClassDesc.ofDescriptor("LCondyCodeGenerationTest;"),
                                     "primitiveClassBSM", c_primitiveClassBSM_MT);
-        DynamicConstantDesc<Class> c_primitiveClassBSM_CD = DynamicConstantDesc.of(c_primitiveClassBSM_MH, "I");
+        DynamicConstantDesc<Class> c_primitiveClassBSM_CD = DynamicConstantDesc.<Class>ofNamed(c_primitiveClassBSM_MH, "I", ConstantDescs.CR_Class);
 
         MethodTypeDesc methodTypeForMethodHandle = MethodTypeDesc.of(
                 ConstantDescs.CR_String,
@@ -133,7 +134,8 @@
         DirectMethodHandleDesc mh = MethodHandleDesc.of(STATIC, ClassDesc.ofDescriptor("LCondyCodeGenerationTest;"),
                                                           "testWithNestedArgBSM", methodTypeForMethodHandle);
 
-        DynamicConstantDesc<String> condyDescr = DynamicConstantDesc.<String>of(mh, "constant-name").withArgs(c_primitiveClassBSM_CD);
+        DynamicConstantDesc<String> condyDescr = DynamicConstantDesc.<String>ofNamed(mh, "constant-name",
+                ConstantDescs.CR_String, c_primitiveClassBSM_CD);
         return (String)ldc(condyDescr);
     }
 
--- a/test/langtools/tools/javac/specialConstantFolding/DynamicConstantDescTest.java	Wed Aug 22 11:43:59 2018 -0700
+++ b/test/langtools/tools/javac/specialConstantFolding/DynamicConstantDescTest.java	Wed Aug 22 13:09:57 2018 -0700
@@ -43,7 +43,7 @@
     );
 
     public static void main(String[] args) throws Throwable {
-        ConstantDesc<String> d = DynamicConstantDesc.<String>of(BSM_INVOKE).withArgs(MHR_CONCAT, "Hello, ", "world!");
+        ConstantDesc<String> d = DynamicConstantDesc.<String>of(BSM_INVOKE, MHR_CONCAT, "Hello, ", "world!");
         Assert.check(d.toString().equals("DynamicConstantDesc[ConstantBootstraps::invoke(MethodHandleDesc[VIRTUAL/String::concat(String)String],Hello, ,world!)Object]"));
     }
 }
--- a/test/langtools/tools/javac/specialConstantFolding/IntrinsicsTest.java	Wed Aug 22 11:43:59 2018 -0700
+++ b/test/langtools/tools/javac/specialConstantFolding/IntrinsicsTest.java	Wed Aug 22 13:09:57 2018 -0700
@@ -187,10 +187,10 @@
 
     public void testCondyInCondy() throws Throwable {
         DirectMethodHandleDesc bsm = ConstantDescs.ofConstantBootstrap(HELPER_CLASS, "identityCondy", ConstantDescs.CR_Object, ConstantDescs.CR_Object);
-        assertEquals(String.class, Intrinsics.ldc(DynamicConstantDesc.of(bsm, ConstantDescs.CR_Class).withArgs(ConstantDescs.CR_String)));
-        assertEquals(String.class, Intrinsics.ldc(DynamicConstantDesc.of(bsm).withArgs(ConstantDescs.CR_String)));
-        assertEquals(int.class, Intrinsics.ldc(DynamicConstantDesc.of(bsm).withArgs(ConstantDescs.CR_int)));
-        assertEquals("foo", Intrinsics.ldc(DynamicConstantDesc.of(bsm).withArgs("foo")));
+        assertEquals(String.class, Intrinsics.ldc(DynamicConstantDesc.of(bsm, ConstantDescs.CR_String)));
+        assertEquals(String.class, Intrinsics.ldc(DynamicConstantDesc.of(bsm, ConstantDescs.CR_String)));
+        assertEquals(int.class, Intrinsics.ldc(DynamicConstantDesc.of(bsm, ConstantDescs.CR_int)));
+        assertEquals("foo", Intrinsics.ldc(DynamicConstantDesc.of(bsm, "foo")));
     }
 
     static class IntrinsicTestHelper {