RTC Thumb2 JIT enhancements

ed at camswl.com ed at camswl.com
Thu Mar 11 03:23:29 PST 2010


Hi folks,

The following are some enhancements I have made to the T2JIT over the past
month.

I have tested the changes with various benchmarks, with Think Free Office,
and with the hotspot and lang portions of JTreg which all pass. The jdk
portion is still running.

Unfortunately the diffs are quite large so I am submitting the diffs to
the list as 4 separate sets of diffs.

Has the b18 release been split off yet? I would prefer these changes not
to go into the b18 release as they have not had sufficient testing yet.

Regards,
Ed.

- Support for frameless compilation

	Local variables and interpreter state are now addressed from Java SP
	rather than separate 'istate' (R8) register. R8 now free for register
	allocation giving 6 allocatable registers instead of 5.

- Support for compilation of methods containing monitorenter / monitorexit

	monitorenter / monitorexit moved from asm to C so they can be called
	by JIT code compilation of monitorenter / monitorexit containinng
	methods uses frame adressing because stack can expand dynamically to
	accomodate monitors.

- Interpreter caches 'thread' in a register

	Interpreter reworked to cache 'thread' in a register. Involved
	removal of one 'tmp' register in interpreter to make room for
	'thread' register. Interpreter and JIT are now consistent in register
	usage.

- Compression of JIT 'header'

	Removed the OSR entry from the JIT header. Previously, each JITted
	method had an individual piece of code in the header to load the
	appropriate registers from locals and the jump to the OSR entry
	point. This is changed so the the OSR caller (the interpreter), uses
	the 'regusage' array in the JIT header to load the correct registers
	and then just jumps directly to the entry point in the method.
	Saving is 24 bytes per method.

- Backwards branch targets now doubleword aligned.

	Pads with no ops before a backwards branch target to ensure backwards
	branch target is 64 bit aligned. Small performance benefit.

- Addition of OSPACE flag

	Setting environment variable T2_OSPACE will cause the JIT to optimise
	for space as opposed to time. OSPACE does the following.

	o Tweaks the register allocation to allocate register based on space
	o Enables tailing of returns. IE does a branch to the return.
	o Disables doubleword alignment of backwards branch targets
	o Disables inlining invoke virtual/static/special wrappers

	OSPACE has a small performance effect on benchmarks (~10% on ECM) but
	has no noticeable effect on large applications.

	Default is compile for time (OSPACE disabled)

- Removed a pass from the compiler

	The JIT had an additional pass to detect 'zombie' code (ie code which
	could be, but has never been called). Zombie code removal was
	disabled in prior versions because it was unreliable, however the
	additional pass was still there.

- Removed vestigal and debug code

	Removed #if 0 code and debug code which was no longer functional



More information about the distro-pkg-dev mailing list