[Vm-dev] CogVMExecution Flow
Chris Cunnington
brasspen at gmail.com
Tue Jun 14 13:23:50 UTC 2016
> a2) "marries" the context in the image that invoked the snapshot
> primitive (a stack frame in the stack zone is built for the context, and
> the context is changed to become a proxy for that stack frame).
When saving to disk, does the stack state of a married frame inside a
CogStackPage bitmap get saved back to the stack of a MethodContext instance?
The CompiledMethod of a MethodContext is not changed in an image. It is
compiled by the StackToRegisterMappingCogit and stored in a frame in the
CogStackPage as a copy. This is not saved when the image is saved to
disk. The machine code is thrown away. It only existed in RAM.
That's fine, because you have the original CompiledMethod untouched with
its bytecodes. But if in the process of execution the state of a stack
under a MethodContext changes, and it will, and the entire content of
the CogStackPages bitmaps will be nulled out and not saved to disk in
the image as new, extra memory, then does the married frame shiv its
content back into every MethodContext instance on snapshot and quit?
The frame has a header that can point to the CompiledMethod with
bytecodes or to a machine code compiled version next door in the
CogStackPage bitmap. But if you copy the stack of a MethodContext into
its married frame, then the stack in the MethodContext is out of date,
while the CoInterpreter spins everything it needs in the separate world
in CogStackPages; then, when you save to disk, are you, as a last
effort, saving state back from every married frame to its original
MethodContext instance?
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160614/9b199b2e/attachment.htm
More information about the Vm-dev
mailing list