stack.ops - Stack Ops


Operations that manipulate Parrot's register and user stacks.

Register stack operations ^

These operations affect entire sets of registers.


Save all of the registers onto the register stack.


Restore all the registers from the register stack.

User stack operations ^

These operations affect individual registers.

entrytype(out INT, in INT)

Gets the type of entry $2 of the user stack and puts it in $1.

depth(out INT)

Puts the depth of the user stack in $1.

lookback(out INT, in INT)

lookback(out STR, in INT)

lookback(out NUM, in INT)

lookback(out PMC, in INT)

Finds the entry in the user stack at offset $2 from the top and put it in register $1. Positive numbers count down from the top of the stack, negative numbers count up from the bottom. (0 is the topmost entry, -1 is the bottom-most)

save(in INT)

save(in NUM)

save(in STR)

save(in PMC)

Save register or constant $1 onto the user stack.

savec(in STR)

Save a clone of register or constant $1 onto the user stack.

restore(out INT)

restore(out NUM)

restore(out PMC)

restore(out STR)

Restore register $1 from the user stack.

rotate_up(in INT)

Rotate the top $1 entries in the user stack by one. If $1 is positive, then the stack rotates upwards: the ($1)th entry becomes the ($1-1)th entry and so on, all the way up to the top of the stack, while the entry formerly at the top of the stack becomes the new ($1)th entry. If $1 is negative, the stack rotates downwards: the top entry becomes the second entry, the second becomes the third etc., while the former ($1)th entry becomes the new top entry.


Copyright (C) 2001-2006 The Perl Foundation. All rights reserved.


This program is free software. It is subject to the same license as the Parrot interpreter itself.