How does Smalltalk manipulate call stack frames (thisContext)?

若如初见. 提交于 2019-12-04 07:07:29

I think it is not an easy question. The stack is reified in the image with instances of MethodContext. A MethodContext can have a sender, which is another MethodContext. That one can have another one...generating a whole stack. MethodContext are instantiated by the VM while executing CompiledMethod (which are also reified in the language).

How MethodContext are mapped to C stack, that depends on the VM. StackVM (CogVM is on top of StackVM) is exactly a VM that better maps MethodContext con C stack.

Apart from the BlueBook that Lukas said, check

http://www.mirandabanda.org/cogblog/ check on the left the posts...

I recommend you to ask in http://lists.squeakfoundation.org/mailman/listinfo/vm-dev

The best explanation you can find in Smalltalk-80: The Language and its Implementation, Chapter 26 to 30. The stack frames (contexts) are explained on page 580.

It's more correct to say that thisContext is a continuation - the current continuation, in particular.

Imagine a variable c that, just before a MethodContext activates, is set to point to that context. That's thisContext.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!