Skip to content

Commit b12a949

Browse files
authored
Add a utility for principal types (#7642)
WebAssembly has the property that every valid sequence of instructions has a principal type, i.e. a unique most-specific type. However, due to various kinds of polymorphism, these principal types may contain type variables. Specifically, the syntaxes for value types, heap types, nullability, sharedness, and exactness are all augmented with type variables. Add a PrincipalType utility for representing and composing these principal types. This can be seen as a more powerful version of the existing StackSignature utility. Follow-up PRs will update ChildTyper to use principal types to represent type constraints and use the principal types of outlined instruction sequences to detect polymorphism and determine the types of outlined functions. There are also further potential applications in simplifying validation, simplifying expression typing, and performing spec-compliant validation.
1 parent 8c28617 commit b12a949

File tree

6 files changed

+1816
-2
lines changed

6 files changed

+1816
-2
lines changed

src/ir/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ set(ir_SOURCES
1616
properties.cpp
1717
LocalGraph.cpp
1818
LocalStructuralDominance.cpp
19+
principal-type.cpp
1920
public-type-validator.cpp
2021
ReFinalize.cpp
2122
return-utils.cpp

0 commit comments

Comments
 (0)