Reading a blog entry by Eric Lippert, I came across this snippet:
...you're going to either loop forever (if you're on an architecture that can optimize tail calls) or run out of stack 开发者_StackOverflowand crash the process.
I'm aware that a compiler can optimize tail recursion, but what does an architecture that can optimize tail calls mean?
It means that the .NET JIT on x64 behaves differently to the JIT on x86 - the x64 one applies tail call optimizations much more aggressively.
See this blog post from 2007 and this one from 2009 for some implementation details (not to be depended upon) for some of the rules that are followed.
精彩评论