开发者

Procedure Activation Time

Is procedure activation time a part of the compile time, whereby preparation for function calls is performed?

开发者_StackOverflow社区

Or is it a part of run time when the function is actually called?

(Though unsure, I am hinging on the second option)


You are probably referring to how a function is called. I assume you want to know how arguments are passed, copied, etc.

Each function has a "calling convention" that specifies how the function is to be called. This is the process whereby the program places arguments on the stack, saves the current location of the instruction in the calling function, and jumps to the called function's first instruction. In addition the calling convention specifies how to return back to the calling function and how the return value is saved. How this is done will be platform specific and depend on the calling convention in use for a given function.

Based on the calling convention, code is emitted by the compiler to perform the correct steps to call the function. This code would be executed at runtime to perform the call. You can read more about x86's calling conventions on wikipedia here x86 calling conventions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜