On Jun 25, 2010, at 4:20 PM, Nathan Lawrence wrote:
The size of our JIT generated code is a memory known issue. According to Oliver the slow cases for some of our operations is on the order of 128 bytes. It occurred to me that we could reduce the JITed code by only compiling the slow case once and having all of the subsequent generated code jump to that specific slow case. The issue with this is our slow cases jump back to specific locations in the hot path, with potentially different values on the stack, as opposed to a normal function which returns back to a very specific state. We can circumvent this issue by hand writing the assembly to return to an offset of the return address with the required state.
What do people think?
I think it's a good idea. It may even help speed in addition to memory use. I bet there are also some slow cases that can only return to exactly one place, and therefore could act like more conventional function calls. Regards, Maciej