Re: Function prologs emitted by VC++ compiler
- From: "Skywing [MVP]" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 14 Aug 2006 17:54:14 -0400
Up to the compiler/optimizer's whims, pretty much. In general, if frame
pointer omission (FPO) optimizations are enabled then you are likely to not
see ebp being used as a frame pointer reliably.
In either case, there is no hard guarantee that ebp will be used as a frame
pointer as far as I know.
--
Ken Johnson (Skywing)
Windows SDK MVP
"Ranjit" <ranjitiyer@xxxxxxxxx> wrote in message
news:1155591942.849030.183720@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi All,
Firstly, my apologies for posting this question across 2 groups -
(comp.compilers and windows.kernel). I was'nt sure which was the
appropriate forum for this question.
My questions is about function prologs.
Under what circumstances would a compiler not generate the standard
prolog -
(push ebp, mov ebp,esp) for a function.
I observed this anomaly for quite of a few functions exported from
Win32 dlls - kernel32.dll, ntdll.dll, etc. One such example function is
InterlockedIncrement() where the prolog is optimized away and the
function body starts directly by reading its parameters using offsets
from the ESP.
When do compilers decide to do such prolog optimizations. I was under
the impression that all functions (not naked/inline) have to start with
the standard prolog instructions. Is that a wrong assumption to make?
Could someone share their thoughts on this.
Thanks,
Ranjit
.
- References:
- Function prologs emitted by VC++ compiler
- From: Ranjit
- Function prologs emitted by VC++ compiler
- Prev by Date: Function prologs emitted by VC++ compiler
- Next by Date: Re: Function prologs emitted by VC++ compiler
- Previous by thread: Function prologs emitted by VC++ compiler
- Next by thread: Re: Function prologs emitted by VC++ compiler
- Index(es):
Relevant Pages
|