Closed abrown closed 2 weeks ago
High-level question, how complete do you want to get this before landing? For example do you want to have all the // TODO resolved?
No, I think I want to keep the boundary-level TODO: handle shared
around so I can make sure to check all these places when I expand shared types even more. The real question for me about completeness is testing: as I describe above, I can't write spec tests without shared-checking, but I kind of wanted to defer that for a future PR. I'm open to fixing it all here, though, but it's all getting a bit unwieldy...
This changes heap types everywhere to allow them to be
shared
as described in the shared-everything-threads proposal. The key refactoring is to push down all the abstract heap types (e.g.,func
,any
, etc.) into anAbstractHeapType
, leaving theHeapType
enum with two variants:Abstract
andConcrete
. This allows theAbstract
side to be markedshared
; theConcrete
side'sshared
-ness must be checked by looking at the pointed-to type, something which isn't yet addressed by this PR.There are several parts of the PR that bump up against the boundary of what can be marked
shared
currently (e.g.,FuncType
and related types can't yet be markedshared
). I've commented these locations withTODO: handle shared
to be dealt with in future PRs that continue expandingshared
everywhere.