added some more class support
authoradash <adash>
Tue, 3 Mar 2009 10:15:28 +0000 (10:15 +0000)
committeradash <adash>
Tue, 3 Mar 2009 10:15:28 +0000 (10:15 +0000)
bug fix for prefetch analysis

Robust/src/Analysis/Prefetch/PrefetchAnalysis.java
Robust/src/ClassLibrary/Math.java
Robust/src/ClassLibrary/Vector.java

index 3e06eb5d33058edfcb9040bdc9c4cd462bdd13da..b7f9c6a2b5f49235a448b1c267dd5f9a3604b743 100644 (file)
@@ -112,6 +112,7 @@ public class PrefetchAnalysis {
       case FKind.FlatNew:
       case FKind.FlatCastNode:
       case FKind.FlatTagDeclaration:
+      case FKind.FlatInstanceOfNode:
        processDefaultCase(curr,child_prefetch_set_copy);
        break;
 
index 95cfcc96d9e29b495df6573c7301970368210615..6f16dee7c98cf1ee0881b0c84aa92125b065e725 100644 (file)
@@ -11,6 +11,14 @@ public class Math {
     return PI;
   }
 
+  public static int abs(int x) {
+    if (x < 0) {
+      return -x;
+    } else {
+      return x;
+    }
+  }
+
   public static double fabs(double x) {
     if (x < 0) {
       return -x;
@@ -43,6 +51,16 @@ public class Math {
     }
   }
 
+  public static int max(int a, int b) {
+    if(a == b)
+      return a;
+    if(a > b) {
+      return a;
+    } else {
+      return b;
+    }
+  }
+
   public static int imax(int a, int b) {
     if(a == b)
       return a;
index bd1489383fffe9d130255cdd217ae51f145446c4..5cd06ca69e4763bdb266b1c637a8c9e58da670f1 100644 (file)
@@ -100,6 +100,19 @@ public class Vector {
     array[index] = obj;
   }
 
+  public void remove(Object o) {
+    int getIndex;
+    for(int i=0; i<size; i++) {
+      if (o.equals(array[i]))
+        getIndex = i;
+    }
+    for(int i=getIndex; i<(size-1); i++) {
+      array[i]=array[i+1];
+    }
+    size--;
+  }
+
+
   public void removeElementAt(int index) {
     if (index<0||index>=size) {
       System.printString("Illegal Vector.removeElementAt\n");
@@ -117,4 +130,12 @@ public class Vector {
       removeElementAt(0);
     }
   }
+
+  public boolean contains(Object o) {
+    for(int i = 0; i < size; i++) {
+      if(o.equals(array[i]))
+        return true;
+    }
+    return false;
+  }
 }