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

LDC2_W.java

00001 package gov.nasa.arc.ase.jpf.jvm.bytecode;
00002 
00003 import de.fub.bytecode.classfile.ConstantPool;
00004 import de.fub.bytecode.classfile.ConstantLong;
00005 import de.fub.bytecode.classfile.ConstantDouble;
00006 import de.fub.bytecode.generic.ConstantPoolGen;
00007 import de.fub.bytecode.generic.Type;
00008 import gov.nasa.arc.ase.jpf.jvm.SystemState;
00009 import gov.nasa.arc.ase.jpf.jvm.KernelState;
00010 import gov.nasa.arc.ase.jpf.jvm.ThreadInfo;
00011 import gov.nasa.arc.ase.jpf.jvm.Types;
00012 import gov.nasa.arc.ase.util.Debug;
00013 
00014 public class LDC2_W extends Instruction {
00015   private long value;
00016 
00017   public Instruction execute(SystemState ss, KernelState ks, ThreadInfo th) {
00018     th.longPush(value);
00019 
00020     return th.getPC().getNext();
00021   }  
00022   public void setPeer(de.fub.bytecode.generic.Instruction i, ConstantPool cp) {
00023     Type type = ((de.fub.bytecode.generic.LDC2_W)i).getType(new ConstantPoolGen(cp));
00024 
00025     if(type == Type.LONG)
00026       value = ((ConstantLong)cp.getConstant(((de.fub.bytecode.generic.LDC2_W)i).getIndex())).getBytes();
00027     else
00028       value = Types.doubleToLong(((ConstantDouble)cp.getConstant(((de.fub.bytecode.generic.LDC2_W)i).getIndex())).getBytes());
00029   }  
00030 }

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