Direct Calls
We should use direct calls for INVOKESTATIC and INVOKESPECIAL on i386.
This requires:
- fixing the rel32 address when the code is relocated
- adapting the code that patches in the JIT code address
(
is this thread-safe now? see ThreadsafePatchers)
I tried this on i386. The only problem in the implementation is asm_call_jit_compiler. I found no safe way to check in this function if the call was made by a direct CALL rel32. Thus I implemented a second function asm_call_jit_compiler_relative and generated a second stub for each method. The code is archived in my local cacao git repository.
There is a speedup, but it is not very large. It seems that as long as the calls stay within the branch prediction buffer there is not much difference between a direct and an indirect call. (Only tried on Pentium M so far.)
The greatest speedup was 3.5% for sieve called with the "unnatural" parameters 1 500000000.
-Edwin