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

PUTFIELD.java

00001 package gov.nasa.arc.ase.jpf.jvm.bytecode;
00002 
00003 import de.fub.bytecode.classfile.ConstantPool;
00004 import de.fub.bytecode.generic.ConstantPoolGen;
00005 import gov.nasa.arc.ase.jpf.jvm.SystemState;
00006 import gov.nasa.arc.ase.jpf.jvm.KernelState;
00007 import gov.nasa.arc.ase.jpf.jvm.ThreadInfo;
00008 import gov.nasa.arc.ase.jpf.jvm.ElementInfo;
00009 import gov.nasa.arc.ase.jpf.InternalErrorException;
00010 import gov.nasa.arc.ase.util.Debug;
00011 //#ifdef RACE
00012 
00013 //#endif RACE
00014 
00015 public class PUTFIELD extends Instruction {
00016   private String fname;
00017   private int size;
00018 
00019   public Instruction execute(SystemState ss, KernelState ks, ThreadInfo th) {
00020     ElementInfo e = null;
00021 
00022     switch(size) {
00023       case 2:
00024     {
00025       long value = th.longPop();
00026       int objref = th.pop();
00027       e = ks.da.get(objref);
00028       e.setLongField(fname, value);
00029     }
00030     break;
00031 
00032       case 1:
00033     {
00034       int value = th.pop();
00035       int objref = th.pop();
00036       e = ks.da.get(objref);
00037       e.setField(fname, value);
00038     }
00039     break;
00040 
00041       default:
00042     throw new InternalErrorException("invalid type size");
00043     }
00044 
00045 //#ifdef RACE
00046 
00047 
00048 //#endif RACE
00049 
00050     return th.getPC().getNext();
00051   }  
00052   public void setPeer(de.fub.bytecode.generic.Instruction i, ConstantPool cp) {
00053     fname = ((de.fub.bytecode.generic.PUTFIELD)i).getFieldName(new ConstantPoolGen(cp));
00054     size = ((de.fub.bytecode.generic.PUTFIELD)i).getFieldType(new ConstantPoolGen(cp)).getSize();
00055   }  
00056 }

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