< prev index next >

src/java.base/share/classes/java/lang/constant/DynamicCallSiteDesc.java

Print this page

        

@@ -22,10 +22,12 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 package java.lang.constant;
 
+import jdk.internal.lang.annotation.Foldable;
+
 import java.lang.invoke.CallSite;
 import java.lang.invoke.MethodHandle;
 import java.lang.invoke.MethodHandles;
 import java.util.Arrays;
 import java.util.Objects;

@@ -100,10 +102,11 @@
      * @throws NullPointerException if any parameter is null
      * @throws IllegalArgumentException if the invocation name has the incorrect
      * format
      * @jvms 4.2.2 Unqualified Names
      */
+    @Foldable
     public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod,
                                          String invocationName,
                                          MethodTypeDesc invocationType,
                                          ConstantDesc... bootstrapArgs) {
         return new DynamicCallSiteDesc(bootstrapMethod, invocationName, invocationType, bootstrapArgs);

@@ -121,10 +124,11 @@
      * @return the nominal descriptor
      * @throws NullPointerException if any parameter is null
      * @throws IllegalArgumentException if the invocation name has the incorrect
      * format
      */
+    @Foldable
     public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod,
                                          String invocationName,
                                          MethodTypeDesc invocationType) {
         return new DynamicCallSiteDesc(bootstrapMethod, invocationName, invocationType, EMPTY_CONSTANTDESC);
     }

@@ -140,10 +144,11 @@
      *                       type that would appear in the {@code NameAndType}
      *                       operand of the {@code invokedynamic}
      * @return the nominal descriptor
      * @throws NullPointerException if any parameter is null
      */
+    @Foldable
     public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod,
                                          MethodTypeDesc invocationType) {
         return of(bootstrapMethod, ConstantDescs.DEFAULT_NAME, invocationType);
     }
 

@@ -156,10 +161,11 @@
      *                      to the bootstrap, that would appear in the
      *                      {@code BootstrapMethods} attribute
      * @return the nominal descriptor
      * @throws NullPointerException if any parameter is null
      */
+    @Foldable
     public DynamicCallSiteDesc withArgs(ConstantDesc... bootstrapArgs) {
         return new DynamicCallSiteDesc(bootstrapMethod, invocationName, invocationType, bootstrapArgs);
     }
 
     /**

@@ -176,10 +182,11 @@
      * @throws NullPointerException if any parameter is null
      * @throws IllegalArgumentException if the invocation name has the incorrect
      * format
      * @jvms 4.2.2 Unqualified Names
      */
+    @Foldable
     public DynamicCallSiteDesc withNameAndType(String invocationName,
                                                MethodTypeDesc invocationType) {
         return new DynamicCallSiteDesc(bootstrapMethod, invocationName, invocationType, bootstrapArgs);
     }
 

@@ -187,30 +194,33 @@
      * Returns the invocation name that would appear in the {@code NameAndType}
      * operand of the {@code invokedynamic}.
      *
      * @return the invocation name
      */
+    @Foldable
     public String invocationName() {
         return invocationName;
     }
 
     /**
      * Returns a {@link MethodTypeDesc} describing the invocation type that
      * would appear in the {@code NameAndType} operand of the {@code invokedynamic}.
      *
      * @return the invocation type
      */
+    @Foldable
     public MethodTypeDesc invocationType() {
         return invocationType;
     }
 
     /**
      * Returns a {@link MethodHandleDesc} describing the bootstrap method for
      * the {@code invokedynamic}.
      *
      * @return the bootstrap method for the {@code invokedynamic}
      */
+    @Foldable
     public MethodHandleDesc bootstrapMethod() { return bootstrapMethod; }
 
     /**
      * Returns {@link ConstantDesc}s describing the bootstrap arguments for the
      * {@code invokedynamic}. The returned array is always non-null. A zero
< prev index next >