Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/Jsr292/src/com/ibm/j9/jsr292/PermuteTest.java
6007 views
1
/*******************************************************************************
2
* Copyright (c) 2001, 2018 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************/
22
package com.ibm.j9.jsr292;
23
import org.testng.annotations.Test;
24
import org.testng.AssertJUnit;
25
import static java.lang.invoke.MethodType.methodType;
26
27
import java.lang.invoke.MethodHandle;
28
import java.lang.invoke.MethodHandles;
29
import java.lang.invoke.MethodType;
30
31
public class PermuteTest {
32
private final static long const_arg0 = (long)-6892365923966373888L;
33
private final static int const_arg1 = (int)-1.36787674E9;
34
private final static long const_arg2 = (long)5020723882078406656L;
35
private final static float const_arg3 = (float)9.3568392E7f;
36
private final static long const_arg4 = (long)-3346392731103490048L;
37
private final static double const_arg5 = (double)5.9620004E7;
38
private final static int const_arg6 = (int)1.791556E8;
39
private final static short const_arg7 = (short)32338.05;
40
private final static byte const_arg8 = (byte)87.56171;
41
private final static int const_arg9 = (int)-4.25774784E8;
42
private final static double const_arg10 = (double)2.5361548E7;
43
private final static double const_arg11 = (double)7.3694768E7;
44
private final static long const_arg12 = (long)-385721256816320512L;
45
private final static byte const_arg13 = (byte)36.451653;
46
private final static char const_arg14 = (char)15380.821;
47
private final static long const_arg15 = (long)7821635820523210752L;
48
private final static long const_arg16 = (long)-8363124449672468480L;
49
private final static int const_arg17 = (int)1.00277594E9;
50
private final static long const_arg18 = (long)165721501884016640L;
51
private final static float const_arg19 = (float)3.4655396E7f;
52
private final static long const_arg20 = (long)6156444590360936448L;
53
private final static double const_arg21 = (double)4726905.0;
54
private final static int const_arg22 = (int)-1.21837594E9;
55
private final static short const_arg23 = (short)6472.7783;
56
private final static byte const_arg24 = (byte)30.474657;
57
private final static int const_arg25 = (int)1.71506688E9;
58
private final static double const_arg26 = (double)1.5349482E7;
59
private final static double const_arg27 = (double)3.2427682E7;
60
private final static long const_arg28 = (long)7460656684432205824L;
61
private final static byte const_arg29 = (byte)-15.571779;
62
private final static char const_arg30 = (char)43285.996;
63
private final static long const_arg31 = (long)-1802975143245193216L;
64
private final static long const_arg32 = (long)5883960166769324032L;
65
private final static int const_arg33 = (int)-9.8711814E8;
66
private final static long const_arg34 = (long)-1052688084268017664L;
67
private final static float const_arg35 = (float)6.9030704E7f;
68
private final static long const_arg36 = (long)-3364013284780521472L;
69
private final static double const_arg37 = (double)9.20242E7;
70
private final static int const_arg38 = (int)1.37702106E9;
71
private final static short const_arg39 = (short)24879.783;
72
private final static byte const_arg40 = (byte)-85.39519;
73
private final static int const_arg41 = (int)-1.68733312E9;
74
private final static double const_arg42 = (double)3.2349062E7;
75
private final static double const_arg43 = (double)7.3861544E7;
76
private final static long const_arg44 = (long)-1532836489555326976L;
77
private final static byte const_arg45 = (byte)25.961597;
78
private final static char const_arg46 = (char)33922.34;
79
private final static long const_arg47 = (long)385359843399327744L;
80
private final static long const_arg48 = (long)-7557586408342398976L;
81
private final static int const_arg49 = (int)1.59989376E9;
82
private final static long const_arg50 = (long)-1157996562330238976L;
83
private final static float const_arg51 = (float)5.9744684E7f;
84
private final static long const_arg52 = (long)8865663534676477952L;
85
private final static double const_arg53 = (double)1.3671851E7;
86
private final static int const_arg54 = (int)-2.04760947E9;
87
private final static short const_arg55 = (short)-4292.53;
88
private final static byte const_arg56 = (byte)25.82152;
89
private final static int const_arg57 = (int)-4.25327552E8;
90
private final static double const_arg58 = (double)5.2456176E7;
91
private final static double const_arg59 = (double)8.846028E7;
92
private final static long const_arg60 = (long)894138139699785728L;
93
private final static byte const_arg61 = (byte)-117.894005;
94
private final static char const_arg62 = (char)59286.867;
95
private final static long const_arg63 = (long)-2144099025012834304L;
96
private final static long const_arg64 = (long)3848515819795462144L;
97
private final static int const_arg65 = (int)1.99934733E9;
98
private final static long const_arg66 = (long)7659641690613262336L;
99
private final static float const_arg67 = (float)5516675.0f;
100
private final static long const_arg68 = (long)-7175454108298262528L;
101
private final static double const_arg69 = (double)6282143.5;
102
private final static int const_arg70 = (int)6.3125722E8;
103
private final static short const_arg71 = (short)26729.72;
104
private final static byte const_arg72 = (byte)-31.294542;
105
private final static int const_arg73 = (int)9.8630128E7;
106
private final static double const_arg74 = (double)4904516.5;
107
private final static double const_arg75 = (double)2.8933042E7;
108
private final static long const_arg76 = (long)-6165387278309316608L;
109
private final static byte const_arg77 = (byte)116.00888;
110
private final static char const_arg78 = (char)7876.2803;
111
private final static long const_arg79 = (long)15691906417793024L;
112
private final static long const_arg80 = (long)-4577520954938871808L;
113
private final static int const_arg81 = (int)7.4970202E8;
114
private final static long const_arg82 = (long)-5202988502162964480L;
115
private final static float const_arg83 = (float)1797603.8f;
116
private final static long const_arg84 = (long)-1952948710214240256L;
117
private final static double const_arg85 = (double)3.1952994E7;
118
private final static int const_arg86 = (int)-1.25982106E9;
119
private final static short const_arg87 = (short)-28133.2;
120
private final static byte const_arg88 = (byte)-22.708725;
121
private final static int const_arg89 = (int)-1.60444659E9;
122
private final static double const_arg90 = (double)9.7068632E7;
123
private final static double const_arg91 = (double)4.3367112E7;
124
private final static long const_arg92 = (long)-686509902579492864L;
125
private final static byte const_arg93 = (byte)-18.706009;
126
private final static char const_arg94 = (char)10218.4795;
127
private final static long const_arg95 = (long)-6424251652327706624L;
128
private final static long const_arg96 = (long)7457627073118101504L;
129
private final static int const_arg97 = (int)7.9667002E8;
130
private final static long const_arg98 = (long)6854808083107350528L;
131
private final static float const_arg99 = (float)5.8473244E7f;
132
private final static long const_arg100 = (long)3756734949877604352L;
133
private final static double const_arg101 = (double)2.2191902E7;
134
private final static int const_arg102 = (int)-7.4360184E7;
135
private final static short const_arg103 = (short)6042.5938;
136
private final static byte const_arg104 = (byte)83.2126;
137
private final static int const_arg105 = (int)-1.82334362E9;
138
private final static double const_arg106 = (double)5.5482588E7;
139
private final static double const_arg107 = (double)9.0001464E7;
140
private final static long const_arg108 = (long)3249931783055529984L;
141
private final static byte const_arg109 = (byte)84.56544;
142
private final static char const_arg110 = (char)31136.785;
143
private final static long const_arg111 = (long)3516850932204554240L;
144
private final static long const_arg112 = (long)-5888803777585096704L;
145
private final static int const_arg113 = (int)-1.68064397E9;
146
private final static long const_arg114 = (long)-4327247690940416000L;
147
private final static float const_arg115 = (float)2.4208068E7f;
148
private final static long const_arg116 = (long)6750097495138787328L;
149
private final static double const_arg117 = (double)3.473052E7;
150
private final static int const_arg118 = (int)5.5497798E8;
151
private final static short const_arg119 = (short)-32579.36;
152
private final static byte const_arg120 = (byte)73.74936;
153
private final static int const_arg121 = (int)2.14067226E9;
154
private final static double const_arg122 = (double)3.287431E7;
155
private final static double const_arg123 = (double)8.3640952E7;
156
private final static long const_arg124 = (long)-8792505295524775936L;
157
private final static byte const_arg125 = (byte)44.532955;
158
private final static char const_arg126 = (char)37749.37;
159
private final static long const_arg127 = (long)-3822851795018663936L;
160
private final static long const_arg128 = (long)9196396167515975680L;
161
private final static int const_arg129 = (int)1.49046182E9;
162
private final static long const_arg130 = (long)-4804481289906941952L;
163
private final static float const_arg131 = (float)6.7429768E7f;
164
private final static long const_arg132 = (long)7318894466057721856L;
165
private final static double const_arg133 = (double)7.322988E7;
166
private final static int const_arg134 = (int)-7.8201882E8;
167
private final static short const_arg135 = (short)-9883.521;
168
private final static byte const_arg136 = (byte)112.27744;
169
private final static int const_arg137 = (int)4.09239488E8;
170
private final static double const_arg138 = (double)3.1215462E7;
171
private final static double const_arg139 = (double)2.3711122E7;
172
private final static long const_arg140 = (long)-2525075035488512000L;
173
private final static byte const_arg141 = (byte)-54.741833;
174
private final static char const_arg142 = (char)55086.42;
175
private final static long const_arg143 = (long)2619822279144327168L;
176
private final static long const_arg144 = (long)1782600000134451200L;
177
private final static int const_arg145 = (int)2.00862758E9;
178
private final static long const_arg146 = (long)-7689938984100495360L;
179
private final static float const_arg147 = (float)6.395436E7f;
180
private final static long const_arg148 = (long)-5331956767576809472L;
181
private final static double const_arg149 = (double)1.9876176E7;
182
private final static int const_arg150 = (int)-3.57940736E8;
183
private final static short const_arg151 = (short)-30176.2;
184
private final static byte const_arg152 = (byte)108.62074;
185
private final static int const_arg153 = (int)-1.29248717E9;
186
private final static double const_arg154 = (double)9.0787024E7;
187
private final static double const_arg155 = (double)5.3953652E7;
188
private final static long const_arg156 = (long)-7766467616506161152L;
189
private final static byte const_arg157 = (byte)101.02202;
190
private final static char const_arg158 = (char)11022.495;
191
private final static long const_arg159 = (long)-8111151907935979520L;
192
private final static long const_arg160 = (long)5590287327717490688L;
193
private final static int const_arg161 = (int)3.34640736E8;
194
private final static long const_arg162 = (long)-1060203494556989440L;
195
private final static float const_arg163 = (float)4.1251936E7f;
196
private final static long const_arg164 = (long)-3607266653153327104L;
197
private final static double const_arg165 = (double)3.086726E7;
198
private final static int const_arg166 = (int)8.7350944E8;
199
private final static short const_arg167 = (short)-7758.0845;
200
private final static byte const_arg168 = (byte)6.8055143;
201
private final static int const_arg169 = (int)-1.75682995E9;
202
203
/* Verify each argument against an expected constant */
204
public static void test(long arg0, int arg1, long arg2, float arg3, long arg4, double arg5, int arg6, short arg7, byte arg8, int arg9, double arg10, double arg11, long arg12, byte arg13, char arg14, long arg15, long arg16, int arg17, long arg18, float arg19, long arg20, double arg21, int arg22, short arg23, byte arg24, int arg25, double arg26, double arg27, long arg28, byte arg29, char arg30, long arg31, long arg32, int arg33, long arg34, float arg35, long arg36, double arg37, int arg38, short arg39, byte arg40, int arg41, double arg42, double arg43, long arg44, byte arg45, char arg46, long arg47, long arg48, int arg49, long arg50, float arg51, long arg52, double arg53, int arg54, short arg55, byte arg56, int arg57, double arg58, double arg59, long arg60, byte arg61, char arg62, long arg63, long arg64, int arg65, long arg66, float arg67, long arg68, double arg69, int arg70, short arg71, byte arg72, int arg73, double arg74, double arg75, long arg76, byte arg77, char arg78, long arg79, long arg80, int arg81, long arg82, float arg83, long arg84, double arg85, int arg86, short arg87, byte arg88, int arg89, double arg90, double arg91, long arg92, byte arg93, char arg94, long arg95, long arg96, int arg97, long arg98, float arg99, long arg100, double arg101, int arg102, short arg103, byte arg104, int arg105, double arg106, double arg107, long arg108, byte arg109, char arg110, long arg111, long arg112, int arg113, long arg114, float arg115, long arg116, double arg117, int arg118, short arg119, byte arg120, int arg121, double arg122, double arg123, long arg124, byte arg125, char arg126, long arg127, long arg128, int arg129, long arg130, float arg131, long arg132, double arg133, int arg134, short arg135, byte arg136, int arg137, double arg138, double arg139, long arg140, byte arg141, char arg142, long arg143, long arg144, int arg145, long arg146, float arg147, long arg148, double arg149, int arg150, short arg151, byte arg152, int arg153, double arg154, double arg155, long arg156, byte arg157, char arg158, long arg159, long arg160, int arg161, long arg162, float arg163, long arg164, double arg165, int arg166, short arg167, byte arg168, int arg169) throws IllegalArgumentException {
205
int index = 0;
206
if(arg0 != const_arg0) {
207
throw new IllegalArgumentException("Unexpected argument at index "+index);
208
}
209
index++;
210
if(arg1 != const_arg1) {
211
throw new IllegalArgumentException("Unexpected argument at index "+index);
212
}
213
index++;
214
if(arg2 != const_arg2) {
215
throw new IllegalArgumentException("Unexpected argument at index "+index);
216
}
217
index++;
218
if(arg3 != const_arg3) {
219
throw new IllegalArgumentException("Unexpected argument at index "+index);
220
}
221
index++;
222
if(arg4 != const_arg4) {
223
throw new IllegalArgumentException("Unexpected argument at index "+index);
224
}
225
index++;
226
if(arg5 != const_arg5) {
227
throw new IllegalArgumentException("Unexpected argument at index "+index);
228
}
229
index++;
230
if(arg6 != const_arg6) {
231
throw new IllegalArgumentException("Unexpected argument at index "+index);
232
}
233
index++;
234
if(arg7 != const_arg7) {
235
throw new IllegalArgumentException("Unexpected argument at index "+index);
236
}
237
index++;
238
if(arg8 != const_arg8) {
239
throw new IllegalArgumentException("Unexpected argument at index "+index);
240
}
241
index++;
242
if(arg9 != const_arg9) {
243
throw new IllegalArgumentException("Unexpected argument at index "+index);
244
}
245
index++;
246
if(arg10 != const_arg10) {
247
throw new IllegalArgumentException("Unexpected argument at index "+index);
248
}
249
index++;
250
if(arg11 != const_arg11) {
251
throw new IllegalArgumentException("Unexpected argument at index "+index);
252
}
253
index++;
254
if(arg12 != const_arg12) {
255
throw new IllegalArgumentException("Unexpected argument at index "+index);
256
}
257
index++;
258
if(arg13 != const_arg13) {
259
throw new IllegalArgumentException("Unexpected argument at index "+index);
260
}
261
index++;
262
if(arg14 != const_arg14) {
263
throw new IllegalArgumentException("Unexpected argument at index "+index);
264
}
265
index++;
266
if(arg15 != const_arg15) {
267
throw new IllegalArgumentException("Unexpected argument at index "+index);
268
}
269
index++;
270
if(arg16 != const_arg16) {
271
throw new IllegalArgumentException("Unexpected argument at index "+index);
272
}
273
index++;
274
if(arg17 != const_arg17) {
275
throw new IllegalArgumentException("Unexpected argument at index "+index);
276
}
277
index++;
278
if(arg18 != const_arg18) {
279
throw new IllegalArgumentException("Unexpected argument at index "+index);
280
}
281
index++;
282
if(arg19 != const_arg19) {
283
throw new IllegalArgumentException("Unexpected argument at index "+index);
284
}
285
index++;
286
if(arg20 != const_arg20) {
287
throw new IllegalArgumentException("Unexpected argument at index "+index);
288
}
289
index++;
290
if(arg21 != const_arg21) {
291
throw new IllegalArgumentException("Unexpected argument at index "+index);
292
}
293
index++;
294
if(arg22 != const_arg22) {
295
throw new IllegalArgumentException("Unexpected argument at index "+index);
296
}
297
index++;
298
if(arg23 != const_arg23) {
299
throw new IllegalArgumentException("Unexpected argument at index "+index);
300
}
301
index++;
302
if(arg24 != const_arg24) {
303
throw new IllegalArgumentException("Unexpected argument at index "+index);
304
}
305
index++;
306
if(arg25 != const_arg25) {
307
throw new IllegalArgumentException("Unexpected argument at index "+index);
308
}
309
index++;
310
if(arg26 != const_arg26) {
311
throw new IllegalArgumentException("Unexpected argument at index "+index);
312
}
313
index++;
314
if(arg27 != const_arg27) {
315
throw new IllegalArgumentException("Unexpected argument at index "+index);
316
}
317
index++;
318
if(arg28 != const_arg28) {
319
throw new IllegalArgumentException("Unexpected argument at index "+index);
320
}
321
index++;
322
if(arg29 != const_arg29) {
323
throw new IllegalArgumentException("Unexpected argument at index "+index);
324
}
325
index++;
326
if(arg30 != const_arg30) {
327
throw new IllegalArgumentException("Unexpected argument at index "+index);
328
}
329
index++;
330
if(arg31 != const_arg31) {
331
throw new IllegalArgumentException("Unexpected argument at index "+index);
332
}
333
index++;
334
if(arg32 != const_arg32) {
335
throw new IllegalArgumentException("Unexpected argument at index "+index);
336
}
337
index++;
338
if(arg33 != const_arg33) {
339
throw new IllegalArgumentException("Unexpected argument at index "+index);
340
}
341
index++;
342
if(arg34 != const_arg34) {
343
throw new IllegalArgumentException("Unexpected argument at index "+index);
344
}
345
index++;
346
if(arg35 != const_arg35) {
347
throw new IllegalArgumentException("Unexpected argument at index "+index);
348
}
349
index++;
350
if(arg36 != const_arg36) {
351
throw new IllegalArgumentException("Unexpected argument at index "+index);
352
}
353
index++;
354
if(arg37 != const_arg37) {
355
throw new IllegalArgumentException("Unexpected argument at index "+index);
356
}
357
index++;
358
if(arg38 != const_arg38) {
359
throw new IllegalArgumentException("Unexpected argument at index "+index);
360
}
361
index++;
362
if(arg39 != const_arg39) {
363
throw new IllegalArgumentException("Unexpected argument at index "+index);
364
}
365
index++;
366
if(arg40 != const_arg40) {
367
throw new IllegalArgumentException("Unexpected argument at index "+index);
368
}
369
index++;
370
if(arg41 != const_arg41) {
371
throw new IllegalArgumentException("Unexpected argument at index "+index);
372
}
373
index++;
374
if(arg42 != const_arg42) {
375
throw new IllegalArgumentException("Unexpected argument at index "+index);
376
}
377
index++;
378
if(arg43 != const_arg43) {
379
throw new IllegalArgumentException("Unexpected argument at index "+index);
380
}
381
index++;
382
if(arg44 != const_arg44) {
383
throw new IllegalArgumentException("Unexpected argument at index "+index);
384
}
385
index++;
386
if(arg45 != const_arg45) {
387
throw new IllegalArgumentException("Unexpected argument at index "+index);
388
}
389
index++;
390
if(arg46 != const_arg46) {
391
throw new IllegalArgumentException("Unexpected argument at index "+index);
392
}
393
index++;
394
if(arg47 != const_arg47) {
395
throw new IllegalArgumentException("Unexpected argument at index "+index);
396
}
397
index++;
398
if(arg48 != const_arg48) {
399
throw new IllegalArgumentException("Unexpected argument at index "+index);
400
}
401
index++;
402
if(arg49 != const_arg49) {
403
throw new IllegalArgumentException("Unexpected argument at index "+index);
404
}
405
index++;
406
if(arg50 != const_arg50) {
407
throw new IllegalArgumentException("Unexpected argument at index "+index);
408
}
409
index++;
410
if(arg51 != const_arg51) {
411
throw new IllegalArgumentException("Unexpected argument at index "+index);
412
}
413
index++;
414
if(arg52 != const_arg52) {
415
throw new IllegalArgumentException("Unexpected argument at index "+index);
416
}
417
index++;
418
if(arg53 != const_arg53) {
419
throw new IllegalArgumentException("Unexpected argument at index "+index);
420
}
421
index++;
422
if(arg54 != const_arg54) {
423
throw new IllegalArgumentException("Unexpected argument at index "+index);
424
}
425
index++;
426
if(arg55 != const_arg55) {
427
throw new IllegalArgumentException("Unexpected argument at index "+index);
428
}
429
index++;
430
if(arg56 != const_arg56) {
431
throw new IllegalArgumentException("Unexpected argument at index "+index);
432
}
433
index++;
434
if(arg57 != const_arg57) {
435
throw new IllegalArgumentException("Unexpected argument at index "+index);
436
}
437
index++;
438
if(arg58 != const_arg58) {
439
throw new IllegalArgumentException("Unexpected argument at index "+index);
440
}
441
index++;
442
if(arg59 != const_arg59) {
443
throw new IllegalArgumentException("Unexpected argument at index "+index);
444
}
445
index++;
446
if(arg60 != const_arg60) {
447
throw new IllegalArgumentException("Unexpected argument at index "+index);
448
}
449
index++;
450
if(arg61 != const_arg61) {
451
throw new IllegalArgumentException("Unexpected argument at index "+index);
452
}
453
index++;
454
if(arg62 != const_arg62) {
455
throw new IllegalArgumentException("Unexpected argument at index "+index);
456
}
457
index++;
458
if(arg63 != const_arg63) {
459
throw new IllegalArgumentException("Unexpected argument at index "+index);
460
}
461
index++;
462
if(arg64 != const_arg64) {
463
throw new IllegalArgumentException("Unexpected argument at index "+index);
464
}
465
index++;
466
if(arg65 != const_arg65) {
467
throw new IllegalArgumentException("Unexpected argument at index "+index);
468
}
469
index++;
470
if(arg66 != const_arg66) {
471
throw new IllegalArgumentException("Unexpected argument at index "+index);
472
}
473
index++;
474
if(arg67 != const_arg67) {
475
throw new IllegalArgumentException("Unexpected argument at index "+index);
476
}
477
index++;
478
if(arg68 != const_arg68) {
479
throw new IllegalArgumentException("Unexpected argument at index "+index);
480
}
481
index++;
482
if(arg69 != const_arg69) {
483
throw new IllegalArgumentException("Unexpected argument at index "+index);
484
}
485
index++;
486
if(arg70 != const_arg70) {
487
throw new IllegalArgumentException("Unexpected argument at index "+index);
488
}
489
index++;
490
if(arg71 != const_arg71) {
491
throw new IllegalArgumentException("Unexpected argument at index "+index);
492
}
493
index++;
494
if(arg72 != const_arg72) {
495
throw new IllegalArgumentException("Unexpected argument at index "+index);
496
}
497
index++;
498
if(arg73 != const_arg73) {
499
throw new IllegalArgumentException("Unexpected argument at index "+index);
500
}
501
index++;
502
if(arg74 != const_arg74) {
503
throw new IllegalArgumentException("Unexpected argument at index "+index);
504
}
505
index++;
506
if(arg75 != const_arg75) {
507
throw new IllegalArgumentException("Unexpected argument at index "+index);
508
}
509
index++;
510
if(arg76 != const_arg76) {
511
throw new IllegalArgumentException("Unexpected argument at index "+index);
512
}
513
index++;
514
if(arg77 != const_arg77) {
515
throw new IllegalArgumentException("Unexpected argument at index "+index);
516
}
517
index++;
518
if(arg78 != const_arg78) {
519
throw new IllegalArgumentException("Unexpected argument at index "+index);
520
}
521
index++;
522
if(arg79 != const_arg79) {
523
throw new IllegalArgumentException("Unexpected argument at index "+index);
524
}
525
index++;
526
if(arg80 != const_arg80) {
527
throw new IllegalArgumentException("Unexpected argument at index "+index);
528
}
529
index++;
530
if(arg81 != const_arg81) {
531
throw new IllegalArgumentException("Unexpected argument at index "+index);
532
}
533
index++;
534
if(arg82 != const_arg82) {
535
throw new IllegalArgumentException("Unexpected argument at index "+index);
536
}
537
index++;
538
if(arg83 != const_arg83) {
539
throw new IllegalArgumentException("Unexpected argument at index "+index);
540
}
541
index++;
542
if(arg84 != const_arg84) {
543
throw new IllegalArgumentException("Unexpected argument at index "+index);
544
}
545
index++;
546
if(arg85 != const_arg85) {
547
throw new IllegalArgumentException("Unexpected argument at index "+index);
548
}
549
index++;
550
if(arg86 != const_arg86) {
551
throw new IllegalArgumentException("Unexpected argument at index "+index);
552
}
553
index++;
554
if(arg87 != const_arg87) {
555
throw new IllegalArgumentException("Unexpected argument at index "+index);
556
}
557
index++;
558
if(arg88 != const_arg88) {
559
throw new IllegalArgumentException("Unexpected argument at index "+index);
560
}
561
index++;
562
if(arg89 != const_arg89) {
563
throw new IllegalArgumentException("Unexpected argument at index "+index);
564
}
565
index++;
566
if(arg90 != const_arg90) {
567
throw new IllegalArgumentException("Unexpected argument at index "+index);
568
}
569
index++;
570
if(arg91 != const_arg91) {
571
throw new IllegalArgumentException("Unexpected argument at index "+index);
572
}
573
index++;
574
if(arg92 != const_arg92) {
575
throw new IllegalArgumentException("Unexpected argument at index "+index);
576
}
577
index++;
578
if(arg93 != const_arg93) {
579
throw new IllegalArgumentException("Unexpected argument at index "+index);
580
}
581
index++;
582
if(arg94 != const_arg94) {
583
throw new IllegalArgumentException("Unexpected argument at index "+index);
584
}
585
index++;
586
if(arg95 != const_arg95) {
587
throw new IllegalArgumentException("Unexpected argument at index "+index);
588
}
589
index++;
590
if(arg96 != const_arg96) {
591
throw new IllegalArgumentException("Unexpected argument at index "+index);
592
}
593
index++;
594
if(arg97 != const_arg97) {
595
throw new IllegalArgumentException("Unexpected argument at index "+index);
596
}
597
index++;
598
if(arg98 != const_arg98) {
599
throw new IllegalArgumentException("Unexpected argument at index "+index);
600
}
601
index++;
602
if(arg99 != const_arg99) {
603
throw new IllegalArgumentException("Unexpected argument at index "+index);
604
}
605
index++;
606
if(arg100 != const_arg100) {
607
throw new IllegalArgumentException("Unexpected argument at index "+index);
608
}
609
index++;
610
if(arg101 != const_arg101) {
611
throw new IllegalArgumentException("Unexpected argument at index "+index);
612
}
613
index++;
614
if(arg102 != const_arg102) {
615
throw new IllegalArgumentException("Unexpected argument at index "+index);
616
}
617
index++;
618
if(arg103 != const_arg103) {
619
throw new IllegalArgumentException("Unexpected argument at index "+index);
620
}
621
index++;
622
if(arg104 != const_arg104) {
623
throw new IllegalArgumentException("Unexpected argument at index "+index);
624
}
625
index++;
626
if(arg105 != const_arg105) {
627
throw new IllegalArgumentException("Unexpected argument at index "+index);
628
}
629
index++;
630
if(arg106 != const_arg106) {
631
throw new IllegalArgumentException("Unexpected argument at index "+index);
632
}
633
index++;
634
if(arg107 != const_arg107) {
635
throw new IllegalArgumentException("Unexpected argument at index "+index);
636
}
637
index++;
638
if(arg108 != const_arg108) {
639
throw new IllegalArgumentException("Unexpected argument at index "+index);
640
}
641
index++;
642
if(arg109 != const_arg109) {
643
throw new IllegalArgumentException("Unexpected argument at index "+index);
644
}
645
index++;
646
if(arg110 != const_arg110) {
647
throw new IllegalArgumentException("Unexpected argument at index "+index);
648
}
649
index++;
650
if(arg111 != const_arg111) {
651
throw new IllegalArgumentException("Unexpected argument at index "+index);
652
}
653
index++;
654
if(arg112 != const_arg112) {
655
throw new IllegalArgumentException("Unexpected argument at index "+index);
656
}
657
index++;
658
if(arg113 != const_arg113) {
659
throw new IllegalArgumentException("Unexpected argument at index "+index);
660
}
661
index++;
662
if(arg114 != const_arg114) {
663
throw new IllegalArgumentException("Unexpected argument at index "+index);
664
}
665
index++;
666
if(arg115 != const_arg115) {
667
throw new IllegalArgumentException("Unexpected argument at index "+index);
668
}
669
index++;
670
if(arg116 != const_arg116) {
671
throw new IllegalArgumentException("Unexpected argument at index "+index);
672
}
673
index++;
674
if(arg117 != const_arg117) {
675
throw new IllegalArgumentException("Unexpected argument at index "+index);
676
}
677
index++;
678
if(arg118 != const_arg118) {
679
throw new IllegalArgumentException("Unexpected argument at index "+index);
680
}
681
index++;
682
if(arg119 != const_arg119) {
683
throw new IllegalArgumentException("Unexpected argument at index "+index);
684
}
685
index++;
686
if(arg120 != const_arg120) {
687
throw new IllegalArgumentException("Unexpected argument at index "+index);
688
}
689
index++;
690
if(arg121 != const_arg121) {
691
throw new IllegalArgumentException("Unexpected argument at index "+index);
692
}
693
index++;
694
if(arg122 != const_arg122) {
695
throw new IllegalArgumentException("Unexpected argument at index "+index);
696
}
697
index++;
698
if(arg123 != const_arg123) {
699
throw new IllegalArgumentException("Unexpected argument at index "+index);
700
}
701
index++;
702
if(arg124 != const_arg124) {
703
throw new IllegalArgumentException("Unexpected argument at index "+index);
704
}
705
index++;
706
if(arg125 != const_arg125) {
707
throw new IllegalArgumentException("Unexpected argument at index "+index);
708
}
709
index++;
710
if(arg126 != const_arg126) {
711
throw new IllegalArgumentException("Unexpected argument at index "+index);
712
}
713
index++;
714
if(arg127 != const_arg127) {
715
throw new IllegalArgumentException("Unexpected argument at index "+index);
716
}
717
index++;
718
if(arg128 != const_arg128) {
719
throw new IllegalArgumentException("Unexpected argument at index "+index);
720
}
721
index++;
722
if(arg129 != const_arg129) {
723
throw new IllegalArgumentException("Unexpected argument at index "+index);
724
}
725
index++;
726
if(arg130 != const_arg130) {
727
throw new IllegalArgumentException("Unexpected argument at index "+index);
728
}
729
index++;
730
if(arg131 != const_arg131) {
731
throw new IllegalArgumentException("Unexpected argument at index "+index);
732
}
733
index++;
734
if(arg132 != const_arg132) {
735
throw new IllegalArgumentException("Unexpected argument at index "+index);
736
}
737
index++;
738
if(arg133 != const_arg133) {
739
throw new IllegalArgumentException("Unexpected argument at index "+index);
740
}
741
index++;
742
if(arg134 != const_arg134) {
743
throw new IllegalArgumentException("Unexpected argument at index "+index);
744
}
745
index++;
746
if(arg135 != const_arg135) {
747
throw new IllegalArgumentException("Unexpected argument at index "+index);
748
}
749
index++;
750
if(arg136 != const_arg136) {
751
throw new IllegalArgumentException("Unexpected argument at index "+index);
752
}
753
index++;
754
if(arg137 != const_arg137) {
755
throw new IllegalArgumentException("Unexpected argument at index "+index);
756
}
757
index++;
758
if(arg138 != const_arg138) {
759
throw new IllegalArgumentException("Unexpected argument at index "+index);
760
}
761
index++;
762
if(arg139 != const_arg139) {
763
throw new IllegalArgumentException("Unexpected argument at index "+index);
764
}
765
index++;
766
if(arg140 != const_arg140) {
767
throw new IllegalArgumentException("Unexpected argument at index "+index);
768
}
769
index++;
770
if(arg141 != const_arg141) {
771
throw new IllegalArgumentException("Unexpected argument at index "+index);
772
}
773
index++;
774
if(arg142 != const_arg142) {
775
throw new IllegalArgumentException("Unexpected argument at index "+index);
776
}
777
index++;
778
if(arg143 != const_arg143) {
779
throw new IllegalArgumentException("Unexpected argument at index "+index);
780
}
781
index++;
782
if(arg144 != const_arg144) {
783
throw new IllegalArgumentException("Unexpected argument at index "+index);
784
}
785
index++;
786
if(arg145 != const_arg145) {
787
throw new IllegalArgumentException("Unexpected argument at index "+index);
788
}
789
index++;
790
if(arg146 != const_arg146) {
791
throw new IllegalArgumentException("Unexpected argument at index "+index);
792
}
793
index++;
794
if(arg147 != const_arg147) {
795
throw new IllegalArgumentException("Unexpected argument at index "+index);
796
}
797
index++;
798
if(arg148 != const_arg148) {
799
throw new IllegalArgumentException("Unexpected argument at index "+index);
800
}
801
index++;
802
if(arg149 != const_arg149) {
803
throw new IllegalArgumentException("Unexpected argument at index "+index);
804
}
805
index++;
806
if(arg150 != const_arg150) {
807
throw new IllegalArgumentException("Unexpected argument at index "+index);
808
}
809
index++;
810
if(arg151 != const_arg151) {
811
throw new IllegalArgumentException("Unexpected argument at index "+index);
812
}
813
index++;
814
if(arg152 != const_arg152) {
815
throw new IllegalArgumentException("Unexpected argument at index "+index);
816
}
817
index++;
818
if(arg153 != const_arg153) {
819
throw new IllegalArgumentException("Unexpected argument at index "+index);
820
}
821
index++;
822
if(arg154 != const_arg154) {
823
throw new IllegalArgumentException("Unexpected argument at index "+index);
824
}
825
index++;
826
if(arg155 != const_arg155) {
827
throw new IllegalArgumentException("Unexpected argument at index "+index);
828
}
829
index++;
830
if(arg156 != const_arg156) {
831
throw new IllegalArgumentException("Unexpected argument at index "+index);
832
}
833
index++;
834
if(arg157 != const_arg157) {
835
throw new IllegalArgumentException("Unexpected argument at index "+index);
836
}
837
index++;
838
if(arg158 != const_arg158) {
839
throw new IllegalArgumentException("Unexpected argument at index "+index);
840
}
841
index++;
842
if(arg159 != const_arg159) {
843
throw new IllegalArgumentException("Unexpected argument at index "+index);
844
}
845
index++;
846
if(arg160 != const_arg160) {
847
throw new IllegalArgumentException("Unexpected argument at index "+index);
848
}
849
index++;
850
if(arg161 != const_arg161) {
851
throw new IllegalArgumentException("Unexpected argument at index "+index);
852
}
853
index++;
854
if(arg162 != const_arg162) {
855
throw new IllegalArgumentException("Unexpected argument at index "+index);
856
}
857
index++;
858
if(arg163 != const_arg163) {
859
throw new IllegalArgumentException("Unexpected argument at index "+index);
860
}
861
index++;
862
if(arg164 != const_arg164) {
863
throw new IllegalArgumentException("Unexpected argument at index "+index);
864
}
865
index++;
866
if(arg165 != const_arg165) {
867
throw new IllegalArgumentException("Unexpected argument at index "+index);
868
}
869
index++;
870
if(arg166 != const_arg166) {
871
throw new IllegalArgumentException("Unexpected argument at index "+index);
872
}
873
index++;
874
if(arg167 != const_arg167) {
875
throw new IllegalArgumentException("Unexpected argument at index "+index);
876
}
877
index++;
878
if(arg168 != const_arg168) {
879
throw new IllegalArgumentException("Unexpected argument at index "+index);
880
}
881
index++;
882
if(arg169 != const_arg169) {
883
throw new IllegalArgumentException("Unexpected argument at index "+index);
884
}
885
}
886
887
/**
888
* Stress test permuteArguments by making call using the maximum number of stack slots (255). Keep in mind
889
* that the receiver consumes a single stack slot so only 254 slots are available. The method test
890
* (found within this class) compares each argument with an expected value. In essence, this test
891
* reverses the argument order and verifies the results.
892
* @throws Throwable
893
*/
894
@Test(groups = { "level.extended" })
895
public void testPermuteHandleMaximumArguments() throws Throwable {
896
// Describe the test function
897
MethodType mt = methodType(void.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class, double.class, double.class, long.class, byte.class, char.class, long.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class, double.class, double.class, long.class, byte.class, char.class, long.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class, double.class, double.class, long.class, byte.class, char.class, long.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class, double.class, double.class, long.class, byte.class, char.class, long.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class, double.class, double.class, long.class, byte.class, char.class, long.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class, double.class, double.class, long.class, byte.class, char.class, long.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class, double.class, double.class, long.class, byte.class, char.class, long.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class, double.class, double.class, long.class, byte.class, char.class, long.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class, double.class, double.class, long.class, byte.class, char.class, long.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class, double.class, double.class, long.class, byte.class, char.class, long.class, long.class, int.class, long.class, float.class, long.class, double.class, int.class, short.class, byte.class, int.class);
898
899
// Describe the test function
900
MethodType rmt = methodType(void.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class, long.class, char.class, byte.class, long.class, double.class, double.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class, long.class, char.class, byte.class, long.class, double.class, double.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class, long.class, char.class, byte.class, long.class, double.class, double.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class, long.class, char.class, byte.class, long.class, double.class, double.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class, long.class, char.class, byte.class, long.class, double.class, double.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class, long.class, char.class, byte.class, long.class, double.class, double.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class, long.class, char.class, byte.class, long.class, double.class, double.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class, long.class, char.class, byte.class, long.class, double.class, double.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class, long.class, char.class, byte.class, long.class, double.class, double.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class, long.class, char.class, byte.class, long.class, double.class, double.class, int.class, byte.class, short.class, int.class, double.class, long.class, float.class, long.class, int.class, long.class);
901
902
// Lookup and create the destination function MethodHandle
903
MethodHandle mh = MethodHandles.publicLookup().findStatic(PermuteTest.class, "test", mt);
904
905
// Permute the arguments
906
mh = MethodHandles.permuteArguments(mh, rmt, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
907
908
boolean exceptionThrown = false;
909
910
try {
911
// Invoke the method handle, which returns the argument index which didn't match what it expected, or -1 on success
912
mh.invoke(const_arg169, const_arg168, const_arg167, const_arg166, const_arg165, const_arg164, const_arg163, const_arg162, const_arg161, const_arg160, const_arg159, const_arg158, const_arg157, const_arg156, const_arg155, const_arg154, const_arg153, const_arg152, const_arg151, const_arg150, const_arg149, const_arg148, const_arg147, const_arg146, const_arg145, const_arg144, const_arg143, const_arg142, const_arg141, const_arg140, const_arg139, const_arg138, const_arg137, const_arg136, const_arg135, const_arg134, const_arg133, const_arg132, const_arg131, const_arg130, const_arg129, const_arg128, const_arg127, const_arg126, const_arg125, const_arg124, const_arg123, const_arg122, const_arg121, const_arg120, const_arg119, const_arg118, const_arg117, const_arg116, const_arg115, const_arg114, const_arg113, const_arg112, const_arg111, const_arg110, const_arg109, const_arg108, const_arg107, const_arg106, const_arg105, const_arg104, const_arg103, const_arg102, const_arg101, const_arg100, const_arg99, const_arg98, const_arg97, const_arg96, const_arg95, const_arg94, const_arg93, const_arg92, const_arg91, const_arg90, const_arg89, const_arg88, const_arg87, const_arg86, const_arg85, const_arg84, const_arg83, const_arg82, const_arg81, const_arg80, const_arg79, const_arg78, const_arg77, const_arg76, const_arg75, const_arg74, const_arg73, const_arg72, const_arg71, const_arg70, const_arg69, const_arg68, const_arg67, const_arg66, const_arg65, const_arg64, const_arg63, const_arg62, const_arg61, const_arg60, const_arg59, const_arg58, const_arg57, const_arg56, const_arg55, const_arg54, const_arg53, const_arg52, const_arg51, const_arg50, const_arg49, const_arg48, const_arg47, const_arg46, const_arg45, const_arg44, const_arg43, const_arg42, const_arg41, const_arg40, const_arg39, const_arg38, const_arg37, const_arg36, const_arg35, const_arg34, const_arg33, const_arg32, const_arg31, const_arg30, const_arg29, const_arg28, const_arg27, const_arg26, const_arg25, const_arg24, const_arg23, const_arg22, const_arg21, const_arg20, const_arg19, const_arg18, const_arg17, const_arg16, const_arg15, const_arg14, const_arg13, const_arg12, const_arg11, const_arg10, const_arg9, const_arg8, const_arg7, const_arg6, const_arg5, const_arg4, const_arg3, const_arg2, const_arg1, const_arg0);
913
} catch (Exception e) {
914
e.printStackTrace();
915
exceptionThrown = true;
916
}
917
918
AssertJUnit.assertFalse(exceptionThrown);
919
}
920
921
/**
922
* Do a series of simple tests to permute arguments in various ways. The test builds on top of each other
923
* and does a series of drops and duplications, intending to stress test argument permutation. Double
924
* slot and single slot arguments are mixed in an attempt to find any possible issues.
925
* @throws Throwable
926
*/
927
@Test(groups = { "level.extended" })
928
public void testPermuteArguments() throws Throwable {
929
MethodType I_I_type = methodType(int.class, int.class);
930
MethodType II_I_type = methodType(int.class, int.class, int.class);
931
932
MethodHandle sub = MethodHandles.publicLookup().findStatic(AdaptorTests.class, "subtract", II_I_type);
933
AssertJUnit.assertTrue(sub.type().equals(II_I_type));
934
935
MethodHandle rsub = MethodHandles.permuteArguments(sub, II_I_type, 1, 0);
936
AssertJUnit.assertEquals(4, (int)rsub.invokeExact(1, 5));
937
938
MethodHandle add = MethodHandles.publicLookup().findStatic(AdaptorTests.class, "add", II_I_type);
939
AssertJUnit.assertEquals(II_I_type, add.type());
940
941
MethodHandle twice = MethodHandles.permuteArguments(add, I_I_type, 0, 0);
942
AssertJUnit.assertEquals(I_I_type, twice.type());
943
AssertJUnit.assertEquals(14, (int)twice.invokeExact(7));
944
945
// Create an identity handle
946
MethodHandle iIdent = MethodHandles.identity(int.class);
947
MethodHandle dIdent = MethodHandles.identity(double.class);
948
949
// Create permute handle that takes a double and an int, and drops the double
950
MethodType DI_I_type = methodType(int.class, double.class, int.class);
951
MethodHandle diiHandle = MethodHandles.permuteArguments(iIdent, DI_I_type, 1);
952
AssertJUnit.assertEquals(1, diiHandle.invoke(1.2,1));
953
954
// Create a permute handle that takes a double and an int, and drops the int
955
MethodType DI_D_type = methodType(double.class, double.class, int.class);
956
MethodHandle didHandle = MethodHandles.permuteArguments(dIdent, DI_D_type, 0);
957
AssertJUnit.assertEquals(1.2, didHandle.invoke(1.2,1));
958
959
// Permutes IDI to DI
960
MethodType IDI_D_type = methodType(double.class, int.class, double.class, int.class);
961
MethodHandle idid = MethodHandles.permuteArguments(didHandle, IDI_D_type, 1,0);
962
AssertJUnit.assertEquals(1.2, idid.invoke(Integer.MAX_VALUE,1.2,1));
963
964
// Permute DID to IDI
965
MethodType DID_D_type = methodType(double.class, double.class, int.class, double.class);
966
MethodHandle didd = MethodHandles.permuteArguments(idid, DID_D_type, 1,0,1);
967
AssertJUnit.assertEquals(1.2, didd.invoke(1.2,1,1.9));
968
969
// Permutes IDDDD to DID
970
MethodType IDDDD_D_type = methodType(double.class, int.class, double.class,double.class,double.class,double.class);
971
MethodHandle iddddd = MethodHandles.permuteArguments(didd, IDDDD_D_type, 3,0,2);
972
AssertJUnit.assertEquals(1.9, iddddd.invoke(9,1.2,88.5,1.9,23.1));
973
974
}
975
976
/* Used in testFirstArgument, testMiddleArgument, testLastArgument */
977
private static MethodType getMethodType() {
978
return MethodType.methodType(double.class, long.class,
979
float.class,
980
long.class,
981
double.class,
982
int.class,
983
short.class,
984
byte.class,
985
int.class,
986
double.class,
987
double.class,
988
long.class,
989
byte.class,
990
char.class,
991
long.class,
992
long.class,
993
int.class,
994
long.class,
995
float.class,
996
long.class,
997
double.class,
998
int.class,
999
short.class,
1000
byte.class,
1001
int.class,
1002
double.class,
1003
double.class,
1004
long.class,
1005
byte.class,
1006
char.class,
1007
long.class,
1008
long.class,
1009
int.class,
1010
long.class,
1011
float.class,
1012
long.class,
1013
double.class,
1014
int.class,
1015
short.class,
1016
byte.class,
1017
int.class,
1018
double.class,
1019
double.class,
1020
long.class,
1021
byte.class,
1022
char.class,
1023
long.class,
1024
long.class,
1025
int.class,
1026
long.class,
1027
float.class,
1028
long.class,
1029
double.class,
1030
int.class,
1031
short.class,
1032
byte.class,
1033
int.class,
1034
double.class,
1035
double.class,
1036
long.class,
1037
byte.class,
1038
char.class,
1039
long.class,
1040
long.class,
1041
int.class,
1042
long.class,
1043
float.class,
1044
long.class,
1045
double.class,
1046
int.class,
1047
short.class,
1048
byte.class,
1049
int.class,
1050
double.class,
1051
double.class,
1052
long.class,
1053
byte.class,
1054
char.class,
1055
long.class,
1056
long.class,
1057
int.class,
1058
long.class,
1059
float.class,
1060
long.class,
1061
double.class,
1062
int.class,
1063
short.class,
1064
byte.class,
1065
int.class,
1066
double.class,
1067
double.class,
1068
long.class,
1069
byte.class,
1070
char.class,
1071
long.class,
1072
long.class,
1073
int.class,
1074
long.class,
1075
float.class,
1076
long.class,
1077
double.class,
1078
int.class,
1079
short.class,
1080
byte.class,
1081
int.class,
1082
double.class,
1083
double.class,
1084
long.class,
1085
byte.class,
1086
char.class,
1087
long.class,
1088
long.class,
1089
int.class,
1090
long.class,
1091
float.class,
1092
long.class,
1093
double.class,
1094
int.class,
1095
short.class,
1096
byte.class,
1097
int.class,
1098
double.class,
1099
double.class,
1100
long.class,
1101
byte.class,
1102
char.class,
1103
long.class,
1104
long.class,
1105
int.class,
1106
long.class,
1107
float.class,
1108
long.class,
1109
double.class,
1110
int.class,
1111
short.class,
1112
byte.class,
1113
int.class,
1114
double.class,
1115
double.class,
1116
long.class,
1117
byte.class,
1118
char.class,
1119
long.class,
1120
long.class,
1121
int.class,
1122
long.class,
1123
float.class,
1124
long.class,
1125
double.class,
1126
int.class,
1127
short.class,
1128
byte.class,
1129
int.class,
1130
double.class,
1131
double.class,
1132
long.class,
1133
byte.class,
1134
char.class,
1135
long.class,
1136
long.class,
1137
int.class,
1138
long.class,
1139
float.class,
1140
long.class,
1141
double.class,
1142
int.class,
1143
short.class,
1144
byte.class,
1145
int.class,
1146
double.class);
1147
}
1148
1149
/**
1150
* Use permuteArguments to drop all arguments except for an arbitrary double argument in
1151
* the missing of the call and use MethodHandles.identity to return that value.
1152
* Compare it to an expected value. The actual argument picked is the 8th double to
1153
* be called.
1154
*
1155
* There are a series of comments next to each argument. This is the number of slots that
1156
* argument occupies, and the total consumed slots thus far. The maximum number of slots
1157
* per function call is 255. Remember, receiver consumes one slot, so the maximum allowed
1158
* in this test is 254.
1159
* @throws Throwable
1160
*/
1161
@Test(groups = { "level.extended" })
1162
public void testMiddleArgument() throws Throwable{
1163
1164
MethodType mt = getMethodType();
1165
1166
MethodHandle ident = MethodHandles.identity(double.class);
1167
1168
MethodHandle mh = MethodHandles.permuteArguments(ident, mt, 41);
1169
1170
AssertJUnit.assertEquals(1.8, mh.invoke((long)-3203180362171660288L, // num: 2 total: 2
1171
(float)7.171048E7f, // num: 1 total: 3
1172
(long)5339160688581042176L, // num: 2 total: 5
1173
(double)8.9554576E7, // num: 2 total: 7
1174
(int)1.25104589E9, // num: 1 total: 8
1175
(short)7843.807, // num: 1 total: 9
1176
(byte)33.169678, // num: 1 total: 10
1177
(int)-1.55029389E9, // num: 1 total: 11
1178
(double)5.503734E7, // num: 2 total: 13
1179
(double)8.9038912E7, // num: 2 total: 15
1180
(long)-5169201657267570688L, // num: 2 total: 17
1181
(byte)54.93014, // num: 1 total: 18
1182
(char)7055.623, // num: 1 total: 19
1183
(long)-3497224257527621632L, // num: 2 total: 21
1184
(long)5878185161578051584L, // num: 2 total: 23
1185
(int)1.50359232E9, // num: 1 total: 24
1186
(long)3380793726609856512L, // num: 2 total: 26
1187
(float)4.168188E7f, // num: 1 total: 27
1188
(long)-3993298687727976448L, // num: 2 total: 29
1189
(double)7.2788312E7, // num: 2 total: 31
1190
(int)-1.77448294E9, // num: 1 total: 32
1191
(short)-9754.77, // num: 1 total: 33
1192
(byte)9.254554, // num: 1 total: 34
1193
(int)-3.70784224E8, // num: 1 total: 35
1194
(double)6.2799244E7, // num: 2 total: 37
1195
(double)4.2424844E7, // num: 2 total: 39
1196
(long)-3893495019984762880L, // num: 2 total: 41
1197
(byte)33.833794, // num: 1 total: 42
1198
(char)52790.406, // num: 1 total: 43
1199
(long)-7255662582137067520L, // num: 2 total: 45
1200
(long)-985054663470168064L, // num: 2 total: 47
1201
(int)3.6900096E8, // num: 1 total: 48
1202
(long)2209057434292498432L, // num: 2 total: 50
1203
(float)4.2143004E7f, // num: 1 total: 51
1204
(long)-4993207563018072064L, // num: 2 total: 53
1205
(double)1.482387E7, // num: 2 total: 55
1206
(int)-6.0968768E7, // num: 1 total: 56
1207
(short)-15536.124, // num: 1 total: 57
1208
(byte)111.127, // num: 1 total: 58
1209
(int)2.08704154E9, // num: 1 total: 59
1210
(double)8.9123904E7, // num: 2 total: 61
1211
1.8, // num: 2 total: 63
1212
(long)9142906052754137088L, // num: 2 total: 65
1213
(byte)115.29249, // num: 1 total: 66
1214
(char)54774.516, // num: 1 total: 67
1215
(long)-6693027720563402752L, // num: 2 total: 69
1216
(long)5457968159355297792L, // num: 2 total: 71
1217
(int)4.338736E8, // num: 1 total: 72
1218
(long)7821156722567321600L, // num: 2 total: 74
1219
(float)7.2992296E7f, // num: 1 total: 75
1220
(long)1704228185344000000L, // num: 2 total: 77
1221
(double)1.1575101E7, // num: 2 total: 79
1222
(int)1.52252186E9, // num: 1 total: 80
1223
(short)-16456.012, // num: 1 total: 81
1224
(byte)-93.99391, // num: 1 total: 82
1225
(int)-1.53191872E9, // num: 1 total: 83
1226
(double)5.0222204E7, // num: 2 total: 85
1227
(double)8.0645312E7, // num: 2 total: 87
1228
(long)2995670601650804736L, // num: 2 total: 89
1229
(byte)84.732414, // num: 1 total: 90
1230
(char)27034.49, // num: 1 total: 91
1231
(long)676881792554905600L, // num: 2 total: 93
1232
(long)7764068144727302144L, // num: 2 total: 95
1233
(int)1.47474957E9, // num: 1 total: 96
1234
(long)8494457029451546624L, // num: 2 total: 98
1235
(float)9.0300152E7f, // num: 1 total: 99
1236
(long)3891569714658539520L, // num: 2 total: 101
1237
(double)2.70031E7, // num: 2 total: 103
1238
(int)-1.90898163E9, // num: 1 total: 104
1239
(short)32598.158, // num: 1 total: 105
1240
(byte)-114.99583, // num: 1 total: 106
1241
(int)1.52044352E9, // num: 1 total: 107
1242
(double)4.9004188E7, // num: 2 total: 109
1243
(double)4.2048228E7, // num: 2 total: 111
1244
(long)-8579726908909932544L, // num: 2 total: 113
1245
(byte)11.572607, // num: 1 total: 114
1246
(char)8244.297, // num: 1 total: 115
1247
(long)5092247331817613312L, // num: 2 total: 117
1248
(long)6760240151782103040L, // num: 2 total: 119
1249
(int)1.80054746E9, // num: 1 total: 120
1250
(long)8997645018063001600L, // num: 2 total: 122
1251
(float)2.935457E7f, // num: 1 total: 123
1252
(long)-5863345824712359936L, // num: 2 total: 125
1253
(double)7.1900248E7, // num: 2 total: 127
1254
(int)2.11336026E9, // num: 1 total: 128
1255
(short)6451.464, // num: 1 total: 129
1256
(byte)49.917686, // num: 1 total: 130
1257
(int)-7.6394688E8, // num: 1 total: 131
1258
(double)4.7346408E7, // num: 2 total: 133
1259
(double)1.92255E7, // num: 2 total: 135
1260
(long)-1487336717242705920L, // num: 2 total: 137
1261
(byte)54.120953, // num: 1 total: 138
1262
(char)58817.887, // num: 1 total: 139
1263
(long)5057081444118452224L, // num: 2 total: 141
1264
(long)-6562681839230472192L, // num: 2 total: 143
1265
(int)-1.58745318E9, // num: 1 total: 144
1266
(long)-6584736502456768512L, // num: 2 total: 146
1267
(float)1.3935081E7f, // num: 1 total: 147
1268
(long)4472217696850677760L, // num: 2 total: 149
1269
(double)4.6066192E7, // num: 2 total: 151
1270
(int)1.01984912E8, // num: 1 total: 152
1271
(short)-31271.809, // num: 1 total: 153
1272
(byte)65.936165, // num: 1 total: 154
1273
(int)-1.90919245E9, // num: 1 total: 155
1274
(double)2.8007106E7, // num: 2 total: 157
1275
(double)9.2201056E7, // num: 2 total: 159
1276
(long)-5253666077784686592L, // num: 2 total: 161
1277
(byte)30.762087, // num: 1 total: 162
1278
(char)40515.258, // num: 1 total: 163
1279
(long)2372213227409434624L, // num: 2 total: 165
1280
(long)-8181293946630713344L, // num: 2 total: 167
1281
(int)-3.3647364E7, // num: 1 total: 168
1282
(long)-27132565736196096L, // num: 2 total: 170
1283
(float)9.2700896E7f, // num: 1 total: 171
1284
(long)3164464155936280576L, // num: 2 total: 173
1285
(double)6.458284E7, // num: 2 total: 175
1286
(int)-9.3258112E8, // num: 1 total: 176
1287
(short)11517.835, // num: 1 total: 177
1288
(byte)119.96983, // num: 1 total: 178
1289
(int)2.346968E8, // num: 1 total: 179
1290
(double)3927204.0, // num: 2 total: 181
1291
(double)2.7818502E7, // num: 2 total: 183
1292
(long)-8005666839323181056L, // num: 2 total: 185
1293
(byte)-114.85905, // num: 1 total: 186
1294
(char)50565.82, // num: 1 total: 187
1295
(long)-2394771929317384192L, // num: 2 total: 189
1296
(long)-4814531126618560512L, // num: 2 total: 191
1297
(int)-1.39272538E9, // num: 1 total: 192
1298
(long)-7508656545357506560L, // num: 2 total: 194
1299
(float)4.0512312E7f, // num: 1 total: 195
1300
(long)-9075974017665474560L, // num: 2 total: 197
1301
(double)1.6997122E7, // num: 2 total: 199
1302
(int)1.69337165E9, // num: 1 total: 200
1303
(short)13108.793, // num: 1 total: 201
1304
(byte)-56.074783, // num: 1 total: 202
1305
(int)3.6717792E8, // num: 1 total: 203
1306
(double)3.7203064E7, // num: 2 total: 205
1307
(double)4.2195324E7, // num: 2 total: 207
1308
(long)-4338933738822316032L, // num: 2 total: 209
1309
(byte)64.68621, // num: 1 total: 210
1310
(char)24572.482, // num: 1 total: 211
1311
(long)8114436875812677632L, // num: 2 total: 213
1312
(long)1524724838129885184L, // num: 2 total: 215
1313
(int)1.01250253E9, // num: 1 total: 216
1314
(long)-1761847386827798528L, // num: 2 total: 218
1315
(float)9.4517736E7f, // num: 1 total: 219
1316
(long)-4268109591618652160L, // num: 2 total: 221
1317
(double)1.7519344E7, // num: 2 total: 223
1318
(int)1.12439603E9, // num: 1 total: 224
1319
(short)16512.586, // num: 1 total: 225
1320
(byte)38.35186, // num: 1 total: 226
1321
(int)-5.6585916E7, // num: 1 total: 227
1322
(double)2.7199912E7, // num: 2 total: 229
1323
(double)2.2942766E7, // num: 2 total: 231
1324
(long)7614703348831082496L, // num: 2 total: 233
1325
(byte)-100.02652, // num: 1 total: 234
1326
(char)48268.863, // num: 1 total: 235
1327
(long)7169779744517623808L, // num: 2 total: 237
1328
(long)-8595974293885444096L, // num: 2 total: 239
1329
(int)5.2847568E8, // num: 1 total: 240
1330
(long)4890038659257524224L, // num: 2 total: 242
1331
(float)7.5006352E7f, // num: 1 total: 243
1332
(long)-6049589841802512384L, // num: 2 total: 245
1333
(double)9.6237176E7, // num: 2 total: 247
1334
(int)1.80856384E9, // num: 1 total: 248
1335
(short)16381.117, // num: 1 total: 249
1336
(byte)123.96007, // num: 1 total: 250
1337
(int)-2.09081229E9, // num: 1 total: 251
1338
(double)1.780585E7)); // num: 2 total: 253
1339
1340
}
1341
1342
/**
1343
* Use permuteArguments to drop all arguments except for the first double argument and use
1344
* MethodHandles.identity to return that value. Compare it to an expected value.
1345
*
1346
* There are a series of comments next to each argument. This is the number of slots that
1347
* argument occupies, and the total consumed slots thus far. The maximum number of slots
1348
* per function call is 255. Remember, receiver consumes one slot, so the maximum allowed
1349
* in this test is 254.
1350
* @throws Throwable
1351
*/
1352
@Test(groups = { "level.extended" })
1353
public void testFirstArgument() throws Throwable {
1354
MethodType mt = getMethodType();
1355
1356
MethodHandle ident = MethodHandles.identity(double.class);
1357
1358
MethodHandle mh = MethodHandles.permuteArguments(ident, mt, 3);
1359
1360
AssertJUnit.assertEquals(1.99, mh.invoke((long)2057049365891047424L, // num: 2 total: 2
1361
(float)3.3248204E7f, // num: 1 total: 3
1362
(long)-1596658795522656256L, // num: 2 total: 5
1363
1.99, // num: 2 total: 7
1364
(int)1.2417568E8, // num: 1 total: 8
1365
(short)-13116.136, // num: 1 total: 9
1366
(byte)69.57229, // num: 1 total: 10
1367
(int)-7.4886736E7, // num: 1 total: 11
1368
(double)2.162346E7, // num: 2 total: 13
1369
(double)4.1026428E7, // num: 2 total: 15
1370
(long)6750435188124798976L, // num: 2 total: 17
1371
(byte)79.430435, // num: 1 total: 18
1372
(char)30069.264, // num: 1 total: 19
1373
(long)-7457808532033626112L, // num: 2 total: 21
1374
(long)3545381522114433024L, // num: 2 total: 23
1375
(int)-1.23332186E9, // num: 1 total: 24
1376
(long)4395216543246026752L, // num: 2 total: 26
1377
(float)4.3141664E7f, // num: 1 total: 27
1378
(long)-4902263574143195136L, // num: 2 total: 29
1379
(double)3.5635228E7, // num: 2 total: 31
1380
(int)7.6856237E8, // num: 1 total: 32
1381
(short)-4313.166, // num: 1 total: 33
1382
(byte)-56.533463, // num: 1 total: 34
1383
(int)1.01504282E9, // num: 1 total: 35
1384
(double)3.0608242E7, // num: 2 total: 37
1385
(double)3.076918E7, // num: 2 total: 39
1386
(long)-6303678274520227840L, // num: 2 total: 41
1387
(byte)-70.90424, // num: 1 total: 42
1388
(char)65425.832, // num: 1 total: 43
1389
(long)6789869740212318208L, // num: 2 total: 45
1390
(long)-2743799026798000128L, // num: 2 total: 47
1391
(int)1.46388173E9, // num: 1 total: 48
1392
(long)4892142575604934656L, // num: 2 total: 50
1393
(float)5.1981712E7f, // num: 1 total: 51
1394
(long)-6693873758359072768L, // num: 2 total: 53
1395
(double)1.4271397E7, // num: 2 total: 55
1396
(int)3.18325536E8, // num: 1 total: 56
1397
(short)6388.5635, // num: 1 total: 57
1398
(byte)64.90687, // num: 1 total: 58
1399
(int)1.94001677E9, // num: 1 total: 59
1400
(double)3.2802208E7, // num: 2 total: 61
1401
(double)3.6718356E7, // num: 2 total: 63
1402
(long)-4565957498366681088L, // num: 2 total: 65
1403
(byte)-116.441345, // num: 1 total: 66
1404
(char)49257.3, // num: 1 total: 67
1405
(long)-190734580375732224L, // num: 2 total: 69
1406
(long)-8308012861219088384L, // num: 2 total: 71
1407
(int)1.31992819E9, // num: 1 total: 72
1408
(long)7060407783806167040L, // num: 2 total: 74
1409
(float)2.8768634E7f, // num: 1 total: 75
1410
(long)800076918289551360L, // num: 2 total: 77
1411
(double)7.7681576E7, // num: 2 total: 79
1412
(int)-1.78129728E9, // num: 1 total: 80
1413
(short)15143.424, // num: 1 total: 81
1414
(byte)-11.566322, // num: 1 total: 82
1415
(int)-2.2967126E7, // num: 1 total: 83
1416
(double)5.0063668E7, // num: 2 total: 85
1417
(double)6.5565364E7, // num: 2 total: 87
1418
(long)-249808883378114560L, // num: 2 total: 89
1419
(byte)-118.25458, // num: 1 total: 90
1420
(char)41799.008, // num: 1 total: 91
1421
(long)-2472853930697168896L, // num: 2 total: 93
1422
(long)5766316152834109440L, // num: 2 total: 95
1423
(int)-1.45615667E9, // num: 1 total: 96
1424
(long)-2504792983542507520L, // num: 2 total: 98
1425
(float)4.3677008E7f, // num: 1 total: 99
1426
(long)-2453858987052083200L, // num: 2 total: 101
1427
(double)828030.25, // num: 2 total: 103
1428
(int)1.74248653E9, // num: 1 total: 104
1429
(short)-18037.021, // num: 1 total: 105
1430
(byte)-32.173225, // num: 1 total: 106
1431
(int)2.0116425E9, // num: 1 total: 107
1432
(double)5.890718E7, // num: 2 total: 109
1433
(double)3.2890086E7, // num: 2 total: 111
1434
(long)1393861424270131200L, // num: 2 total: 113
1435
(byte)-42.60434, // num: 1 total: 114
1436
(char)63438.91, // num: 1 total: 115
1437
(long)9171394038351972352L, // num: 2 total: 117
1438
(long)3292422773839065088L, // num: 2 total: 119
1439
(int)-1.68562867E9, // num: 1 total: 120
1440
(long)2987634792627372032L, // num: 2 total: 122
1441
(float)2.6772356E7f, // num: 1 total: 123
1442
(long)-7082658629598701568L, // num: 2 total: 125
1443
(double)4.3756608E7, // num: 2 total: 127
1444
(int)8.8829542E8, // num: 1 total: 128
1445
(short)-3108.5532, // num: 1 total: 129
1446
(byte)82.47665, // num: 1 total: 130
1447
(int)1.87625677E9, // num: 1 total: 131
1448
(double)4.6780996E7, // num: 2 total: 133
1449
(double)4.260726E7, // num: 2 total: 135
1450
(long)6630347734336305152L, // num: 2 total: 137
1451
(byte)-48.303013, // num: 1 total: 138
1452
(char)12880.834, // num: 1 total: 139
1453
(long)-8063673605991550976L, // num: 2 total: 141
1454
(long)7370691734393360384L, // num: 2 total: 143
1455
(int)2.73375264E8, // num: 1 total: 144
1456
(long)-6856089306008756224L, // num: 2 total: 146
1457
(float)8590396.0f, // num: 1 total: 147
1458
(long)-3151823057703292928L, // num: 2 total: 149
1459
(double)2.816233E7, // num: 2 total: 151
1460
(int)4.72372608E8, // num: 1 total: 152
1461
(short)2027.9454, // num: 1 total: 153
1462
(byte)-29.623098, // num: 1 total: 154
1463
(int)-2.84620288E8, // num: 1 total: 155
1464
(double)1.248518E7, // num: 2 total: 157
1465
(double)1178537.6, // num: 2 total: 159
1466
(long)-8249954297444534272L, // num: 2 total: 161
1467
(byte)-31.99032, // num: 1 total: 162
1468
(char)15637.167, // num: 1 total: 163
1469
(long)8834424337385818112L, // num: 2 total: 165
1470
(long)5016490523928459264L, // num: 2 total: 167
1471
(int)1.05513254E9, // num: 1 total: 168
1472
(long)-1327013163988903936L, // num: 2 total: 170
1473
(float)2.0481882E7f, // num: 1 total: 171
1474
(long)4896746503026331648L, // num: 2 total: 173
1475
(double)2.9970542E7, // num: 2 total: 175
1476
(int)-1.0775028E8, // num: 1 total: 176
1477
(short)19653.012, // num: 1 total: 177
1478
(byte)60.237724, // num: 1 total: 178
1479
(int)1.10074086E9, // num: 1 total: 179
1480
(double)6.0730316E7, // num: 2 total: 181
1481
(double)1.6590137E7, // num: 2 total: 183
1482
(long)9223361597289562112L, // num: 2 total: 185
1483
(byte)-88.818985, // num: 1 total: 186
1484
(char)55988.465, // num: 1 total: 187
1485
(long)-1337964432311511040L, // num: 2 total: 189
1486
(long)1739855928065984512L, // num: 2 total: 191
1487
(int)-8.8588979E8, // num: 1 total: 192
1488
(long)-6602693899564214272L, // num: 2 total: 194
1489
(float)4723068.5f, // num: 1 total: 195
1490
(long)6437359138031542272L, // num: 2 total: 197
1491
(double)3.7933724E7, // num: 2 total: 199
1492
(int)1.9166856E7, // num: 1 total: 200
1493
(short)1736.8943, // num: 1 total: 201
1494
(byte)95.22048, // num: 1 total: 202
1495
(int)-1.95618778E9, // num: 1 total: 203
1496
(double)4.0836832E7, // num: 2 total: 205
1497
(double)3.2096132E7, // num: 2 total: 207
1498
(long)8003145997316270080L, // num: 2 total: 209
1499
(byte)23.949598, // num: 1 total: 210
1500
(char)39272.504, // num: 1 total: 211
1501
(long)-2594099861682894848L, // num: 2 total: 213
1502
(long)-4507267283947671552L, // num: 2 total: 215
1503
(int)-2.96264608E8, // num: 1 total: 216
1504
(long)-8068065524624621568L, // num: 2 total: 218
1505
(float)8.4391816E7f, // num: 1 total: 219
1506
(long)6760260154867468288L, // num: 2 total: 221
1507
(double)2.8243924E7, // num: 2 total: 223
1508
(int)7.120311E8, // num: 1 total: 224
1509
(short)-11052.873, // num: 1 total: 225
1510
(byte)-79.20657, // num: 1 total: 226
1511
(int)-1.52229798E9, // num: 1 total: 227
1512
(double)7.9574984E7, // num: 2 total: 229
1513
(double)4.4727352E7, // num: 2 total: 231
1514
(long)4387323700686755840L, // num: 2 total: 233
1515
(byte)-2.0605624, // num: 1 total: 234
1516
(char)55130.258, // num: 1 total: 235
1517
(long)8657139882764234752L, // num: 2 total: 237
1518
(long)8334347915311243264L, // num: 2 total: 239
1519
(int)6.7880627E8, // num: 1 total: 240
1520
(long)3320568648412581888L, // num: 2 total: 242
1521
(float)4.3009324E7f, // num: 1 total: 243
1522
(long)-1485130604004706304L, // num: 2 total: 245
1523
(double)5160794.0, // num: 2 total: 247
1524
(int)-3.09672768E8, // num: 1 total: 248
1525
(short)22107.887, // num: 1 total: 249
1526
(byte)114.208435, // num: 1 total: 250
1527
(int)-1.01827258E9, // num: 1 total: 251
1528
(double)5.8145452E7)); // num: 2 total: 253
1529
1530
}
1531
1532
/**
1533
* Use permuteArguments to drop all arguments except for the last double argument and use
1534
* MethodHandles.identity to return that value. Compare it to an expected value.
1535
*
1536
* There are a series of comments next to each argument. This is the number of slots that
1537
* argument occupies, and the total consumed slots thus far. The maximum number of slots
1538
* per function call is 255. Remember, receiver consumes one slot, so the maximum allowed
1539
* in this test is 254.
1540
* @throws Throwable
1541
*/
1542
@Test(groups = { "level.extended" })
1543
public void testLastArgument() throws Throwable {
1544
MethodType mt = getMethodType();
1545
1546
MethodHandle ident = MethodHandles.identity(double.class);
1547
1548
MethodHandle mh = MethodHandles.permuteArguments(ident, mt, 168);
1549
1550
AssertJUnit.assertEquals((double)5.6475464E7, mh.invoke((long)1580137349297076224L, // num: 2 total: 2
1551
(float)7.1264104E7f, // num: 1 total: 3
1552
(long)7396342793090865152L, // num: 2 total: 5
1553
(double)3.4365352E7, // num: 2 total: 7
1554
(int)-1.53093645E9, // num: 1 total: 8
1555
(short)2026.8043, // num: 1 total: 9
1556
(byte)-5.027892, // num: 1 total: 10
1557
(int)-5.9936819E8, // num: 1 total: 11
1558
(double)6.3947464E7, // num: 2 total: 13
1559
(double)6.3012412E7, // num: 2 total: 15
1560
(long)1412149259284840448L, // num: 2 total: 17
1561
(byte)-47.496567, // num: 1 total: 18
1562
(char)2716.6106, // num: 1 total: 19
1563
(long)2430549790276419584L, // num: 2 total: 21
1564
(long)7217243361956806656L, // num: 2 total: 23
1565
(int)1.43024653E9, // num: 1 total: 24
1566
(long)-5020189348399060992L, // num: 2 total: 26
1567
(float)3.4641264E7f, // num: 1 total: 27
1568
(long)8615685391862054912L, // num: 2 total: 29
1569
(double)9.151796E7, // num: 2 total: 31
1570
(int)1.63405402E9, // num: 1 total: 32
1571
(short)30667.996, // num: 1 total: 33
1572
(byte)46.0659, // num: 1 total: 34
1573
(int)9.2596992E8, // num: 1 total: 35
1574
(double)7.9601752E7, // num: 2 total: 37
1575
(double)6.0080672E7, // num: 2 total: 39
1576
(long)5915669612491364352L, // num: 2 total: 41
1577
(byte)70.98394, // num: 1 total: 42
1578
(char)59562.414, // num: 1 total: 43
1579
(long)2980319651624886272L, // num: 2 total: 45
1580
(long)665152291980931072L, // num: 2 total: 47
1581
(int)-2.03555814E9, // num: 1 total: 48
1582
(long)-8401224491453986816L, // num: 2 total: 50
1583
(float)5.8896824E7f, // num: 1 total: 51
1584
(long)3374656510558181376L, // num: 2 total: 53
1585
(double)6.2582536E7, // num: 2 total: 55
1586
(int)-1.35926554E9, // num: 1 total: 56
1587
(short)-2105.1165, // num: 1 total: 57
1588
(byte)27.437984, // num: 1 total: 58
1589
(int)7.0141069E8, // num: 1 total: 59
1590
(double)8.0329976E7, // num: 2 total: 61
1591
(double)6.2795276E7, // num: 2 total: 63
1592
(long)-5388525404138135552L, // num: 2 total: 65
1593
(byte)97.925674, // num: 1 total: 66
1594
(char)45218.766, // num: 1 total: 67
1595
(long)-8993171974615707648L, // num: 2 total: 69
1596
(long)4032542554917154816L, // num: 2 total: 71
1597
(int)-1.55290995E9, // num: 1 total: 72
1598
(long)-715813854417897472L, // num: 2 total: 74
1599
(float)1.2989713E7f, // num: 1 total: 75
1600
(long)-8586904235718418432L, // num: 2 total: 77
1601
(double)8945824.0, // num: 2 total: 79
1602
(int)1.83456627E9, // num: 1 total: 80
1603
(short)12968.975, // num: 1 total: 81
1604
(byte)-122.92477, // num: 1 total: 82
1605
(int)7.7270784E8, // num: 1 total: 83
1606
(double)3.3156372E7, // num: 2 total: 85
1607
(double)6.6951748E7, // num: 2 total: 87
1608
(long)3124492593914419200L, // num: 2 total: 89
1609
(byte)-48.155846, // num: 1 total: 90
1610
(char)30147.95, // num: 1 total: 91
1611
(long)-5705794949374410752L, // num: 2 total: 93
1612
(long)4906390903829786624L, // num: 2 total: 95
1613
(int)-1.35060237E9, // num: 1 total: 96
1614
(long)1497651512901687296L, // num: 2 total: 98
1615
(float)1.8057464E7f, // num: 1 total: 99
1616
(long)-7982580409056735232L, // num: 2 total: 101
1617
(double)3.1270692E7, // num: 2 total: 103
1618
(int)-1.30979392E9, // num: 1 total: 104
1619
(short)9738.722, // num: 1 total: 105
1620
(byte)113.48444, // num: 1 total: 106
1621
(int)1.04707821E9, // num: 1 total: 107
1622
(double)6.024152E7, // num: 2 total: 109
1623
(double)5.6646336E7, // num: 2 total: 111
1624
(long)6471443577216692224L, // num: 2 total: 113
1625
(byte)-82.59888, // num: 1 total: 114
1626
(char)24979.805, // num: 1 total: 115
1627
(long)-7408455901547454464L, // num: 2 total: 117
1628
(long)7126289057206708224L, // num: 2 total: 119
1629
(int)8.4698758E8, // num: 1 total: 120
1630
(long)8431654305328836608L, // num: 2 total: 122
1631
(float)2.6008108E7f, // num: 1 total: 123
1632
(long)-2564050472775606272L, // num: 2 total: 125
1633
(double)6.1027544E7, // num: 2 total: 127
1634
(int)3.92163328E8, // num: 1 total: 128
1635
(short)8125.5303, // num: 1 total: 129
1636
(byte)-100.95522, // num: 1 total: 130
1637
(int)-1.26804584E8, // num: 1 total: 131
1638
(double)2.7117782E7, // num: 2 total: 133
1639
(double)5.1813268E7, // num: 2 total: 135
1640
(long)8845165412070383616L, // num: 2 total: 137
1641
(byte)-84.91118, // num: 1 total: 138
1642
(char)12289.232, // num: 1 total: 139
1643
(long)-4136493182664636416L, // num: 2 total: 141
1644
(long)-8684539089388810240L, // num: 2 total: 143
1645
(int)5.8385504E8, // num: 1 total: 144
1646
(long)3858631105457483776L, // num: 2 total: 146
1647
(float)4.8502756E7f, // num: 1 total: 147
1648
(long)-1576107826588055552L, // num: 2 total: 149
1649
(double)8666295.0, // num: 2 total: 151
1650
(int)-2.04377997E9, // num: 1 total: 152
1651
(short)23615.137, // num: 1 total: 153
1652
(byte)-42.674793, // num: 1 total: 154
1653
(int)1.88571763E9, // num: 1 total: 155
1654
(double)9.0690432E7, // num: 2 total: 157
1655
(double)3.1152562E7, // num: 2 total: 159
1656
(long)7226090936388399104L, // num: 2 total: 161
1657
(byte)-0.9020691, // num: 1 total: 162
1658
(char)25733.008, // num: 1 total: 163
1659
(long)-8820063058680072192L, // num: 2 total: 165
1660
(long)-8647554445748639744L, // num: 2 total: 167
1661
(int)-1.04553037E9, // num: 1 total: 168
1662
(long)-149729089984290816L, // num: 2 total: 170
1663
(float)8.6328736E7f, // num: 1 total: 171
1664
(long)-1092376797389668352L, // num: 2 total: 173
1665
(double)1.8428998E7, // num: 2 total: 175
1666
(int)-1.6221176E8, // num: 1 total: 176
1667
(short)-14803.136, // num: 1 total: 177
1668
(byte)16.866615, // num: 1 total: 178
1669
(int)9.0209581E8, // num: 1 total: 179
1670
(double)5.700434E7, // num: 2 total: 181
1671
(double)8.044856E7, // num: 2 total: 183
1672
(long)4064947388223490048L, // num: 2 total: 185
1673
(byte)-84.131, // num: 1 total: 186
1674
(char)47173.324, // num: 1 total: 187
1675
(long)7275523320706107392L, // num: 2 total: 189
1676
(long)858920513111713792L, // num: 2 total: 191
1677
(int)-3.9816672E8, // num: 1 total: 192
1678
(long)5676218303433138176L, // num: 2 total: 194
1679
(float)9163403.0f, // num: 1 total: 195
1680
(long)-7901843307575439360L, // num: 2 total: 197
1681
(double)7.9803088E7, // num: 2 total: 199
1682
(int)-1.44413222E9, // num: 1 total: 200
1683
(short)22193.244, // num: 1 total: 201
1684
(byte)88.92891, // num: 1 total: 202
1685
(int)1.48687088E8, // num: 1 total: 203
1686
(double)9.8776368E7, // num: 2 total: 205
1687
(double)1.6278985E7, // num: 2 total: 207
1688
(long)4473073241770209280L, // num: 2 total: 209
1689
(byte)-109.172424, // num: 1 total: 210
1690
(char)16695.662, // num: 1 total: 211
1691
(long)-7591762704550205440L, // num: 2 total: 213
1692
(long)-4371812780410517504L, // num: 2 total: 215
1693
(int)1.16891238E9, // num: 1 total: 216
1694
(long)-6107467503477600256L, // num: 2 total: 218
1695
(float)3.5728552E7f, // num: 1 total: 219
1696
(long)-489103829752930304L, // num: 2 total: 221
1697
(double)4.5615268E7, // num: 2 total: 223
1698
(int)1.62407117E9, // num: 1 total: 224
1699
(short)-26882.488, // num: 1 total: 225
1700
(byte)96.702866, // num: 1 total: 226
1701
(int)-1.0507863E9, // num: 1 total: 227
1702
(double)8.2693296E7, // num: 2 total: 229
1703
(double)3.5114712E7, // num: 2 total: 231
1704
(long)7143725174889668608L, // num: 2 total: 233
1705
(byte)-34.197193, // num: 1 total: 234
1706
(char)53823.4, // num: 1 total: 235
1707
(long)-5644737223091402752L, // num: 2 total: 237
1708
(long)7430726967597205504L, // num: 2 total: 239
1709
(int)2.3583056E8, // num: 1 total: 240
1710
(long)1970478522488750080L, // num: 2 total: 242
1711
(float)6.4335468E7f, // num: 1 total: 243
1712
(long)-2352404489188362240L, // num: 2 total: 245
1713
(double)6765977.5, // num: 2 total: 247
1714
(int)8.71842E7, // num: 1 total: 248
1715
(short)-15693.532, // num: 1 total: 249
1716
(byte)23.486866, // num: 1 total: 250
1717
(int)-4.37342048E8, // num: 1 total: 251
1718
(double)5.6475464E7)); // num: 2 total: 253
1719
1720
}
1721
1722
}
1723
1724
1725