Spawned from this comment, this is something we may want to push more on in the future. In an initial attempt to do this I was stymied pretty quickly:
gc_host_alloc_types would be difficult to move because this field is currently accessed before a GcStore is allocated. Callers would have to switch to ensure_gc_store and async to make this work.
pending_exception is difficult because right now barriers require the entire GcStore, so the preexisting barrier functions can't be used if this field is stored witin the GcStore itself.
gc_roots is difficult because during timming liveness flags for OwnedRooted that takes a simultaneous borrow on GcStore and the RootSet. If these lived in the same object it's more difficult to handle them in tandem.
However gc_roots_list and subtype_check_cache are likely easy to move. Given the difficulty in moving the prior ones though I didn't want to do a halfway migration so I'm going to leave this for a future refactoring.
Spawned from this comment, this is something we may want to push more on in the future. In an initial attempt to do this I was stymied pretty quickly:
gc_host_alloc_typeswould be difficult to move because this field is currently accessed before aGcStoreis allocated. Callers would have to switch toensure_gc_storeandasyncto make this work.pending_exceptionis difficult because right now barriers require the entireGcStore, so the preexisting barrier functions can't be used if this field is stored witin theGcStoreitself.gc_rootsis difficult because during timming liveness flags forOwnedRootedthat takes a simultaneous borrow onGcStoreand theRootSet. If these lived in the same object it's more difficult to handle them in tandem.However
gc_roots_listandsubtype_check_cacheare likely easy to move. Given the difficulty in moving the prior ones though I didn't want to do a halfway migration so I'm going to leave this for a future refactoring.