more radical change?
Stephen Weeks
MLton@sourcelight.com
Wed, 28 Nov 2001 09:07:35 -0800
> The difficulties we have currently are all caused by the fact that references
> to objects are NOT the same as pointers to the first word used by an object
> in the heap. This could be changed. The only disadvantages I see to the
> change are:
>
> Getting to the data associated with an object would involve a slightly
> larger offset from the reference. For array subscript calculations
> it would mean that the address of X[i] would be
> X + offset + i * size-of-element
> where offset is the number of bytes from the first word of the array
> object to the first first word of data.
>
> I don't think that this is important.
Simpler array subscript calculations was one of the reasons we chose
the scheme we did. I don't agree with your statement that the extra
offset is not important, and need to be convinced.
> The mutator code would now be more intimately involved with heap layout.
> Currently it only knows when it is creating an object, but now it
> would also have to know when it is accessing an object. It would
> have to know about header words and the like.
>
> This could be a serious objection if we go to some fancy generational
> GC where one might want to use some kind of BBOP for small objects.
This is another good objection to the change.