The Heap uses pointers in a lot of places where we would ordinarily use references. In JSC we use references when: - Not pointing to the JSC heap. (Most of Heap's pointers are not heap pointers.) - The pointer is immutable. - Using references would not introduce lots of * to & (and vice-versa) conversions. - The pointer is non-null. Under these rules, we could move most of Heap's pointers to references. I think we should do it all at once or in a short burst of patches right next to each other.
I'm going to use this bug for planting FIXMEs at all of the Heap's undesirable uses of pointers. I don't want to change this code right now because I have bigger fish to fry, but I want a way to track all of the places that bother me.