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 1790626 - wasm: Use pointer to TypeDef instead of type index in P…
…ackedType. r=yury This commit switches the representation of PackedType (and therefore ValType/FieldType) to use a *TypeDef instead of type index. There are several changes here: 1. PackedTypeCode is always 64-bits now to pack the pointer. This penalizes 32-bit platforms, but we likely don't care about them enough to try to optimize this. 2. RefType::TypeIndex is RefType::TypeRef 3. RefType::typeIndex() is RefType::typeDef() 4. TypeContext now stores a map from *TypeDef to original type index for printing errors 5. Decoding a RefType now stores a *TypeDef instead of type index 6. We now just transfer the SharedTypeContext from ModuleEnvironment to Metadata instead of copying definitions. This is needed for sharing the indexOf map. 7. We now manually serialize/deserialize TypeContext 8. TypeContext now stores SharedTypeDef in vector instead of TypeDef, this is needed so that *TypeDef is not invalidated across resizing the vector (asm.js does this) 9. The initialization of TypeContext is refactored to keep the indexOf map in-sync with adding new types (asm.js needs this) 10. We now manually serialize/deserialize PackedTypeCode using a new SerializedTypeCode 11. Serialization now needs a TypeContext in order to get the index of type definitions 12. Deserialization now constructs a TypeContext, and uses that when deserializing ValType/RefType/FieldType Differential Revision: https://phabricator.services.mozilla.com/D157387
- Loading branch information
Showing
28 changed files
with
600 additions
and
646 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
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.