Mill Computing, Inc. › Forums › The Mill › Architecture › Garbage collectors › Reply To: Garbage collectors
There is no loadp. It would require checking the loaded value after it came in, which is difficult in hardware. In our conversations with GC builders they have not indicated a need for it, given what else is there. If we found we needed the ability to check then it would be an idiom, with a normal load (checked like any plain load), followed by a trap-check of the value on the belt. Such an op would be easy to define and implement.
As for storep of a None (or of normal store and a non-pointer), that’s a really good question and I had to go look at the sim code to see what it does. It’s more complicated even than a None issue, c.f. the following comment in the code:
/* There's some question about where to do barrier
checking. We don't want to throw a barrier trap
on a store that won't actually store (because something
was a NaR), so it should be after we have vetted all
the arguments. However, we should only trap once even
if the store is unaligned, and should deal with the
possibility that the trap result is unaligned. Here
seems the best place. */
So the answer in the present sim is that we trap even if everything is a None (note that vectors can be part None), and don’t trap on a NaR because the NaR has already aborted the store.
This means that a GC can get a barrier trap on an empty store, and will just have to figure it out. It also must deal with storep with a vector of pointers, where some elements would trap and some would not.
I’m reasonably certain that this area will be rethought before it appears in hardware 🙂