[VM] CompiledMethod header format?

Matthew S. Davis mdavis at cse.psu.edu
Sat Dec 30 01:22:48 UTC 2000


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






More information about the Squeak-dev mailing list