How does Smalltalk manipulate call stack frames (thisContext)?

The Smalltalk object thisContextlooks weird and wonderful. I can’t understand what it is and how it works. And even how it allows you to continue.

For the C-stack of calls, I can easily imagine how it is implemented and works. But for this ... I can’t. Please help me figure this out.

+5
source share
3 answers

I think this is a difficult question. The stack is placed on the image with MethodContext instances. There may be a sender in a MethodContext that is another MethodContext. This may have another ... generating an entire stack. The Context method is created by the virtual machine when CompiledMethod is executed (which are also updated in the language).

How MethodContext is pushed onto the C stack, which is virtual machine dependent. StackVM (CogVM sits on top of StackVM) - this is a virtual machine that better maps the MethodContext Con C stack.

Beyond the BlueBook that Lucas said, check

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

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

+5

, Smalltalk-80: , 26-30. () . 580.

+4

Rather, what thisContextis a continuation - the current continuation, in particular.

Imagine a variable cthat MethodContextwill be set up before starting to point to this context. That thisContext.

+3
source

All Articles