From 3f8b90885dc2122fc75cf5e3d8e6ec85a3c8888c Mon Sep 17 00:00:00 2001 From: Jonathan Paprocki Date: Thu, 22 Jun 2023 16:17:14 -0400 Subject: [PATCH] docs: add noun rep svg --- docs/noun-rep.svg | 1962 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1962 insertions(+) create mode 100644 docs/noun-rep.svg diff --git a/docs/noun-rep.svg b/docs/noun-rep.svg new file mode 100644 index 0000000..899143d --- /dev/null +++ b/docs/noun-rep.svg @@ -0,0 +1,1962 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DIRECT ATOM + << 3 + << 3 + ... + A direct atom is an atom which fits in a machine word, less one bit for the tag. It is stored directly. + 64-BIT MACHINE WORD + Nouns are represented as machine words with the MSBs as tag bits. + Legend:Yellow - dataDark green - pointer tagLight green - pointerOrange - metadataLight blue - sizeGrey - reserved + + + + + + + + 0 + + + CELL POINTER + HEAD + + + METADATA + TAIL + A cell is represented as a tagged pointer. The memory referenced is adjacent machine words.The machine word at the pointer is metadata. The machine word directly following (higher in memory)is the noun representation of the head, followed by the noun representation of the tail. The metadatafield is primarily used for the mug. + INDIRECT ATOM + An indirect atom is an atom which is too big to be a direct atom. It is thus represented as a taggedpointer. The memory referenced is 64-bit aligned. The first 64 bits are metadata, followed by the size in 64-bit words, then the actual value of the atom. The metadata field is primarily used forthe mug. The first three bits of the size are reserved for a possible forwarding pointer tag. + FORWARDING POINTER - CELL + When a cell is copied from one stack frame to another, its head is replaced with a forwarding pointer to the new location. + + + + + 1 + + + + 0 + + + + + + + + + + + + + + + 1 + + + 1 + + 0 + + + + + SIZE + + + METADATA + DATA + + + + + + + + + + + + + + + + + FORWARDING POINTER - INDIRECT ATOM + When an indirect atom is copied from one stack frame to another, its size is replaced with aforwarding pointer. + METADATA + DATA + << 3 + ... + + + + + 1 + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + FORWARDING POINTER + FORWARDING POINTER + METADATA + TAIL + << 3 + + + + + + + + + + + + + 1 + + + 1 + + 0 + + + + + + + 1 + + + 1 + + 1 + + + + + + + 1 + + + 1 + + 1 + + + + + + + + + + + +