EarendilEarendildjsHow djs works
Source

Cell layouts

Every cell kind in the arena, drawn from LAYOUTS (the cells! declarations in crates/djs-core/src/heap/cells.rs). The garbage collector traces exactly the orange fields, and the host’s reader (js/src/layout.generated.ts) is generated from the same table.

Roots (kind 1)

Layout of the Roots cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 24 32 40 48 56 64 72 KIND u8 GC u8 FLAGS u16 SIZE u32 MAGIC u32 VERSION u32 ATOMS Ref STACK Ref REALM Value JOBS Ref HOST_CALLS Ref HANDLES Ref INTERP Ref BUILD u32 FLAGS u32 GC_THRESHOLD u32 PROTO_EPOCH u32 ROOT_SHAPE Ref SHAPES u32 OLD_END u32 MINORS u32 header traced by the GC (Value, Ref) plain data padding
The Roots cell

Str8 (kind 2)

Layout of the Str8 cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 LEN u32 HASH u32 DATA: u8 × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The Str8 cell

Str16 (kind 3)

Layout of the Str16 cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 LEN u32 HASH u32 DATA: u16 × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The Str16 cell

Rope (kind 4)

Layout of the Rope cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 LEN u32 HASH u32 LEFT Ref RIGHT Ref header traced by the GC (Value, Ref) plain data padding
The Rope cell

Symbol (kind 5)

Layout of the Symbol cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 ATOM u32 DESCRIPTION Value header traced by the GC (Value, Ref) plain data padding
The Symbol cell

Object (kind 6)

Layout of the Object cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 24 KIND u8 GC u8 FLAGS u16 SIZE u32 CLASS u32 PROTO Ref PROPS Ref ELEMENTS Ref SLOTS: Value × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The Object cell

PropTable (kind 7)

Layout of the PropTable cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 24 KIND u8 GC u8 FLAGS u16 SIZE u32 COUNT u32 DELETED u32 INDEX Ref ENTRIES: PropEntry × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The PropTable cell

ValueArray (kind 8)

Layout of the ValueArray cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 LEN u32 VALUES: Value × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The ValueArray cell

U32Array (kind 9)

Layout of the U32Array cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 LEN u32 DATA: u32 × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The U32Array cell

AtomTable (kind 10)

Layout of the AtomTable cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 STRINGS u32 ENTRIES Ref INDEX Ref header traced by the GC (Value, Ref) plain data padding
The AtomTable cell

HandleTable (kind 11)

Layout of the HandleTable cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 24 KIND u8 GC u8 FLAGS u16 SIZE u32 LEN u32 FREE u32 LIVE u32 SLOTS: HandleSlot × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The HandleTable cell

FuncTemplate (kind 12)

Layout of the FuncTemplate cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 24 32 40 48 56 64 72 KIND u8 GC u8 FLAGS u16 SIZE u32 FLAGS u32 NAME u32 PARAMS u16 LENGTH u16 LOCALS u16 STACK u16 CAPTURES u16 IC_COUNT u16 CODE Ref CONSTS Ref CHILDREN Ref CAPTURE_DESC Ref HANDLERS Ref IC Ref NATIVE u16 FAST u16 LINES Ref SCRIPT Ref SRC_START u32 SRC_END u32 NAMES Ref header traced by the GC (Value, Ref) plain data padding optional
The FuncTemplate cell

Script (kind 13)

Layout of the Script cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 KIND u8 GC u8 FLAGS u16 SIZE u32 NAME Ref SOURCE Ref header traced by the GC (Value, Ref) plain data padding
The Script cell

BoxCell (kind 14)

Layout of the BoxCell cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 KIND u8 GC u8 FLAGS u16 SIZE u32 VALUE Value header traced by the GC (Value, Ref) plain data padding
The BoxCell cell

Bytes (kind 15)

Layout of the Bytes cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 LEN u32 DATA: u8 × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The Bytes cell

RefArray (kind 16)

Layout of the RefArray cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 LEN u32 REFS: Ref × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The RefArray cell

Interp (kind 17)

Layout of the Interp cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 24 32 40 48 56 64 72 80 KIND u8 GC u8 FLAGS u16 SIZE u32 STATE u32 BP u32 HP u32 SP u32 PC u32 HOST_CALL u32 NEXT_CALL_ID u32 FLAGS u32 RESULT Value OUTCOME u32 JOB_HEAD u32 THROW Value REJECTIONS Ref REPORTED u32 INBOX Ref INBOX_HEAD u32 FUEL_DEBT Value header traced by the GC (Value, Ref) plain data padding
The Interp cell

Realm (kind 18)

Layout of the Realm cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 GLOBAL_LEX Ref INSTALLED Ref INTRINSICS: Value × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The Realm cell

HostCall (kind 19)

Layout of the HostCall cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 24 32 40 KIND u8 GC u8 FLAGS u16 SIZE u32 ID u32 FN u32 ARGS Ref THIS Value PROMISE Value FLAGS u32 header traced by the GC (Value, Ref) plain data padding
The HostCall cell

EphemeronArray (kind 20)

Layout of the EphemeronArray cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 LEN u32 VALUES: Value × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The EphemeronArray cell

AccessorPair (kind 25)

Layout of the AccessorPair cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 GETTER Value SETTER Value header traced by the GC (Value, Ref) plain data padding
The AccessorPair cell

Shape (kind 26)

Layout of the Shape cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 PARENT Ref DESCS Ref COUNT u32 TRANSITIONS Ref header traced by the GC (Value, Ref) plain data padding
The Shape cell

PropValues (kind 27)

Layout of the PropValues cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 SHAPE Ref LEN u32 VALUES: Value × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The PropValues cell

BigInt (kind 24)

Layout of the BigInt cell +0 +1 +2 +3 +4 +5 +6 +7 0 8 16 KIND u8 GC u8 FLAGS u16 SIZE u32 LEN u32 LIMBS: u32 × n variable-length tail; n follows from SIZE header traced by the GC (Value, Ref) plain data padding
The BigInt cell