00001 package gov.nasa.arc.ase.jpf.jvm.bytecode;
00002
00003 import de.fub.bytecode.classfile.Constant;
00004 import de.fub.bytecode.classfile.ConstantPool;
00005 import de.fub.bytecode.Constants;
00006 import de.fub.bytecode.generic.ConstantPoolGen;
00007 import gov.nasa.arc.ase.jpf.*;
00008 import gov.nasa.arc.ase.jpf.jvm.*;
00009 import gov.nasa.arc.ase.util.Debug;
00010
00011 public class ANEWARRAY extends Instruction {
00012 private String type;
00013
00014 public Instruction execute(SystemState ss, KernelState ks, ThreadInfo th) {
00015
00016 int size = th.pop();
00017
00018
00019 th.push(ks.da.newArray(type, size, th), true);
00020
00021 return th.getPC().getNext();
00022 }
00023 public void setPeer(de.fub.bytecode.generic.Instruction i, ConstantPool cp) {
00024 type = cp.constantToString(cp.getConstant(((de.fub.bytecode.generic.ANEWARRAY)i).getIndex()));
00025 if(!type.startsWith("[")) type = "L" + type + ";";
00026 }
00027 }