1 2 package measurements.suites; 3 4 public class TestClassCalibration1 extends TestClass 5 { 6 7 static int staticInt; 9 static long staticLong; 10 static Object staticObj; 11 12 private static int privateStaticInt; 13 private static long privateStaticLong; 14 private static Object privateStaticObject; 15 16 public int instanceInt; 17 public long instanceLong; 18 public Object instanceObj; 19 20 private int privateInstanceInt; 21 private long privateInstanceLong; 22 private Object privateInstanceObj; 23 24 25 public void interfaceMethodShort() {} 27 public void interfaceMethodLong(Object x, Object o) {} 28 public void instanceMethodShort() {} 29 public void instanceMethodLong(Object x, Object o) {} 30 public static void staticMethodShort() {} 31 public static void staticMethodLong(Object x, Object o) {} 32 private static void privateStaticMethodShort() {} 33 private static void privateStaticMethodLong(Object x, Object o) {} 34 public synchronized void syncInstanceMethodShort() {} 35 public synchronized void syncInstanceMethodLong(Object x, Object o) {} 36 private void privateInstanceMethodShort() {} 37 private void privateInstanceMethodLong(Object x, Object o){} 38 39 public void testPutField(int runs) 40 { 41 Object localObj = new Object (); 42 for (int i=0; i < runs; i++); 43 } 44 45 public void testGetField(int runs) 46 { 47 Object localObj = new Object (); 48 instanceObj = localObj; 49 for (int i=0; i < runs; i++); 50 } 51 52 53 public void testNonJPOperations() 54 { 55 int i = 1; 56 int ii = 1; 57 int localInt = 1; 58 long localLong = 1; 59 Object localObj = new Object (); 60 int[] localArr = new int[10]; 61 Object oo = new TestClass1(); 62 63 byte b1 = 1; 64 byte b2 = 1; 65 short s1 = 1; 66 short s2 = 1; 67 int i1 = 1; 68 int i2 = 1; 69 long l1 = 1; 70 long l2 = 1; 71 72 final Object tcObject = new TestClass1(); 73 final int[] aa = new int[10]; 74 75 76 78 for(i=TestFrequency.CHECKCAST;--i >= 0;) 80 { 81 } 82 83 for(i=TestFrequency.LOCALVAR;--i >= 0;) 85 { 86 } 87 88 for (i=TestFrequency.LOCALADD;--i >= 0;) 90 { 91 } 92 93 } 94 95 96 public void testFieldOperations() 97 { 98 int i; 99 int localInt = 1; 100 long localLong = 1; 101 Object localObj = new Object (); 102 TestClass obj = new TestClass1(); 103 104 for(i=TestFrequency.PUTSTATIC/6;--i >= 0;) 106 { 107 } 108 109 110 for(i=TestFrequency.GET_ARGSSTATIC/6;--i >= 0;) 112 { 113 } 114 115 116 for(i=TestFrequency.PUTFIELD/9;--i >= 0;) 118 { 119 } 120 121 122 for(i=TestFrequency.GET_ARGSFIELD/9;--i >= 0;) 124 { 125 } 126 } 127 128 129 public void testMethodOperations() 130 { 131 TestInterface localInterface = new TestClass1(); 132 TestClass obj = new TestClass1(); 133 int localInt = 1; 134 Object localObj = new Object (); 135 int i; 136 137 138 for(i=TestFrequency.INVOKEINTERFACE/2;--i >= 0;) 140 { 141 } 142 143 for(i=TestFrequency.INVOKESPECIAL/2;--i >= 0;) 144 { 145 } 146 147 for(i=TestFrequency.INVOKEVIRTUAL/6;--i >= 0;) 149 { 150 } 151 152 for(i=TestFrequency.INVOKESTATIC/4;--i >= 0;) 154 { 155 } 156 157 } 158 } 159 | Popular Tags |