Hacker News new | ask | show | jobs
by rightbyte 922 days ago
Ye. Bytecode interpreters very much benefit from the extra register. And any function that looks similar to one.

I mean e.g. getter and setter functions get alot of extra code to run.

1 comments

Note that even without -fomit-frame-pointer, the compiler can still omit the frame pointer for in some cases. From the GCC documentation:

> Note that -fno-omit-frame-pointer doesn’t guarantee the frame pointer is used in all functions. Several targets always omit the frame pointer in leaf functions.

Fully inlined functions also won't have a seperate stack frame at all. I imaging that is is a big part why the perf impact of turning the frame pointer back on is as small as it is.

It however also means that a complete stack trace will still require using debugging information, in which case you don't really need a frame pointer at all.