VM addImmutableSlot: #Memory valued: C Module newEmpty. VM Memory enter. addSynonymNamed: #Word of: UnsignedLongInt. Word export. addSynonymNamed: #Byte of: UnsignedChar. Byte export. addSynonymNamed: #Bool of: UnsignedLongInt. Bool export. addConstantNamed: #True valued: 1 type: Bool. True export. addConstantNamed: #False valued: 0 type: Bool. False export. addConstantNamed: #Nil valued: 0 type: Void pointer. Nil export. addStructureNamed: #Map. Map export. "For a type-declaration; the actual definition is far below in object.slate." addStructureNamed: #ObjectHeader. ObjectHeader export. "For type-declarations; the actual definition must be placed in each GC file." addStructureNamed: #Object. Object export. Object addElementNamed: #header type: ObjectHeader. Object addElementNamed: #map type: Map pointer. addStructureNamed: #ForwardedObject. ForwardedObject export. ForwardedObject addElementNamed: #header type: ObjectHeader. ForwardedObject addElementNamed: #target type: Object pointer. addSynonymNamed: #ObjectPointer of: Word. ObjectPointer export. addConstantNamed: #SmallIntTag valued: 2r1. SmallIntTag export. addConstantNamed: #ObjectTag valued: 2r0. ObjectTag export. addConstantNamed: #TagMask valued: 2r1. TagMask export. i@LongInt fitsSmallInt "Answer true if the given value can be represented as a SmallInteger." "DETAILS: This trick is from Tim Rowledge. Use a shift and XOR to set the sign bit if and only if the top two bits of the given value are the same, then test the sign bit. Note that the top two bits are equal for exactly those integers in the range that can be represented in 31-bits." [ (i bitXor: i << 1)!LongInt cast >= 0 ]!Bool inline export. oop@ObjectPointer isSmallInt [(oop bitAnd: TagMask) = SmallIntTag]!Bool inline export. oop@ObjectPointer isObject [(oop bitAnd: TagMask) = ObjectTag]!Bool inline export. oop@ObjectPointer pointer "The memory address stored in the ObjectPointer; not shifted since objects are word-aligned anyway." [(oop bitAnd: TagMask bitNot)!(Object pointer) cast]!(Object pointer) inline export. p@(Object pointer) asObject [(p!UnsignedLongInt cast bitOr: ObjectTag)!ObjectPointer cast]!ObjectPointer inline export. p@(Map pointer) asObject [(p!UnsignedLongInt cast bitOr: ObjectTag)!ObjectPointer cast]!ObjectPointer inline export. i@UnsignedLongInt asObject [(i << 1 bitOr: SmallIntTag)!ObjectPointer cast]!ObjectPointer inline export. i@LongInt asObject [(i << 1 bitOr: SmallIntTag)!ObjectPointer cast]!ObjectPointer inline export. oop@ObjectPointer asSmallInt [oop!LongInt cast >> 1]!LongInt inline export.