Exemplo n.º 1
0
 public static final long newLoadEdge(State src, Object d) {
   long srcNum = src.getNumber();
   long dNum = SymbolNumberer.getNumber(d);
   checkState(srcNum);
   checkSymbol(dNum);
   return srcNum << 41 | dNum;
 }
Exemplo n.º 2
0
 public static String toString(long e) {
   if (isKill(e)) {
     return "-->\u2205";
   } else {
     int d = getD(e);
     try {
       String dStr = SymbolNumberer.getObject(d).toString();
       if (isId(e)) {
         return "-->" + dStr;
       } else if (isAccess(e)) {
         long src = getSrc(e);
         String srcStr = src == START_STATE ? "start" : ("" + src);
         return "(" + srcStr + "," + getDst(e) + "," + isWrite(e) + ")-->" + dStr;
       } else if (isLoad(e)) {
         return "L(" + getSrc(e) + ")-->" + dStr;
       } else {
         return "S-->" + dStr;
       }
     } catch (NullPointerException npe) {
       Logger.println("d: " + d);
       Logger.println("e: " + long2BitStr(e));
       throw npe;
     }
   }
 }
Exemplo n.º 3
0
 public static final long newAccessEdge(State src, State dst, boolean write, Object d) {
   long srcNum = src.getNumber();
   long dstNum = dst.getNumber();
   long dNum = SymbolNumberer.getNumber(d);
   checkState(srcNum);
   checkState(dstNum);
   checkSymbol(dNum);
   return 1L << 63 | (write ? 1L : 0L) << 62 | srcNum << 41 | dstNum << 20 | dNum;
 }
Exemplo n.º 4
0
 private static void outputFields(long e, boolean write, State src, State dst, Object d) {
   System.out.println();
   System.out.println("e: " + long2BitStr(e));
   System.out.println("access: " + isAccess(e));
   System.out.println("kill: " + isKill(e));
   System.out.println("id: " + isId(e));
   System.out.println("write: " + isWrite(e));
   System.out.println("write (real): " + write);
   System.out.println("src: " + getSrc(e));
   System.out.println("src (real): " + (src == null ? 0 : src.getNumber()));
   System.out.println("dst: " + getDst(e));
   System.out.println("dst (real): " + (dst == null ? 0 : dst.getNumber()));
   System.out.println("d: " + getD(e));
   System.out.println("d (real): " + (d == null ? 0 : SymbolNumberer.getNumber(d)));
   System.out.println();
 }
Exemplo n.º 5
0
 public static final long newIdEdge(Object d) {
   int dNum = SymbolNumberer.getNumber(d);
   checkSymbol(dNum);
   return dNum;
 }
Exemplo n.º 6
0
 public static final long newStoreEdge(Object d) {
   long dNum = SymbolNumberer.getNumber(d);
   checkSymbol(dNum);
   return START_STATE << 41 | dNum;
 }