Delete HeapMemory variant of WasmLayout, just treat pointers as Primitive

When I created this (at the very beginning of the Wasm backend),
I didn't really have a clear reason for it. I just thought it might end up
making sense treat heap pointers differently from numbers, somehow.

But the semantic differences between pointers and other numbers is not relevant
to WasmLayout. The semantics are clear from where the Symbol appears in the IR.

Also we were storing heap pointers in locals, for no real reason.
And the fact that it's *different* meant a lot of new cases in match expressions,
to do the exact same thing as Primitives but with a pointless difference.

Until now, we haven't really used this variant in any of our tests.
But the refcount pointer needed it... and everything broke!
This commit is contained in:
Brian Carroll 2021-11-30 09:13:38 +00:00
parent 3581c7f5be
commit 079a8311ec
3 changed files with 2 additions and 21 deletions

View file

@ -76,7 +76,6 @@ pub fn decode_low_level<'a>(
StackMemoryFormat::Float128 => return NotImplemented,
StackMemoryFormat::Decimal => return BuiltinCall(bitcode::DEC_ADD_WITH_OVERFLOW),
},
WasmLayout::HeapMemory { .. } => return NotImplemented,
},
NumAddWrap => match ret_layout.arg_types(CallConv::Zig)[0] {
I32 => {