||"To be or not to be" – Shakespeare
Last updated at 1:01 pm UTC on 7 July 2018
"When a classIndex doesn't have the topBit set it maps to an oop in the segment thusly:"
^classIndex - 16 "self firstClassIndexPun" * 8 "self allocationUnit"
| i |
(oop bitAnd: 1) = 0 ifTrue: "pointer"
[(i := oop >> 2) >= 16r20000000 ifTrue:
[^outPointers at: i - 16r20000000].
^oopMap at: oop].
i := oop >> 1. "signed small int"
i <= 16r3FFFFFFF ifTrue: [^i].
^i - 16r80000000
"This method is for compatibility only.
In Smalltalk, this used to return an integer unique to each object.
In Squeak, OOPs are internal to the VM. Accessing an OOP would be useless anyway since it changes when the object is moved during garbage collection."