Question

Why isnt it more widespread to implement the function call stack in hardware or at least have it closer to the CPU in the L1/L2 cache ?

Couldn't it save stacking/reading back function parameters to registers in the CPU by not having to travel to the memory each time ?

Was it helpful?

Solution

Well, its a matter of price/performance trade of. For many reasons Modern CPU's use SRAM chips as cache. Unfortunately, SRAM is 1000 times pricier then cheap DDR3 you can buy at your local PC store. So, since you probably won't buy 15,000$ i7 CPU, just because it has 1 gig of SRAM L1 cache, no one will produce such. price/performance

Actually, CPU's implements sophisticate methods to compensate the lack of memory. Look for "cache management".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top