Recent changes to jit: Register usage is now kept in an array per register type and is calculated for non jitted sections too.
Register usage can be per section (a sequence of either jitted or nonjitted ops not separated by branches) or per basic block. This allows later to avoid some register loads, when there are preserved registers.[1][2] There are some commented out trials, to optimize register load/stores, but we have to solve at least [1] before going on here. All allocated memory in jit.c is now freed (except for REQUIRES_CONSTANT_POOL, which I don't know, what it does). There are now more tunable defines in jit_emit.h, where per architecture settings are kept: - preserved registers - dont allocate only once used registers - allocate regs per section or per block - align jump targets[3] All have reasonable defaults, which map the old behaviour, so no changes to architecture files should be needed currently. [1] we currently have no information, that e.g. C<popi> changes the parrot registers. For all other ops we have the ARGDIR flags. Proposed change for pop opcodes: set ARGDIR_OUT on the opcode. [2] when we know, that an external opcode doesn't throw an exception, we could avoid saving registers too. [3] I don't know, if it would be needed. I had some drastic slow down in mops.pasm, when there was an odd branch target, but this was not the reason actually, code size (or where the loop is located) seems to be the culprit, s. end of jit/i386/jit_emit.h - does anyone know, what's goin on here? leo