001: package measurements.suites;
002:
003: public class TestClassCalibration1 extends TestClass {
004:
005: // fields
006: static int staticInt;
007: static long staticLong;
008: static Object staticObj;
009:
010: private static int privateStaticInt;
011: private static long privateStaticLong;
012: private static Object privateStaticObject;
013:
014: public int instanceInt;
015: public long instanceLong;
016: public Object instanceObj;
017:
018: private int privateInstanceInt;
019: private long privateInstanceLong;
020: private Object privateInstanceObj;
021:
022: // methods
023: public void interfaceMethodShort() {
024: }
025:
026: public void interfaceMethodLong(Object x, Object o) {
027: }
028:
029: public void instanceMethodShort() {
030: }
031:
032: public void instanceMethodLong(Object x, Object o) {
033: }
034:
035: public static void staticMethodShort() {
036: }
037:
038: public static void staticMethodLong(Object x, Object o) {
039: }
040:
041: private static void privateStaticMethodShort() {
042: }
043:
044: private static void privateStaticMethodLong(Object x, Object o) {
045: }
046:
047: public synchronized void syncInstanceMethodShort() {
048: }
049:
050: public synchronized void syncInstanceMethodLong(Object x, Object o) {
051: }
052:
053: private void privateInstanceMethodShort() {
054: }
055:
056: private void privateInstanceMethodLong(Object x, Object o) {
057: }
058:
059: public void testPutField(int runs) {
060: Object localObj = new Object();
061: for (int i = 0; i < runs; i++)
062: ;
063: }
064:
065: public void testGetField(int runs) {
066: Object localObj = new Object();
067: instanceObj = localObj;
068: for (int i = 0; i < runs; i++)
069: ;
070: }
071:
072: public void testNonJPOperations() {
073: int i = 1;
074: int ii = 1;
075: int localInt = 1;
076: long localLong = 1;
077: Object localObj = new Object();
078: int[] localArr = new int[10];
079: Object oo = new TestClass1();
080:
081: byte b1 = 1;
082: byte b2 = 1;
083: short s1 = 1;
084: short s2 = 1;
085: int i1 = 1;
086: int i2 = 1;
087: long l1 = 1;
088: long l2 = 1;
089:
090: final Object tcObject = new TestClass1();
091: final int[] aa = new int[10];
092:
093: // loop tests
094:
095: // check casts
096: for (i = TestFrequency.CHECKCAST; --i >= 0;) {
097: }
098:
099: // local operation
100: for (i = TestFrequency.LOCALVAR; --i >= 0;) {
101: }
102:
103: // local additions
104: for (i = TestFrequency.LOCALADD; --i >= 0;) {
105: }
106:
107: }
108:
109: public void testFieldOperations() {
110: int i;
111: int localInt = 1;
112: long localLong = 1;
113: Object localObj = new Object();
114: TestClass obj = new TestClass1();
115:
116: // static puts
117: for (i = TestFrequency.PUTSTATIC / 6; --i >= 0;) {
118: }
119:
120: // static puts
121: for (i = TestFrequency.GET_ARGSSTATIC / 6; --i >= 0;) {
122: }
123:
124: // instance sets
125: for (i = TestFrequency.PUTFIELD / 9; --i >= 0;) {
126: }
127:
128: // getfields
129: for (i = TestFrequency.GET_ARGSFIELD / 9; --i >= 0;) {
130: }
131: }
132:
133: public void testMethodOperations() {
134: TestInterface localInterface = new TestClass1();
135: TestClass obj = new TestClass1();
136: int localInt = 1;
137: Object localObj = new Object();
138: int i;
139:
140: // invokeinterface
141: for (i = TestFrequency.INVOKEINTERFACE / 2; --i >= 0;) {
142: }
143:
144: for (i = TestFrequency.INVOKESPECIAL / 2; --i >= 0;) {
145: }
146:
147: // invoke virtual
148: for (i = TestFrequency.INVOKEVIRTUAL / 6; --i >= 0;) {
149: }
150:
151: // invoke static
152: for (i = TestFrequency.INVOKESTATIC / 4; --i >= 0;) {
153: }
154:
155: }
156: }
|