|
2 | 2 |
|
3 | 3 | import com.google.common.primitives.Bytes; |
4 | 4 | import io.github.seggan.javaclasslib.ByteUtils; |
| 5 | +import io.github.seggan.javaclasslib.PrimitiveType; |
5 | 6 | import io.github.seggan.javaclasslib.constantpool.ClassEntry; |
6 | 7 | import io.github.seggan.javaclasslib.constantpool.ConstantPoolEntry; |
7 | 8 | import io.github.seggan.javaclasslib.constantpool.classmembers.FieldrefEntry; |
@@ -237,6 +238,26 @@ public final class JvmInstructions { |
237 | 238 | * </dl> |
238 | 239 | */ |
239 | 240 | public static final NoArgInstruction IADD = new NoArgInstruction(0x60); |
| 241 | + /** |
| 242 | + * Loads an int from an array |
| 243 | + * |
| 244 | + * <dl> |
| 245 | + * <dt>Stack:</dt> |
| 246 | + * <dd>..., arrayref, index →</dd> |
| 247 | + * <dd>..., value</dd> |
| 248 | + * </dl> |
| 249 | + */ |
| 250 | + public static final NoArgInstruction IALOAD = new NoArgInstruction(0x2e); |
| 251 | + /** |
| 252 | + * Stores an int into an array |
| 253 | + * |
| 254 | + * <dl> |
| 255 | + * <dt>Stack:</dt> |
| 256 | + * <dd>..., arrayref, index, value →</dd> |
| 257 | + * <dd>...,</dd> |
| 258 | + * </dl> |
| 259 | + */ |
| 260 | + public static final NoArgInstruction IASTORE = new NoArgInstruction(0x4f); |
240 | 261 | /** |
241 | 262 | * Pushes {@code 0} (an int) onto the stack |
242 | 263 | * |
@@ -477,6 +498,28 @@ public final class JvmInstructions { |
477 | 498 | * </dl> |
478 | 499 | */ |
479 | 500 | public static final CPInstruction<ClassEntry> NEW = new CPInstruction<>(0xbb); |
| 501 | + /** |
| 502 | + * Creates a new primitive array. It is recommended to pass a {@link PrimitiveType} as the |
| 503 | + * parameter |
| 504 | + * |
| 505 | + * <dl> |
| 506 | + * <dt>Parameters:</dt> |
| 507 | + * <dd>A byte representing the primitive type</dd> |
| 508 | + * <dt>Stack:</dt> |
| 509 | + * <dd>..., count →</dd> |
| 510 | + * <dd>..., arrayref</dd> |
| 511 | + * </dl> |
| 512 | + */ |
| 513 | + public static final BPInstruction NEWARRAY = new BPInstruction(0xbc); |
| 514 | + /** |
| 515 | + * Do nothing |
| 516 | + * |
| 517 | + * <dl> |
| 518 | + * <dt>Stack:</dt> |
| 519 | + * <dd>[unchanged]</dd> |
| 520 | + * </dl> |
| 521 | + */ |
| 522 | + public static final NoArgInstruction NOP = new NoArgInstruction(0x00); |
480 | 523 | /** |
481 | 524 | * Discards the top value of the stack |
482 | 525 | * |
|
0 commit comments