M0 design problem

Jimmy Zhuo jimmy.zhuo at gmail.com
Mon Apr 2 03:17:43 UTC 2012


Hello All,
I just realized that M0 is stack based. M0 is dedicated to use the least op
to do the work, it's extreme makes it being stack based, not register
based. If the latter is more advanced, then it's a retrogression. Here is
some compares:

M0:
set_imm I0, 0, 123
set_imm I1, 0, 356
add_i     I2, I1, I0

jvm-ish:
push I0, 123
push I1, 123
add   I2, I1, I0
CPU-ish:
mov %eax, 123
add %eax, 356
or
add %eax, %ebx
or
add %eax, [0]   # [0] is memory unit.
or
add [0], %eax   # [0] is memory unit.

In M0, we can't do this:
add_i I2, 123, 356

which should be right way of register based VM, and which parrot currently
does. I don't think parrot current ops implementation is bad, we should
reuse it to implement M0 ops. And I don't want M0 is stack based for easier
JIT too. Any thought or viewpoint?

regards,
Jimmy Zhuo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.parrot.org/pipermail/parrot-dev/attachments/20120402/c7f0105c/attachment.html>


More information about the parrot-dev mailing list