Following our previous discussion, I believe Marc suggested that load and store instructions should support an addressing mode of the form:
Pointer + (Offset) + (Index * Multiplier)
Marc also suggested that we should eliminate the unboxing of boxed values into object pointers, and simply do load/store operations directly on boxed values, compensating for the tag using the offset.
I am thinking that this could perhaps be a good idea, but there are a few annoying quirks:
1) The need to always compensate for the tag is annoying and error-prone. 2) In some cases, we might not even know what the tag is.
I'm thinking that perhaps we want load/store instructions with optional parameters, where the index and multiplier and the tag can be optionally omitted. The tag should also perhaps be a separate parameter from the offset, index and multiplier.
In this way, the load/store instructions could implicitly perform masking on the boxed value when the tag is not specified, and the offset would always be specified from the start of the object being indexed. As an added benefit, an optimizing phase could fill in the tag for us in some cases... But we could also specify it ourself. We could also omit the index and multiplier fields when not indexing an array.
- Maxime