.local PerlArray READDATA .local PerlHash RESTOREINFO .sub _main READDATA = new PerlArray RESTOREINFO = new PerlHash
call _data end .end .sub _data push READDATA, 10 ret .end
Throws an error in the VM of:
push_integer() not implemented in class 'PerlHash'
This is, as far as I can tell, because the same register is used by IMCC for both the READDATA and RESTOREINFO locals, thus by the time that the sub _data gets around to being run, READDATA has become a PerlHash (imcc -t):
PC=0; OP=821 (new_p_ic); ARGS=(P0, 14) PC=3; OP=821 (new_p_ic); ARGS=(P0, 15) PC=6; OP=752 (bsr_ic); ARGS=(2) PC=8; OP=722 (push_p_ic); ARGS=(P0, 10) push_integer() not implemented in class 'PerlHash'
This seems to conflict with the example that Leo gave me on the 28th. I'm not sure if this is a bug or if I've got some whacky misunderstanding of how things work. I think my intention is clear by the above piece of code. Suggestions?
As a postscript, changing the code to:
.local PerlArray READDATA .local PerlHash RESTOREINFO .sub _main READDATA = new PerlArray RESTOREINFO = new PerlHash
push READDATA, 10 end .end
Produces the desired (and expected) output. READDATA and RESTOREINFO each get their own register:
PC=0; OP=821 (new_p_ic); ARGS=(P0, 14) PC=3; OP=821 (new_p_ic); ARGS=(P1, 15) PC=6; OP=722 (push_p_ic); ARGS=(P0, 10) PC=9; OP=0 (end)
This was all done with imcc, cvs updated as of 12:00 Eastern time. No optimization options selected.