It seems that the use of P30 as the .STACK is fine until one of the built-on-the-fly subroutines is called, at which point P30 is NULL, and any attempts to twiddle the stack result in:
oolong:~/research/parrot coke$ ./parrot languages/parakeet/parakeet.imc
0> 33
Null PMC access in push_pmc()
running with -t, we see:
4497 compile P14, P28, S30 - P14=PerlInt=PMC(0x401a3f0 Num:0 Int:0), P28=Compiler=PMC(0xfd6800), S30=".sub xt\nnoop\n.PUSHI("
4501 saveall
4502 invokecc P14 - P14=Eval=PMC(0x401a348)
# Calling sub 'EVAL_1'
# in file '(unknown file)' near line -1
*** switching to BYTECODE_EVAL_1
0 noop
1 new P25, 35 - P25=PMCNULL,
4 set P25, 33 - P25=PerlInt=PMC(0x401a318 Num:0 Int:0),
7 branch 9
16 push P30, P25 - P30=PMCNULL, P25=PerlInt=PMC(0x401a318 Num:33 Int:33)
Similiar results occur with "TOS" (seen by type "1 seeing" instead of 33 at the readline prompt when running parakeet), and presumably with all the fixed registers.
> It seems that the use of P30 as the .STACK is fine until one of the
> built-on-the-fly subroutines is called, at which point P30 is NULL,
> and any attempts to twiddle the stack result in:
As P30 isn't passed on to the subroutine as an argument it doesn't exist
there.
> 4501 saveall
> 4502 invokecc P14 - P14=Eval=PMC(0x401a348)
C<saveall> isn't needed anymore. The code needs some rework.
leo