Call stack 与 Stack frame的概念

      Call stack(调用堆栈):调用堆栈是一个方法列表,按调用顺序保存所有在运行期被调用的方法。
      Java has metaobjects(Class类信息对象) that represent the execution state of the running program, including metaobjects that represent the call stack.

      调用栈可能就是方法栈的意思,方法栈是JVM为对象的每一次方法调用所分配的一块独立的内存空间,在对方法栈的理解上需要注意这样几个地方:
1.方法栈不是对象唯一的,对同一个对象的方法调用2次,这2次的方法栈是不一样的。
2.方法栈是不能互相通信的,也就是说当一个方法还没有返回任何值的时候,方法外部是不能获得该方法内部参数的状态的。

      Stack frame(堆栈帧)是一个为函数保留的区域,用来存储关于参数、局部变量和返回地址的信息。堆栈帧通常是在新的函数调用的时候创建,并在函数返回的时候销毁。

      Each thread of execution has a call stack consisting of stack frames. Each frame in the call stack represents a method call. Stack frames contain information such as an identification of the method, the location of the statement that is currently executing, the arguments to the method, local variables and their values, and so on. In Java, the frame at the bottom of a call stack represents the main method of an application or the run method of a thread.
---英文部分来自《java reflection in action》的介绍

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值