M0 single deref

Jimmy Zhuo jimmy.zhuo at gmail.com
Wed Apr 25 12:20:53 UTC 2012


Hello Nathan Brown,

     I'm glad that you're working on m0. But I'm sure you're passing the
tests with a wrong implementation.

First, take a look at
https://github.com/nbrown/parrot/commit/6a75a09a24d410b01ac68eb6ca0765a30a89
9e0c . It assumes that the length > 8 is pointers and < 8 is consts, which
is a wrong way, unless you have a good reason.

Second, take a look at
https://github.com/nbrown/parrot/commit/fa5c366a7384acafbf59f3a631613af1a235
34f0 . It changes the spec, the Spec says, "PC - current instruction within
the current bytecode segment". That is, the PC must point to a instruction
head, that's why goto needs to be '*4'. Why must use '*4'? Let's take a look
at the instructions flow:

 

--------------------------

|OP|I1|I2|I3|OP|I2|I4|I5|

--------------------------

 

If you are '*4', and PC can always point to OP, but if you not, and you use
'goto', that may makes PC to point I3, which makes instruction looks like
'I3 OP I2 I4', which is wrong.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.parrot.org/pipermail/parrot-dev/attachments/20120425/3a504caf/attachment.html>


More information about the parrot-dev mailing list