Commit d2ac49a
Add CpsBoxing pass for inserting BoxOp/UnboxOp at type boundaries
Add a new CPS transformation pass that inserts explicit Box/Unbox
operations at function boundaries for unboxed primitive types
(int32, int64, word32, word64, real, char, char16, char32, bool).
This is preparation for the WasmGC backend where all polymorphic
positions must use a uniform boxed representation.
The pass:
- Converts unboxed function params to BoxedType with UnboxOp at entry
- Boxes unboxed values at App/AppCont call sites with BoxOp
- Transforms resultTy for unboxed return types to BoxedType
- Eliminates typeOnly abstractions (like erase-poly)
- Maintains a type environment for type variable tracking
- Transforms ExnTag payloadTy and ESImportDec types via goTy
Currently commented out in the pipeline as the WasmGC backend is
not yet implemented.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 93c56e4 commit d2ac49a
4 files changed
+555
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
0 commit comments