On 08/09/04 Leopold Toetsch wrote:
> Dan posted some numbers: P 26951, S 2099, I 8878 for "evil program". The
> program dies because of memory shortage when setting up the register
> life information.

Some time ago I used a 16 bit unsigned int to represent virtual
registers in the mono JIT. Well, it turns out it was not enough
(IIRC it was an initialization method emitted by the Mercury 
compiler). It was a single basic block and the number of virtual regs
was somewhat inflated because the jit optimizes small memcpy()
by emitting up to 5 load/stores inline (that makes 5 extra temp regs).
Anyway, just a warning: sane people don't write that kind of methods,
but compilers do (either compiler-compilers like yacc or compilers for
strange languages), so it's good to plan also for a cutoff value: if
it's reached, use a different algorithm, like linear scan: very big
methods are unlikely to be perf critical anyway (or you might spend much
more time compiling than executing them anyway:-). The 16 bit virtual
register representation might come back as a compile-time option
for embedded and small-mem users.

lupus

-- 
-----------------------------------------------------------------
[EMAIL PROTECTED]                                     debian/rules
[EMAIL PROTECTED]                             Monkeys do it better

Reply via email to