forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1774827 - wasm: Add RecGroup and implement canonicalization of al…
…l types. r=yury This commit adds explicit recursion groups and implements type equality using canonicalization as specified in the GC proposal. For the following example: 0: (struct) (rec 1: (struct (ref 0)) 2: (struct (ref 1)) ) (rec 3: (struct (ref 0)) 4: (struct (ref 3)) ) Type equality is done primarily on a recursion group basis. The first and second explicit rec's are equal, causing the types within them to be pairwise equal. Equality is given by the following transformation of the recs to have 'back edges' to their local recursion group made explicit. The rest of the equality can be done in a bottom up (inductive) manner. (rec 1: (struct (ref nonrecursive 0)) 2: (struct (ref recursive 0)) ) (rec 3: (struct (ref nonrecursive 0)) 4: (struct (ref recursive 0)) ) With this example, you can see that transforming the 'local' edges to a normalized format allows equality to done by simple comparison. The biggest change in this commit is to how we store and create type definitions: 1. TypeDef is now stored inline in a containing RecGroup class 2. TypeContext now has a 'startRecGroup' and 'endRecGroup' method for building rec groups. There are several other changes required too: 1. Serialization/deserialization now operates on recursion groups, not type defs 2. (oom handling fix) Serialization/deserialization initializes refptr's at the correct type 3. Canonicalization of function types (which existed already for MVP) is now generalized to to support canonicalization of all types. Differential Revision: https://phabricator.services.mozilla.com/D159057
- Loading branch information
Showing
19 changed files
with
916 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.