Smalltalk如何处理调用堆栈帧(thisContext)? [英] How does Smalltalk manipulate call stack frames (thisContext)?

查看:102
本文介绍了Smalltalk如何处理调用堆栈帧(thisContext)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Smalltalk对象thisContext看起来很奇妙.我不明白它是什么以及它是如何工作的.以及它如何实现延续.

The Smalltalk object thisContext look strange and marvelous. I can't understand what it is and how it works. And even how it enables continuations.

对于C的调用栈,我可以轻松想象它是如何实现和工作的.但是为此...我不能.请帮助我理解它.

For C's call-stack, I can easily imagine how is it implemented and working. But for this... I can't. Please help me to understand it.

推荐答案

我认为这不是一个简单的问题.堆栈在图像中使用MethodContext实例进行了实例化.一个MethodContext可以有一个发送者,这是另一个MethodContext.那可以有另一个...生成整个堆栈. VM在执行CompiledMethod时会实例化MethodContext(也以该语言进行了实例化).

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).

如何将MethodContext映射到C堆栈,具体取决于VM. StackVM(CogVM在StackVM之上)正是一种可以更好地映射MethodContext和C堆栈的VM.

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/在左侧查看帖子...

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

我建议您在 http://lists.squeakfoundation.org/mailman/listinfo/vm-dev中询问

这篇关于Smalltalk如何处理调用堆栈帧(thisContext)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆