In computer systems which do not inherently distinguish between references
and primitive values within a program stack a method and apparatus to
assist exact garbage collection techniques utilizes a stack tag cache
which operates in conjunction with a program stack and supplies a tag item
for every entry in the process stack. The value of a tag item indicates
whether the stack entry is either a reference to another memory location
or a primitive value, i.e. integer or floating point number. The
arrangements and values of the tag items are correlated with changes to
the program stack. The stack tag cache includes facilities for swapping
the contents of the cache in the event of a trap or context switch, as
well as means for redundantly verifying the tag value with intended
instruction operand types.