Two Questions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Two Questions

Chris Cunnington
Ok, yea. I see that. At some point Alice has to go down the rabbit hole.
The depiction of events in Smalltalk has to stop making sense at some
point. So, #dispatchOn:in: ceases to refer to things on this level of
abstraction.

For the second question, I think I've been having a problem grokking
what ObjectMemory is. What's the depiction of memory between regular
objects as I see them in a browser and the RAM? Hmmm... that'd be
ObjectMemory itself.

MicroSqueakImageBuilder creates a ByteArray. That gets pulled into
ObjectMemory>>#memory. And the #specialObjectsOop gets pulled in from
the same ByteArray. (Well, it's a binary at this point.)

In the same way that MicroSqueakImageBuilder saved a ByteArray and it
became a fresh, new image. After we've changed the state of the image,
and we Snapshot&Quit, I guess the contents of Object>>#memory get filed
into that same image with altered state.

Thanks,

Chris
_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Two Questions

Bert Freudenberg

On 13.05.2011, at 20:23, Chris Cunnington wrote:

> Ok, yea. I see that. At some point Alice has to go down the rabbit hole. The depiction of events in Smalltalk has to stop making sense at some point. So, #dispatchOn:in: ceases to refer to things on this level of abstraction.
>
> For the second question, I think I've been having a problem grokking what ObjectMemory is. What's the depiction of memory between regular objects as I see them in a browser and the RAM? Hmmm... that'd be ObjectMemory itself.
>
> MicroSqueakImageBuilder creates a ByteArray. That gets pulled into ObjectMemory>>#memory. And the #specialObjectsOop gets pulled in from the same ByteArray. (Well, it's a binary at this point.)
>
> In the same way that MicroSqueakImageBuilder saved a ByteArray and it became a fresh, new image. After we've changed the state of the image, and we Snapshot&Quit, I guess the contents of Object>>#memory get filed into that same image with altered state.

The thing is what you see in Interpreter and ObjectMemory is only meant to be translated to C. "OOPs" are actual pointers after translation to C. It's not object-oriented. The classes itself are ignored. The Simulator subclass makes things work in Smalltalk, using Integers to refer to locations inside the "memory" bytearray. That's a simulation of the actual main memory of your machine. A snapshot of that memory / bytearray is what we call "image", and so that's what MicroSqueakImageBuilder creates.

Makes sense?

- Bert -


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners