@@ -429,6 +429,8 @@ default CodeBuilder trying(Consumer<BlockCodeBuilder> tryHandler,
429
429
* @param tk the load type
430
430
* @param slot the local variable slot
431
431
* @return this builder
432
+ * @throws IllegalArgumentException if {@code tk} is {@link TypeKind#VOID void}
433
+ * or {@code slot} is out of range
432
434
* @since 23
433
435
*/
434
436
default CodeBuilder loadLocal (TypeKind tk , int slot ) {
@@ -440,6 +442,8 @@ default CodeBuilder loadLocal(TypeKind tk, int slot) {
440
442
* @param tk the store type
441
443
* @param slot the local variable slot
442
444
* @return this builder
445
+ * @throws IllegalArgumentException if {@code tk} is {@link TypeKind#VOID void}
446
+ * or {@code slot} is out of range
443
447
* @since 23
444
448
*/
445
449
default CodeBuilder storeLocal (TypeKind tk , int slot ) {
@@ -793,6 +797,7 @@ default CodeBuilder characterRange(Label startScope, Label endScope, int charact
793
797
* @param startScope the start scope of the variable
794
798
* @param endScope the end scope of the variable
795
799
* @return this builder
800
+ * @throws IllegalArgumentException if {@code slot} is out of range
796
801
*/
797
802
default CodeBuilder localVariable (int slot , Utf8Entry nameEntry , Utf8Entry descriptorEntry , Label startScope , Label endScope ) {
798
803
return with (LocalVariable .of (slot , nameEntry , descriptorEntry , startScope , endScope ));
@@ -806,6 +811,7 @@ default CodeBuilder localVariable(int slot, Utf8Entry nameEntry, Utf8Entry descr
806
811
* @param startScope the start scope of the variable
807
812
* @param endScope the end scope of the variable
808
813
* @return this builder
814
+ * @throws IllegalArgumentException if {@code slot} is out of range
809
815
*/
810
816
default CodeBuilder localVariable (int slot , String name , ClassDesc descriptor , Label startScope , Label endScope ) {
811
817
return localVariable (slot ,
@@ -822,6 +828,7 @@ default CodeBuilder localVariable(int slot, String name, ClassDesc descriptor, L
822
828
* @param startScope the start scope of the variable
823
829
* @param endScope the end scope of the variable
824
830
* @return this builder
831
+ * @throws IllegalArgumentException if {@code slot} is out of range
825
832
*/
826
833
default CodeBuilder localVariableType (int slot , Utf8Entry nameEntry , Utf8Entry signatureEntry , Label startScope , Label endScope ) {
827
834
return with (LocalVariableType .of (slot , nameEntry , signatureEntry , startScope , endScope ));
@@ -835,6 +842,7 @@ default CodeBuilder localVariableType(int slot, Utf8Entry nameEntry, Utf8Entry s
835
842
* @param startScope the start scope of the variable
836
843
* @param endScope the end scope of the variable
837
844
* @return this builder
845
+ * @throws IllegalArgumentException if {@code slot} is out of range
838
846
*/
839
847
default CodeBuilder localVariableType (int slot , String name , Signature signature , Label startScope , Label endScope ) {
840
848
return localVariableType (slot ,
@@ -877,6 +885,7 @@ default CodeBuilder aastore() {
877
885
*
878
886
* @param slot the local variable slot
879
887
* @return this builder
888
+ * @throws IllegalArgumentException if {@code slot} is out of range
880
889
*/
881
890
default CodeBuilder aload (int slot ) {
882
891
return loadLocal (TypeKind .REFERENCE , slot );
@@ -925,6 +934,7 @@ default CodeBuilder arraylength() {
925
934
*
926
935
* @param slot the local variable slot
927
936
* @return this builder
937
+ * @throws IllegalArgumentException if {@code slot} is out of range
928
938
*/
929
939
default CodeBuilder astore (int slot ) {
930
940
return storeLocal (TypeKind .REFERENCE , slot );
@@ -958,6 +968,7 @@ default CodeBuilder bastore() {
958
968
* Generate an instruction pushing an int in the range of byte onto the operand stack.
959
969
* @param b the int in the range of byte
960
970
* @return this builder
971
+ * @throws IllegalArgumentException if {@code b} is out of range of byte
961
972
*/
962
973
default CodeBuilder bipush (int b ) {
963
974
return with (ConstantInstruction .ofArgument (Opcode .BIPUSH , b ));
@@ -1094,6 +1105,7 @@ default CodeBuilder ddiv() {
1094
1105
*
1095
1106
* @param slot the local variable slot
1096
1107
* @return this builder
1108
+ * @throws IllegalArgumentException if {@code slot} is out of range
1097
1109
*/
1098
1110
default CodeBuilder dload (int slot ) {
1099
1111
return loadLocal (TypeKind .DOUBLE , slot );
@@ -1139,6 +1151,7 @@ default CodeBuilder dreturn() {
1139
1151
*
1140
1152
* @param slot the local variable slot
1141
1153
* @return this builder
1154
+ * @throws IllegalArgumentException if {@code slot} is out of range
1142
1155
*/
1143
1156
default CodeBuilder dstore (int slot ) {
1144
1157
return storeLocal (TypeKind .DOUBLE , slot );
@@ -1306,6 +1319,7 @@ default CodeBuilder fdiv() {
1306
1319
*
1307
1320
* @param slot the local variable slot
1308
1321
* @return this builder
1322
+ * @throws IllegalArgumentException if {@code slot} is out of range
1309
1323
*/
1310
1324
default CodeBuilder fload (int slot ) {
1311
1325
return loadLocal (TypeKind .FLOAT , slot );
@@ -1351,6 +1365,7 @@ default CodeBuilder freturn() {
1351
1365
*
1352
1366
* @param slot the local variable slot
1353
1367
* @return this builder
1368
+ * @throws IllegalArgumentException if {@code slot} is out of range
1354
1369
*/
1355
1370
default CodeBuilder fstore (int slot ) {
1356
1371
return storeLocal (TypeKind .FLOAT , slot );
@@ -1726,6 +1741,7 @@ default CodeBuilder ifne(Label target) {
1726
1741
* @param slot the local variable slot
1727
1742
* @param val the increment value
1728
1743
* @return this builder
1744
+ * @throws IllegalArgumentException if {@code slot} or {@code val} is out of range
1729
1745
*/
1730
1746
default CodeBuilder iinc (int slot , int val ) {
1731
1747
return with (IncrementInstruction .of (slot , val ));
@@ -1739,6 +1755,7 @@ default CodeBuilder iinc(int slot, int val) {
1739
1755
*
1740
1756
* @param slot the local variable slot
1741
1757
* @return this builder
1758
+ * @throws IllegalArgumentException if {@code slot} is out of range
1742
1759
*/
1743
1760
default CodeBuilder iload (int slot ) {
1744
1761
return loadLocal (TypeKind .INT , slot );
@@ -1997,6 +2014,7 @@ default CodeBuilder ishr() {
1997
2014
*
1998
2015
* @param slot the local variable slot
1999
2016
* @return this builder
2017
+ * @throws IllegalArgumentException if {@code slot} is out of range
2000
2018
*/
2001
2019
default CodeBuilder istore (int slot ) {
2002
2020
return storeLocal (TypeKind .INT , slot );
@@ -2159,6 +2177,7 @@ default CodeBuilder ldiv() {
2159
2177
*
2160
2178
* @param slot the local variable slot
2161
2179
* @return this builder
2180
+ * @throws IllegalArgumentException if {@code slot} is out of range
2162
2181
*/
2163
2182
default CodeBuilder lload (int slot ) {
2164
2183
return loadLocal (TypeKind .LONG , slot );
@@ -2228,6 +2247,7 @@ default CodeBuilder lshr() {
2228
2247
*
2229
2248
* @param slot the local variable slot
2230
2249
* @return this builder
2250
+ * @throws IllegalArgumentException if {@code slot} is out of range
2231
2251
*/
2232
2252
default CodeBuilder lstore (int slot ) {
2233
2253
return storeLocal (TypeKind .LONG , slot );
@@ -2278,6 +2298,7 @@ default CodeBuilder monitorexit() {
2278
2298
* @param array the array type
2279
2299
* @param dims the number of dimensions
2280
2300
* @return this builder
2301
+ * @throws IllegalArgumentException if {@code dims} is out of range
2281
2302
*/
2282
2303
default CodeBuilder multianewarray (ClassEntry array , int dims ) {
2283
2304
return with (NewMultiArrayInstruction .of (array , dims ));
@@ -2289,6 +2310,7 @@ default CodeBuilder multianewarray(ClassEntry array, int dims) {
2289
2310
* @param dims the number of dimensions
2290
2311
* @return this builder
2291
2312
* @throws IllegalArgumentException if {@code array} represents a primitive type
2313
+ * or if {@code dims} is out of range
2292
2314
*/
2293
2315
default CodeBuilder multianewarray (ClassDesc array , int dims ) {
2294
2316
return multianewarray (constantPool ().classEntry (array ), dims );
@@ -2327,6 +2349,8 @@ default CodeBuilder new_(ClassDesc clazz) {
2327
2349
* Generate an instruction to create a new array of a primitive type
2328
2350
* @param typeKind the primitive array type
2329
2351
* @return this builder
2352
+ * @throws IllegalArgumentException when the {@code typeKind} is not a legal
2353
+ * primitive array component type
2330
2354
*/
2331
2355
default CodeBuilder newarray (TypeKind typeKind ) {
2332
2356
return with (NewPrimitiveArrayInstruction .of (typeKind ));
@@ -2423,6 +2447,7 @@ default CodeBuilder sastore() {
2423
2447
* Generate an instruction pushing an int in the range of short onto the operand stack.
2424
2448
* @param s the int in the range of short
2425
2449
* @return this builder
2450
+ * @throws IllegalArgumentException if {@code s} is out of range of short
2426
2451
*/
2427
2452
default CodeBuilder sipush (int s ) {
2428
2453
return with (ConstantInstruction .ofArgument (Opcode .SIPUSH , s ));
0 commit comments