<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <blockquote type="cite">
      <meta charset="utf-8">
      <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;"> 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).</pre>
    </blockquote>
    <br>
    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?<br>
    <br>
    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. <br>
    <br>
    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?<br>
    <br>
    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? <br>
    <br>
    Chris <br>
  </body>
</html>