程序启动时间
过程激活时间是否是编译时间的一部分,从而为函数调用做准备?
或者它是实际调用函数时运行时的一部分?
(虽然不确定,但我倾向于第二种选择)
Is procedure activation time a part of the compile time, whereby preparation for function calls is performed?
Or is it a part of run time when the function is actually called?
(Though unsure, I am hinging on the second option)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能指的是如何调用函数。我假设您想知道如何传递、复制参数等。
每个函数都有一个“调用约定”,用于指定如何调用该函数。这是程序将参数放入堆栈、保存调用函数中指令的当前位置并跳转到被调用函数的第一条指令的过程。此外,调用约定指定如何返回调用函数以及如何保存返回值。这是如何完成的将是特定于平台的,并且取决于给定函数使用的调用约定。
根据调用约定,编译器会发出代码来执行调用函数的正确步骤。该代码将在运行时执行以执行调用。您可以在维基百科上阅读有关 x86 调用约定的更多信息 x86 调用约定。
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.