00001 package gov.nasa.arc.ase.jpf.jvm.bytecode;
00002
00003 import gov.nasa.arc.ase.jpf.*;
00004 import gov.nasa.arc.ase.jpf.jvm.*;
00005 import de.fub.bytecode.Constants;
00006 import de.fub.bytecode.generic.ConstantPoolGen;
00007 import de.fub.bytecode.generic.InstructionHandle;
00008 import gov.nasa.arc.ase.util.Debug;
00009
00010 public class NEWARRAY extends AbstractInstruction {
00011 private de.fub.bytecode.generic.NEWARRAY peer;
00012
00013 public InstructionHandle execute(SystemState ss, KernelState ks, ThreadInfo th) {
00014 int size = th.pop();
00015 int arrayref = ks.dynamic_area.newArrayObject(Constants.SHORT_TYPE_NAMES[peer.getTypecode()], size, th);
00016
00017
00018 th.push(arrayref);
00019
00020 th.setOperandRef();
00021
00022
00023 return th.getPC().getNext();
00024 }
00025 public void setPeer(de.fub.bytecode.generic.Instruction i) {
00026 peer = (de.fub.bytecode.generic.NEWARRAY)i;
00027 }
00028 }