- case NEW: push(new Allocate((Type)arg)); return null;
- case NEWARRAY: push(new Allocate((Type.Array)arg, pop())); return null;
- case ANEWARRAY: push(new Allocate(Type.OBJECT.makeArray(), pop())); return null;
- case MULTIANEWARRAY: push(new Allocate(Type.OBJECT.makeArray(i2), null /* FIXME */)); return null;
+ case NEW: push(new New((Type.Class)arg)); return null;
+ case NEWARRAY: {
+ Type base;
+ switch(((Integer)arg).intValue()) {
+ case 4: base = Type.BOOLEAN; break;
+ case 5: base = Type.CHAR; break;
+ case 6: base = Type.FLOAT; break;
+ case 7: base = Type.DOUBLE; break;
+ case 8: base = Type.BYTE; break;
+ case 9: base = Type.SHORT; break;
+ case 10: base = Type.INT; break;
+ case 11: base = Type.LONG; break;
+ default: throw new IllegalStateException("invalid array type");
+ }
+ push(new NewArray(base.makeArray(),pop()));
+ return null;
+ }
+ case ANEWARRAY: push(new NewArray(((Type.Ref)arg).makeArray(), pop())); return null;
+ case MULTIANEWARRAY: {
+ MethodGen.MultiANewArray mana = (MethodGen.MultiANewArray) arg;
+ Expr[] dims = new Expr[mana.dims];
+ for(int i=0;i<dims.length;i++) dims[i] = pop();
+ push(new NewArray(mana.type, dims));
+ return null;
+ }