public static final byte BALOAD = (byte) 0x33; // 0
public static final byte CALOAD = (byte) 0x34; // 0
public static final byte SALOAD = (byte) 0x35; // 0
- public static final byte ISTORE = (byte) 0x36; // 0
- public static final byte LSTORE = (byte) 0x37; // 9
- public static final byte FSTORE = (byte) 0x38; // 0
- public static final byte DSTORE = (byte) 0x39; // 0
- public static final byte ASTORE = (byte) 0x3A; // 0
+ public static final byte ISTORE = (byte) 0x36; // 1
+ public static final byte LSTORE = (byte) 0x37; // 1
+ public static final byte FSTORE = (byte) 0x38; // 1
+ public static final byte DSTORE = (byte) 0x39; // 1
+ public static final byte ASTORE = (byte) 0x3A; // 1
public static final byte ISTORE_0 = (byte) 0x3B; // 0
public static final byte ISTORE_1 = (byte) 0x3C; // 0
public static final byte ISTORE_2 = (byte) 0x3D; // 0
}
}
- private void set(int pos, byte op, Object arg) {
+ public void set(int pos, byte op, Object arg) {
int iarg = arg instanceof Integer ? ((Integer)arg).intValue() : -1;
switch(op) {
case FSTORE: case DLOAD: case DSTORE: case ALOAD: case ASTORE:
{
if(iarg >= 0 && iarg <= 3) {
- int base = -1;
+ byte base = 0;
switch(op) {
case ILOAD: base = ILOAD_0; break;
case ISTORE: base = ISTORE_0; break;
case ALOAD: base = ALOAD_0; break;
case ASTORE: base = ASTORE_0; break;
}
- op = (byte)(base + iarg);
+ op = (byte)((base&0xff) + iarg);
} else {
- if(iarg > maxLocals) maxLocals = iarg;
+ if(iarg >= maxLocals) maxLocals = iarg + 1;
}
+ break;
}
case LDC:
if(arg instanceof Integer) { set(pos,op,iarg); return; }
_set(pos,op,arg);
}
- public final void _set(int pos, byte op, Object arg) {
+ private final void _set(int pos, byte op, Object arg) {
if(capacity == -1) throw new IllegalStateException("method can't have code");
if(size == -1) throw new IllegalStateException("method is finalized");
if(!OP_VALID(op)) throw new IllegalArgumentException("unknown bytecode");
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x03, 0x05, 0x13, 0x15, 0x15, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x13, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,