1 package gov.nasa.jpf.jvm; 20 21 import gov.nasa.jpf.jvm.bytecode.Instruction; 22 import gov.nasa.jpf.util.Debug; 23 24 import java.util.Hashtable ; 25 26 27 30 public class Labels { 31 private static Hashtable labels = new Hashtable (); 32 33 public static boolean isAt (String label, ThreadInfo th) { 34 Instruction pc = (Instruction) labels.get(label); 35 36 if (pc == null) { 37 return false; 38 } 39 40 return th.getPC() == pc; 41 } 42 43 public static void set (String label, Instruction pc) { 44 if (!JVM.observableLabels.contains(label)) { 45 Debug.println(Debug.MESSAGE, "Ignored label: " + label); 46 47 return; 48 } 49 50 if (labels.containsKey(label)) { 51 return; 52 } 53 54 labels.put(label, pc); 55 pc.setObservable(); 56 Debug.println(Debug.MESSAGE, "New label: " + label); 57 } 58 } | Popular Tags |