Go to the first, previous, next, last section, table of contents.

Vm_Obj Tagbits

Muq Vm_Obj variables are basically 32-bit unsigneds, which can be used to refer to any user-visible object in the system: They are the basic type manipulated by a MUF programmer.

Muq Vm_Obj values store the types of certain (small) datatypes within the pointer itself. In fact, they store the values of certain (smaller!) datatypes within the pointer itself, also.

We interpret the meaning of a Vm_Obj by examining the least significant eleven bits. Those with five-bit tags are pointers into the virtual memory pool; The remainder are immediate values stored in the pointer itself, except for the ephemeral values, which are offsets into some loop stack:

A9876543210   Meaning
-----------   ---------------------------------------------
*********00   62-bit int   in upper 62 bits.
*********10   Reserved for immediate complex values.
******11111   59-bit float in upper 59 bits.
******11101   Bignum
******11011   Struct (also CLOS objects and bignums).
******11001   Thunk/promise.
******10111   Procedure.
******10101   Standard obj stored in vm_obj.
******10011   CONS cell.
******10001   Symbol.
******01111   Vector.
******01101   Doublevector
******01011   Floatvector
******01001   Intvector
******00111   Shortvector.
******00101   Bytevector. (String.)
******00011   Bitvector.
#ifdef OLD
***11100001   A 0-byte byte string.
***11000001   A 1-byte byte string (o >> 24)
***10100001   A 2-byte byte string (o >> 24), (o >> 16)
***10000001   A 3-byte byte string (o >> 24), (o >> 16), (o >> 8)
00011100001   A 0-byte byte string.
00111100001   A 1-byte byte string.
01011100001   A 2-byte byte string.
***11000001   A 3-byte byte string
10011100001   A 4-byte byte string.
10111100001   A 5-byte byte string.
11011100001   A 6-byte byte string.
***10100001   A 7-byte byte string.
***10000001   Unused (RBGA values?)
xxx01100001   Reserved for nonzero xxx.
00001100001   Bottom-of-stack value.
1**01000001   Reserved for future ephemeral types.
01101000001   Ephemeral (stack-allocated)  vectors.
01001000001   Ephemeral (stack-allocated)  structs.
00101000001   Ephemeral (stack-allocated)  objects.
00001000001   Special values such as OBJ_NOT_FOUND.
xxx00100001   Reserved for nonzero xxx.
00000100001   Top-of-block value.
***00000001   Char.

Go to the first, previous, next, last section, table of contents.