> Register based. Untyped registers; I'm hoping that the vtable stuff can be
> sufficiently optimized that there'll be no major win in
> storing multiple copies of a PMC's data in different types knocking
around.
>
> For those yet to be convinced by the benefits of registers over stacks,
try
> grokking in fullness what op scratchpads are about. Ooh look, registers.
I think "stack based =~ register based". If we don't have Java-like "jsr"
and "ret", every bytecode inside one method always operates on the same
stack
depth, therefore we can just treat the "locals + stack" as a flat register
file. A single pass can translate stack based code into register based code.
For example:
push local #3; => move #(max_local + opcode_stack_depth), #3
push local #3; push local #4; add; pop local #5; => add #5, #3, #4
push local #3; push local #4; call foo; pop #6; => call_2 #6, #3, #4
As long as stack based system is carefully designed, we can easily add
linear-cost translation step to convert it into register based bytecode,
and run it faster.
Hong