108 * t5:L = MethodHandle#invoke(t4, t3, a1); t5 }
109 * == general invoker for unary/unary foldArgument combination
110 * (a0:L, a1:I)=>{ t2:I = identity(long).asType((int)->long)(a1); t2 }
111 * == invoker for identity method handle which performs i2l
112 * (a0:L, a1:L)=>{ t2:L = BoundMethodHandle#argument(a0);
113 * t3:L = Class#cast(t2,a1); t3 }
114 * == invoker for identity method handle which performs cast
115 * }</pre></blockquote>
116 * <p>
117 * @author John Rose, JSR 292 EG
118 */
119 class LambdaForm {
120 final int arity;
121 final int result;
122 final boolean forceInline;
123 @Stable final Name[] names;
124 final String debugName;
125 MemberName vmentry; // low-level behavior, or null if not yet prepared
126 private boolean isCompiled;
127
128 Object transformCache; // managed by LambdaFormEditor
129
130 public static final int VOID_RESULT = -1, LAST_RESULT = -2;
131
132 enum BasicType {
133 L_TYPE('L', Object.class, Wrapper.OBJECT), // all reference types
134 I_TYPE('I', int.class, Wrapper.INT),
135 J_TYPE('J', long.class, Wrapper.LONG),
136 F_TYPE('F', float.class, Wrapper.FLOAT),
137 D_TYPE('D', double.class, Wrapper.DOUBLE), // all primitive types
138 V_TYPE('V', void.class, Wrapper.VOID); // not valid in all contexts
139
140 static final BasicType[] ALL_TYPES = BasicType.values();
141 static final BasicType[] ARG_TYPES = Arrays.copyOf(ALL_TYPES, ALL_TYPES.length-1);
142
143 static final int ARG_TYPE_LIMIT = ARG_TYPES.length;
144 static final int TYPE_LIMIT = ALL_TYPES.length;
145
146 private final char btChar;
147 private final Class<?> btClass;
148 private final Wrapper btWrapper;
|
108 * t5:L = MethodHandle#invoke(t4, t3, a1); t5 }
109 * == general invoker for unary/unary foldArgument combination
110 * (a0:L, a1:I)=>{ t2:I = identity(long).asType((int)->long)(a1); t2 }
111 * == invoker for identity method handle which performs i2l
112 * (a0:L, a1:L)=>{ t2:L = BoundMethodHandle#argument(a0);
113 * t3:L = Class#cast(t2,a1); t3 }
114 * == invoker for identity method handle which performs cast
115 * }</pre></blockquote>
116 * <p>
117 * @author John Rose, JSR 292 EG
118 */
119 class LambdaForm {
120 final int arity;
121 final int result;
122 final boolean forceInline;
123 @Stable final Name[] names;
124 final String debugName;
125 MemberName vmentry; // low-level behavior, or null if not yet prepared
126 private boolean isCompiled;
127
128 volatile Object transformCache; // managed by LambdaFormEditor
129
130 public static final int VOID_RESULT = -1, LAST_RESULT = -2;
131
132 enum BasicType {
133 L_TYPE('L', Object.class, Wrapper.OBJECT), // all reference types
134 I_TYPE('I', int.class, Wrapper.INT),
135 J_TYPE('J', long.class, Wrapper.LONG),
136 F_TYPE('F', float.class, Wrapper.FLOAT),
137 D_TYPE('D', double.class, Wrapper.DOUBLE), // all primitive types
138 V_TYPE('V', void.class, Wrapper.VOID); // not valid in all contexts
139
140 static final BasicType[] ALL_TYPES = BasicType.values();
141 static final BasicType[] ARG_TYPES = Arrays.copyOf(ALL_TYPES, ALL_TYPES.length-1);
142
143 static final int ARG_TYPE_LIMIT = ARG_TYPES.length;
144 static final int TYPE_LIMIT = ALL_TYPES.length;
145
146 private final char btChar;
147 private final Class<?> btClass;
148 private final Wrapper btWrapper;
|