Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

ARETURN.java

00001 package gov.nasa.arc.ase.jpf.jvm.bytecode;
00002 
00003 import de.fub.bytecode.generic.InstructionHandle;
00004 import gov.nasa.arc.ase.jpf.*;
00005 import gov.nasa.arc.ase.jpf.jvm.*;
00006 import gov.nasa.arc.ase.util.Debug;
00007 
00008 public class ARETURN extends AbstractInstruction {
00009     private de.fub.bytecode.generic.ARETURN peer;
00010        
00011   public InstructionHandle execute(SystemState ss, KernelState ks, ThreadInfo th) {
00012     MethodInfo mi = th.getCurrentMethod();
00013 
00014     if (mi.getMethodGen().isSynchronized()) {
00015       if (mi.getMethodGen().isStatic()) {
00016     String className = mi.getClassInfo().getClassData().getClassName();
00017     ks.static_area.monitorUnlock(className, th);
00018       } else {
00019     ks.dynamic_area.monitorUnlock(th.getThis(), th);
00020       }
00021     }
00022     // little explaination:
00023     // a reference is removed from the stack and then is pushed back into
00024     // the upper level stack. so we can remove the return value without
00025     // updating the reference count and then pop it back on the caller
00026     // stack frame without incrementing the reference counter
00027     int value = th.xpop();    // pops the return value.
00028 
00029     th.popFrame();            // removes a frame from the stack
00030     th.removeArguments(mi);
00031     th.push(value);   // pushes the return value in the
00032 
00033 //          NOT NEEDED
00034 ////#ifdef MARK_N_SWEEP || REFERENCE_COUNT
00035 //    th.setOperandRef();             // caller's stack frame
00036 ////#endif MARK_N_SWEEP || REFERENCE_COUNT
00037 
00038     return th.getPC().getNext();
00039   }  
00040   public void setPeer(de.fub.bytecode.generic.Instruction i) {
00041     peer = (de.fub.bytecode.generic.ARETURN)i;
00042   }  
00043 }

Generated at Thu Feb 7 06:39:23 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001