The other day, I was thinking about register windows, like the kind on a Sparc CPU. I don’t remember why I was thinking about this, but it was probably me just surfing Wikipedia. At any rate, the question I had was: “What happens when you run out of windows?” There are only so many registers and only so many register windows. I searched on Wikipedia and couldn’t find the answer. Fortunately, I found this great web page written by a Swedish CS professor.
Essentially, whenever there is a register window overflow, the processor receives a trap/interrupt. Then it is up to the OS to spill the register windows to the stack and reset them. Talk about a performance hit!
I think I even remember reading somewhere that Patterson thought his original idea for register windows was a poor choice.
Funny, since the Itanium is using variable sized register windows.