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

GETSTATIC.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.jpf.jvm.Types;
00011 import gov.nasa.arc.ase.util.Debug;
00012 //#ifdef RACE
00013 
00014 //#endif RACE
00015 
00016 public class GETSTATIC 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     ElementInfo e = ks.sa.get(cname);
00023 
00024     switch(size) {
00025       case 1:
00026     if(e.isFieldRef(fname))
00027       th.push(e.getField(fname), true);
00028     else
00029       th.push(e.getField(fname), false);
00030     break;
00031     
00032       case 2:
00033     th.longPush(e.getLongField(fname));
00034     break;
00035 
00036       default:
00037     throw new InternalErrorException("invalid field type");
00038     }
00039 
00040 //#ifdef RACE
00041 
00042 
00043 //#endif RACE
00044 
00045     return th.getPC().getNext();
00046   }  
00047   public void setPeer(de.fub.bytecode.generic.Instruction i, ConstantPool cp) {
00048     cname = ((de.fub.bytecode.generic.GETSTATIC)i).getClassName(new ConstantPoolGen(cp));
00049     fname = ((de.fub.bytecode.generic.GETSTATIC)i).getFieldName(new ConstantPoolGen(cp));
00050     size = ((de.fub.bytecode.generic.GETSTATIC)i).getFieldType(new ConstantPoolGen(cp)).getSize();
00051   }  
00052 }

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