<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Georgia">"object" in this case is something on the
stack. Sending a message involves pushing the receiver ("object")
and arguments onto the stack and then sending the message (some
variant of send bytecode) which causes the vm to look on the stack
for the receiver and then follow the receiver's class chain to
find the suitable method.<br>
<br>
<br>
</font>
<div class="moz-cite-prefix">On 12/8/13 11:19 AM, gettimothy wrote:<br>
</div>
<blockquote
cite="mid:142d3021b1f.-6483658420070793191.1434645168690466260@zoho.com"
type="cite">
<pre wrap=""> </pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<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 moz-do-not-send="true"
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>
</blockquote>
<br>
</body>
</html>