<!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;'>No need to go into details as I am just attempting to avoid a misconception.<br><br>On page 5 of 28 on Tim Rowledge's (very useful and enjoyable, btw) <a href="http://www.rowledge.org/resources/tim%27s-Home-page/Squeak/OE-Tour.pdf" target="_blank">A Tour of the Squeak Object Engine</a><br> I am unclear as to what object's header' refers to in step <b>I</b>.<br><br><br>To send a message to a receiver, the VM has to:-<br> <b> I. find the class of the receiver by examining the object's header. </b><br> II. lookup the message in the list of messages understood by that class<br> (the class's MethodDictionary)<br>........etc...<br><br><br>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><br>Is that a valid assumption?<br><br>The BlueBook states this methodology<br><br>****** Messages PDF 584<br> When a send bytecode is encounterd the interpreter finds the CompiledMethod indicated by the message as follows:<br> 1. /Find the message receiver./ The receiver is below the arguments on the stack. The number of arguments is indicated in the send bytecode.<br> 2. /Access a message dictionary./ The original message dictionary is found in the receiver's class.<br> 3. /Look up the message selector in the message dictionary./ The selector is indicated in the send bytecode.<br> 4. /If the selector is found,/ the associated CompiledMethod describes the response to the message.<br> 5. /If the selector is not found,/ a new message dictionary must be searched (i.e. go to step 3) but check the method dictionary of the superclass of the last class.<br><br> 6. /If all the superclasses are searched and the selector is not found, an error is reported and exectuion of the bytcodes following the send is suspended.<br><br><br>Meanwhile, the structure of the Squeak MethodContext has a pointer to the receiver as well.<br><br> + Method Context Structure<br> + ---------------------------------------<br> + ^ sender (pointer to previous context)<br> + ---------------------------------------<br> + instruction ponter --------> points to current bytecode in the CompiledMethod's 'Bytecodes' section (see Format of CompiledMethod instances above)<br> + ---------------------------------------<br> + stack Pointer --------> points to Stack Contents at bottom of this structure<br> + ---------------------------------------<br> + method --------> points to MethodHeader section in the CompiledMethod (see Format of CompiledMethod instances above)<br> + ---------------------------------------<br> + unused<br> + ---------------------------------------<br> + receiver<br> + ---------------------------------------<br> + arguments<br> + ---------------------------------------<br> + temporaries<br> + ---------------------------------------<br> + stack contents<br> + ---------------------------------------<br><br><br><br><br>Thx.<br><br>tty.<br></div></body></html>