1 package gov.nasa.jpf.jvm.bytecode; 20 21 import gov.nasa.jpf.jvm.KernelState; 22 import gov.nasa.jpf.jvm.SystemState; 23 import gov.nasa.jpf.jvm.ThreadInfo; 24 25 import org.apache.bcel.classfile.ConstantPool; 26 27 28 32 public class IDIV extends Instruction { 33 public void setPeer (org.apache.bcel.generic.Instruction i, ConstantPool cp) { 34 } 35 36 public Instruction execute (SystemState ss, KernelState ks, ThreadInfo th) { 37 int v1 = th.pop(); 38 int v2 = th.pop(); 39 40 if (v1 == 0) { 41 return th.createAndThrowException("java.lang.ArithmeticException"); 42 } 43 44 th.push(v2 / v1, false); 45 46 return getNext(th); 47 } 48 49 public int getByteCode () { 50 return 0x6C; 51 } 52 } 53 | Popular Tags |