<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'>Fascinating!<br><br>I am very glad I asked. (:<br><br>I have cut-n-paste your reply into my study plans.<br><br>thank you very much.<br><br>ttty<br><br><br><div id="1"><br>---- On Sun, 08 Dec 2013 09:12:08 -0800 <b>David T. Lewis&lt;lewis@mail.msen.com&gt;</b> wrote ---- <br></div><br><blockquote style="border-left: 1px solid #0000FF; padding-left: 6px; margin:0 0 0 5px">  <br>On Sun, Dec 08, 2013 at 08:19:59AM -0800, gettimothy wrote: <br>&gt;   <br>&gt; No need to go into details as I am just attempting to avoid a misconception. <br>&gt;  <br>&gt; On page 5 of 28 on Tim Rowledge's (very useful and enjoyable, btw) A Tour of the Squeak Object Engine <br>&gt;  I am unclear as to what  object's header' refers to in step I. <br>&gt;  <br>&gt;  <br>&gt; To send a message to a receiver, the VM has to:- <br>&gt;    I.        find the class of the receiver by examining the object's header.   <br>&gt;    II.       lookup the message in the list of messages understood by that class <br>&gt;        (the class's MethodDictionary) <br>&gt; ........etc... <br>&gt;  <br>&gt;  <br>&gt; It seems 'obvious' to me that it has to be something in the current MethodContext,  and that 'object' does not refer to something out in ObjectMemory  <br>&gt;  <br> <br>Hi tty, <br> <br>Actually it does refer to something out in the ObjectMemory. There is <br>an excellent summary in the class comment of ObjectMemory, so read that <br>for an overview (it's short, but be prepared to read it several times <br>slowly to wrap your head around it). <br> <br>Each object in the object memory can be referenced by an object pointer. <br>This is not a pointer in the C sense of the word, so the various references <br>to "pointers" throughout the VM code may be confusing in that regard. <br>The object pointer identifies the current location of the object in <br>the object memory. It points to the location of the object header, which <br>is described in detail in the ObjectMemory class comment. The header <br>may be one or more words in length, and you can think of the header <br>words as extending to the left (memory locations 0, -1, -2) of the first <br>object header word. Any data required to represent the object then <br>extends to the right (1, 2, 3, ...) of the object header location. <br> <br>Object headers contain enough information to identify the class of <br>the object, and that is what Tim means by "find the class of the receiver <br>by examining the object's header". Tim and Eliot can explain the rest <br>better than I can, but hopefully this clarifies some of it. <br> <br>Note that the 64-bit object format described in ObjectMemory is not <br>the same thing as the newer format that you will be working on with <br>Eliot (it is a simple extension of the current 32-bit object format), <br>but understanding that format may also be helpful in understanding <br>the work that Eliot is doing now. <br> <br>On Sun, Dec 08, 2013 at 11:54:46AM -0500, Bob Arning wrote: <br>&gt; <br>&gt; "object" in this case is something on the stack. Sending a message <br>&gt; involves pushing the receiver ("object") and arguments onto the stack <br>&gt; and then sending the message (some variant of send bytecode) which <br>&gt; causes the vm to look on the stack for the receiver and then follow the <br>&gt; receiver's class chain to find the suitable method. <br>&gt; <br> <br>And to relate this what I was was saying, the object on the stack is <br>an object pointer, which gives the VM enough information to locate <br>the object header out there in the object memory. <br> <br>HTH, <br>Dave <br> <br></blockquote><br></div></body></html>