The evaluation stack,which is mentioned often in the description of the Hello World application,is the pivotal structure of MSIL applications. It is the brIDge between your application and memory locations. It is similar to the conventional stack frame,but there are salIEnt differences. The evaluation stack is the vIEwer of the application,and you can use it to vIEw function parameters,local variables,temporary objects,and much more. Traditionally,function parameters and local variables are placed on the stack. In .NET,this information is stored in separate repositorIEs,in which memory is reserved for function parameters and local variables. You cannot access these repositorIEs directly. Accessing parameters or local variables requires moving the data from memory to slots on the evaluation stack using a load command. Conversely,you update a local variable or parameter with content on the evaluation stack using a store command. Slots on the evaluation stack are either 4 or 8 bytes.
figure 11-1 shows the relationship between the evaluation stack and the repositorIEs for function parameters and local variables.
figure 11-1: A depiction of the evaluation stack,function parameters,and local variablesThe evaluation stack is a stack and thereby a last in/first out (liFO) instrument. When a function starts,the evaluation stack is empty. As the function runs,items are pushed and popped from the evaluation stack. Before the function exits,except for a return value,the evaluation stack must once again be empty. The jmp and tail instructions are exceptions to this rule. If the evaluation stack is not empty at exit,the run time raises an invalidprogramexception exception.
The .maxstack directive limits the number of items permitted simultaneously on the stack. The directive is optional. If the directive is not present,eight slots are reserved on the evaluation stack. The .maxstack directive is a confirmation that an application is performing as expected. Extra items on the evaluation stack are an indication of potential logic problems in an application or a security violation. In either circumstance,this is a violation worthy of a notification.
refer
@H_403_0@ 总结以上是内存溢出为你收集整理的Evaluation Stack全部内容,希望文章能够帮你解决Evaluation Stack所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)