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

Labels.java

00001 package gov.nasa.arc.ase.jpf.jvm;
00002 
00003 //#ifdef BUCHI
00004 import java.util.Hashtable;
00005 import gov.nasa.arc.ase.jpf.jvm.bytecode.Instruction;
00006 import gov.nasa.arc.ase.util.Debug;
00007 
00008 public class Labels {
00009   private static Hashtable labels = new Hashtable();
00010 
00011   public static boolean isAt(String label, ThreadInfo th) {
00012     Instruction pc = (Instruction)labels.get(label);
00013 
00014     if(pc == null) return false;
00015 
00016     return th.getPC() == pc;
00017   }  
00018   public static void set(String label, Instruction pc) {
00019     if(!VirtualMachine.observableLabels.contains(label)) {
00020       Debug.println(Debug.MESSAGE, "Ignored label: " + label);
00021       return;
00022     }
00023 
00024     if(labels.containsKey(label)) return;
00025 
00026     labels.put(label, pc);
00027     pc.setObservable();
00028     Debug.println(Debug.MESSAGE, "New label: " + label);
00029   }  
00030 }

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