Hi,
I'm just starting an attempt to figure out "how the Squeak VM works". I decided to start with the chapters from the Blue Book on the implementation of the VM and to go through my Squeak 2.8 image as I go along. I know that things have changed in this implementation from the Blue Book days, but there is something in the Squeak implementation that is really confusing me.
I decided to figure out Squeak's method header format. So I checked out the Interpreter class. Assume that the most significant bit is numbered 31 and the least significant bit is 0 in this question. It seems that bit 25 of the header is associated with two fields: the argument count from Interpreter>>argumentCountOf: and with the temporary count found in Interpreter>>bytecodeActivateNewMethod and Interpreter>>internalBytecodeActivateNewMethod which both implement the retrieval of the tempCount from the header (alas). It also seems that bit 18 is totally ignored.
I've determined the following header format from the Interpreter methods:
bit 0 : constant 1 to indicate SmallInteger bits 1-9 : primitive index bits 10-17 : literal count bit 18 : not used? bits 19-25 : temporary count bits 25-28 : argument count bits 29-31 : primitive index
Could someone please explain why bit 25 is shared between two fields? I'm not clear why this is the case. Should the temporary count really be in bit positions 18-24? If so, it does not look like they are.
Thanks!
-Matthew
"Matthew S. Davis" wrote:
Hi,
I'm just starting an attempt to figure out "how the Squeak VM
works".
You might find it useful to look at the impending Squeak book - wherein you will find several beautifully written and insightful chapters on just this topic. You can read most (or maybe all by now) of it at: http://coweb.cc.gatech.edu/squeakbook
tim
squeak-dev@lists.squeakfoundation.org