139 |
141 |
140 /** |
142 /** |
141 * Return the {@link BoundMethodHandle.SpeciesData} instance representing this BMH species. All subclasses must provide a |
143 * Return the {@link BoundMethodHandle.SpeciesData} instance representing this BMH species. All subclasses must provide a |
142 * static field containing this value, and they must accordingly implement this method. |
144 * static field containing this value, and they must accordingly implement this method. |
143 */ |
145 */ |
144 /*non-public*/ abstract BoundMethodHandle.SpeciesData speciesData(); |
146 /*non-public*/ |
145 |
147 abstract BoundMethodHandle.SpeciesData speciesData(); |
146 /*non-public*/ static BoundMethodHandle.SpeciesData speciesDataFor(LambdaForm form) { |
148 |
|
149 /*non-public*/ |
|
150 static BoundMethodHandle.SpeciesData speciesDataFor(LambdaForm form) { |
147 Object c = form.names[0].constraint; |
151 Object c = form.names[0].constraint; |
148 if (c instanceof SpeciesData) { |
152 if (c instanceof SpeciesData) { |
149 return (SpeciesData) c; |
153 return (SpeciesData) c; |
150 } |
154 } |
151 // if there is no BMH constraint, then use the null constraint |
155 // if there is no BMH constraint, then use the null constraint |
193 |
199 |
194 // |
200 // |
195 // cloning API |
201 // cloning API |
196 // |
202 // |
197 |
203 |
198 /*non-public*/ abstract BoundMethodHandle copyWith(MethodType mt, LambdaForm lf); |
204 /*non-public*/ |
199 /*non-public*/ abstract BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg); |
205 abstract BoundMethodHandle copyWith(MethodType mt, LambdaForm lf); |
200 /*non-public*/ abstract BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg); |
206 /*non-public*/ |
201 /*non-public*/ abstract BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg); |
207 abstract BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg); |
202 /*non-public*/ abstract BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg); |
208 /*non-public*/ |
203 /*non-public*/ abstract BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg); |
209 abstract BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg); |
|
210 /*non-public*/ |
|
211 abstract BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg); |
|
212 /*non-public*/ |
|
213 abstract BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg); |
|
214 /*non-public*/ |
|
215 abstract BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg); |
204 |
216 |
205 // |
217 // |
206 // concrete BMH classes required to close bootstrap loops |
218 // concrete BMH classes required to close bootstrap loops |
207 // |
219 // |
208 |
220 |
215 super(mt, lf); |
227 super(mt, lf); |
216 this.argL0 = argL0; |
228 this.argL0 = argL0; |
217 } |
229 } |
218 |
230 |
219 @Override |
231 @Override |
220 /*non-public*/ SpeciesData speciesData() { |
232 /*non-public*/ |
|
233 SpeciesData speciesData() { |
221 return BMH_SPECIES; |
234 return BMH_SPECIES; |
222 } |
235 } |
223 |
236 |
224 /*non-public*/ static @Stable SpeciesData BMH_SPECIES; |
237 /*non-public*/ |
225 |
238 static @Stable SpeciesData BMH_SPECIES; |
226 /*non-public*/ static BoundMethodHandle make(MethodType mt, LambdaForm lf, Object argL0) { |
239 |
|
240 /*non-public*/ |
|
241 static BoundMethodHandle make(MethodType mt, LambdaForm lf, Object argL0) { |
227 return new Species_L(mt, lf, argL0); |
242 return new Species_L(mt, lf, argL0); |
228 } |
243 } |
229 @Override |
244 @Override |
230 /*non-public*/ final BoundMethodHandle copyWith(MethodType mt, LambdaForm lf) { |
245 /*non-public*/ |
|
246 final BoundMethodHandle copyWith(MethodType mt, LambdaForm lf) { |
231 return new Species_L(mt, lf, argL0); |
247 return new Species_L(mt, lf, argL0); |
232 } |
248 } |
233 @Override |
249 @Override |
234 /*non-public*/ final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) { |
250 /*non-public*/ |
|
251 final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) { |
235 try { |
252 try { |
236 return (BoundMethodHandle) BMH_SPECIES.extendWith(L_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg); |
253 return (BoundMethodHandle) BMH_SPECIES.extendWith(L_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg); |
237 } catch (Throwable ex) { |
254 } catch (Throwable ex) { |
238 throw uncaughtException(ex); |
255 throw uncaughtException(ex); |
239 } |
256 } |
240 } |
257 } |
241 @Override |
258 @Override |
242 /*non-public*/ final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) { |
259 /*non-public*/ |
|
260 final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) { |
243 try { |
261 try { |
244 return (BoundMethodHandle) BMH_SPECIES.extendWith(I_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg); |
262 return (BoundMethodHandle) BMH_SPECIES.extendWith(I_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg); |
245 } catch (Throwable ex) { |
263 } catch (Throwable ex) { |
246 throw uncaughtException(ex); |
264 throw uncaughtException(ex); |
247 } |
265 } |
248 } |
266 } |
249 @Override |
267 @Override |
250 /*non-public*/ final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) { |
268 /*non-public*/ |
|
269 final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) { |
251 try { |
270 try { |
252 return (BoundMethodHandle) BMH_SPECIES.extendWith(J_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg); |
271 return (BoundMethodHandle) BMH_SPECIES.extendWith(J_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg); |
253 } catch (Throwable ex) { |
272 } catch (Throwable ex) { |
254 throw uncaughtException(ex); |
273 throw uncaughtException(ex); |
255 } |
274 } |
256 } |
275 } |
257 @Override |
276 @Override |
258 /*non-public*/ final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) { |
277 /*non-public*/ |
|
278 final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) { |
259 try { |
279 try { |
260 return (BoundMethodHandle) BMH_SPECIES.extendWith(F_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg); |
280 return (BoundMethodHandle) BMH_SPECIES.extendWith(F_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg); |
261 } catch (Throwable ex) { |
281 } catch (Throwable ex) { |
262 throw uncaughtException(ex); |
282 throw uncaughtException(ex); |
263 } |
283 } |
264 } |
284 } |
265 @Override |
285 @Override |
266 /*non-public*/ final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) { |
286 /*non-public*/ |
|
287 final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) { |
267 try { |
288 try { |
268 return (BoundMethodHandle) BMH_SPECIES.extendWith(D_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg); |
289 return (BoundMethodHandle) BMH_SPECIES.extendWith(D_TYPE_NUM).factory().invokeBasic(mt, lf, argL0, narg); |
269 } catch (Throwable ex) { |
290 } catch (Throwable ex) { |
270 throw uncaughtException(ex); |
291 throw uncaughtException(ex); |
271 } |
292 } |