1 package gov.nasa.jpf.jvm.bytecode; 20 21 import gov.nasa.jpf.jvm.JVM; 22 import gov.nasa.jpf.jvm.MethodInfo; 23 import gov.nasa.jpf.jvm.ThreadInfo; 24 25 import org.apache.bcel.classfile.ConstantPool; 26 import org.apache.bcel.generic.InstructionHandle; 27 28 29 32 public abstract class ReturnInstruction extends Instruction { 33 protected void init (InstructionHandle h, int o, MethodInfo m, 34 ConstantPool cp) { 35 super.init(h, o, m, cp); 36 isObservable |= JVM.observableReturns.contains(mi.getCompleteName()); 37 } 38 39 abstract int storeReturnValue (ThreadInfo th); 40 abstract void pushReturnValue (ThreadInfo th); 41 42 protected Instruction cleanUpAndAdvance (ThreadInfo th) { 43 44 storeReturnValue(th); 45 46 mi.leave(th); 48 49 if (th.wasDirectCall()) { 50 53 th.popFrame(); 56 th.removeArguments(mi); 57 58 return th.getPC(); 60 } else { 61 if (!th.popFrame()) { 62 return null; 64 } else { 65 th.removeArguments(mi); 66 pushReturnValue(th); 67 68 return getNext(th); 69 } 70 } 71 } 72 } | Popular Tags |