Call Frames and Optimized Code
When optimized machine code is generated by the compilers, the compiler
generates code that maintains the call stack, but sometimes the function
boundaries are changed in one of two ways:
- Inlining is when
the compiler completely eliminates the call by instead generating the
instructions for the called function at the call site, usually followed
by merging those instructions with the other instructions surrounding
the call site.
- Outlining is when
the compiler creates a function where one did not exist explicitly in
the source. For example, the compiler turns a loop body into a function,
so that it can generate code that uses threads to execute the different
iterations in parallel; or the compiler creates a single shared function
to replace several sections of the source that are similar.
Depending on the information the compiler makes available to the debugger,
inlined calls may or may not show up in the call stack display. Outlined
calls will show up, and will be correlated to the code they came from.
The compiler will probably have supplied the debugger with some invented
name for the function.