File: TestOpcodeField.java

package info (click to toggle)
tya 1.6-1
  • links: PTS
  • area: contrib
  • in suites: potato
  • size: 628 kB
  • ctags: 843
  • sloc: ansic: 7,028; asm: 618; java: 497; makefile: 88; sh: 18
file content (34 lines) | stat: -rw-r--r-- 643 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
 test put/get field opcodes
 exactly one of each get/put (8 total) and one integer compare branch
 per loop (and few aload_0)
 Compile without -O !!!!
*/

public class TestOpcodeField
{
	int sint;
	long slong;
	float sfloat;
	double sdouble;
	
	public TestOpcodeField() {}
	
	public static void main( String argv[] )
	{
		TestOpcodeField tof = new TestOpcodeField();
		tof.runTest();
	}
	
	private void runTest()
	{
		long startTime = System.currentTimeMillis();
		for( sint =0; sint < 5000000; sint++ )
		{
			slong = slong;
			sfloat = sfloat;
			sdouble = sdouble;
		}
		System.out.println(System.currentTimeMillis() - startTime);
	}
}