1. A method, comprising: determining a new value to be pushed onto a hardware stack having n entries, n being an integer greater than 1, each entry including a data portion and an associated counter; if the new value equals the data portion of the entry associated with a current top of stack pointer, incrementing the counter associated with that entry; and if the new value does not equal the data portion associated with the current top of stack pointer, storing the new value in the data portion of the next entry and incrementing the current top of stack pointer.