diff options
author | Alon Zakai <azakai@google.com> | 2021-01-26 21:09:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 13:09:31 -0800 |
commit | 5e57a13614c56f959faab675d6bcabbd629ec562 (patch) | |
tree | 3c86a2741cffa6da009741506eed4513acc60bf1 /src/wasm/wasm-stack.cpp | |
parent | 89164cdf1403a21a3d79ada0f0cf529d526c9de6 (diff) | |
download | binaryen-5e57a13614c56f959faab675d6bcabbd629ec562.tar.gz binaryen-5e57a13614c56f959faab675d6bcabbd629ec562.tar.bz2 binaryen-5e57a13614c56f959faab675d6bcabbd629ec562.zip |
[GC] RefIsNull => RefIs. (#3516)
This internal refactoring prepares us for ref.is_func/data/i31, by renaming
the node and adding an "op" field. For now that field must always be "Null"
which means it is a ref.is_null.
This adjusts the C API to match the new IR shape. The high-level JS API
is unchanged.
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r-- | src/wasm/wasm-stack.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp index fae9da140..7b902ad67 100644 --- a/src/wasm/wasm-stack.cpp +++ b/src/wasm/wasm-stack.cpp @@ -1864,8 +1864,14 @@ void BinaryInstWriter::visitRefNull(RefNull* curr) { parent.writeHeapType(curr->type.getHeapType()); } -void BinaryInstWriter::visitRefIsNull(RefIsNull* curr) { - o << int8_t(BinaryConsts::RefIsNull); +void BinaryInstWriter::visitRefIs(RefIs* curr) { + switch (curr->op) { + case RefIsNull: + o << int8_t(BinaryConsts::RefIsNull); + break; + default: + WASM_UNREACHABLE("unimplemented ref.is_*"); + } } void BinaryInstWriter::visitRefFunc(RefFunc* curr) { |