Bug fix. Now the SPECjbb2005 can run with small workload that does not invoke gc
[IRC.git] / Robust / src / ClassLibrary / MGC / System.java
1 public class System {
2   public static PrintStream out = new PrintStream("System.out");
3   public static PrintStream err = new PrintStream("System.err");
4   public static InputStream in = new InputStream();
5   
6   public System() {
7   }
8   
9   public static void printInt(int x) {
10     String s=String.valueOf(x);
11     printString(s);
12   }
13
14   public static native long currentTimeMillis();
15   
16   public static native long microTimes();
17
18   public static native long getticks();
19
20   public static native void printString(String s);
21
22   public static void println(String s) {
23     System.printString(s+"\n");
24   }
25
26   public static void println(Object o) {
27     System.printString(""+o+"\n");
28   }
29
30   public static void println(int o) {
31     System.printString(""+o+"\n");
32   }
33
34   public static void println(double o) {
35     System.printString(""+o+"\n");
36   }
37
38   public static void println(long o) {
39     System.printString(""+o+"\n");
40   }
41   
42   public static void println() {
43     System.printString("\n");
44   }
45
46   public static void print(String s) {
47     System.printString(s);
48   }
49
50   public static void print(Object o) {
51     System.printString(""+o);
52   }
53
54   public static void print(int o) {
55     System.printString(""+o);
56   }
57
58   public static void print(double o) {
59     System.printString(""+o);
60   }
61
62   public static void print(long o) {
63     System.printString(""+o);
64   }
65
66   public static void error() {
67     System.printString("Error (Use Breakpoint on ___System______error method for more information!)\n");
68   }
69
70   public static native void exit(int status);
71
72   public static native void printI(int status);
73
74   public static native void clearPrefetchCache();
75
76   public static native void rangePrefetch(Object o, short[] offsets);
77
78   public static native void deepArrayCopy(Object dst, Object src);
79
80   public static native void Assert(boolean status);
81
82   /* Only used for microbenchmark testing of SingleTM version */
83   public static native void logevent(int event);
84   public static native void logevent();
85
86   /* Only used for microbenchmark testing of SingleTM version */
87   public static native void initLog();
88
89   public static native void flushToFile(int threadid);
90   /* Only used for microbenchmark testing of SingleTM version */
91
92   public static native void arraycopy(Object src, int srcPos, Object dst, int destPos, int length);
93
94   // for disjoint reachability analysis
95   public static void genReach();
96   
97   private static Properties props;
98   private static native Properties initProperties();
99   
100   static {
101     initProperties();
102   }
103   
104   public static Properties getProperties() {
105     return props;
106   }
107   
108   public static String getProperty(String key) {
109     if(props != null) {
110       return (String)props.getProperty(key);
111     }
112     return "";
113   }
114   
115   public static String setProperty(String key, String value) {
116     if(props != null) {
117       return (String)props.setProperty(key, value);
118     }
119     return "";
120   }
121   
122   public static void setOut(PrintStream out) {
123     out = out;
124   }
125
126   public static void setErr(PrintStream err) {
127     err = err;
128   }
129 }