Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行栈和上下文 #16

Open
lovelmh13 opened this issue Mar 7, 2020 · 1 comment
Open

执行栈和上下文 #16

lovelmh13 opened this issue Mar 7, 2020 · 1 comment

Comments

@lovelmh13
Copy link
Owner

lovelmh13 commented Mar 7, 2020

ECStack 执行环境栈(Execution Context Stack)(栈内存)

当全局代码还没有执行完,就要执行一个函数的时候,会把当前的全局EC压到栈底。然后把函数的执行栈,压入栈,执行函数。函数执行完以后,弹出。继续执行全局代码。如果是闭包的话,是不会出栈的,因为出栈就会销毁,而是把它压入栈底

EC 执行上下文(Execution Context)

  • 有全局的EC
  • 函数的EC,每个函数执行的时候,会形成一个新的执行上下文
  • eval的EC

变量对象

每一个执行上下文里面,都有一个变量对象,来存储变量对象

在全局EC里面,叫 VO,Variable Object(变量对象)
在函数EC里面,叫AO,activation object(活动对象)

@lovelmh13
Copy link
Owner Author

lovelmh13 commented Jun 7, 2021

重写一篇,之前的过期且枯燥

看这篇吧 :#63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant