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

PUTSTATIC.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.jvm.ClassInfo;
00010 import gov.nasa.arc.ase.jpf.InternalErrorException;
00011 import gov.nasa.arc.ase.util.Debug;
00012 //#ifdef RACE
00013 
00014 //#endif RACE
00015 
00016 public class PUTSTATIC extends Instruction {
00017   private String cname;
00018   private String fname;
00019   private int size;
00020 
00021   public Instruction execute(SystemState ss, KernelState ks, ThreadInfo th) {
00022     ClassInfo ci = ClassInfo.getClassInfo(cname);
00023     ElementInfo e = ks.sa.get(cname);
00024 
00025     switch(size) {
00026       case 2:
00027     e.setLongField(fname, th.longPop());
00028     break;
00029 
00030       case 1:
00031     e.setField(fname, th.pop());
00032     break;
00033 
00034       default:
00035     throw new InternalErrorException("invalid type size");
00036     }
00037 
00038 //#ifdef RACE
00039 
00040 
00041 //#endif RACE
00042 
00043     return th.getPC().getNext();
00044   }  
00045   public void setPeer(de.fub.bytecode.generic.Instruction i, ConstantPool cp) {
00046     cname = ((de.fub.bytecode.generic.PUTSTATIC)i).getClassName(new ConstantPoolGen(cp));
00047     fname = ((de.fub.bytecode.generic.PUTSTATIC)i).getFieldName(new ConstantPoolGen(cp));
00048     size = ((de.fub.bytecode.generic.PUTSTATIC)i).getFieldType(new ConstantPoolGen(cp)).getSize();
00049   }  
00050 }

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