summaryrefslogtreecommitdiff
path: root/src/wasm-interpreter.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-12-08 18:55:20 -0800
committerGitHub <noreply@github.com>2020-12-08 18:55:20 -0800
commit63a042e3a94df7ba3a5c9dde03990a9813fdc366 (patch)
tree50c05727ce20615f4d0c0206e62dcd56c246766f /src/wasm-interpreter.h
parent2a0059dec2fe01dcf1358e0120c32aadd2d765b6 (diff)
downloadbinaryen-63a042e3a94df7ba3a5c9dde03990a9813fdc366.tar.gz
binaryen-63a042e3a94df7ba3a5c9dde03990a9813fdc366.tar.bz2
binaryen-63a042e3a94df7ba3a5c9dde03990a9813fdc366.zip
[GC] Add basic RTT support (#3432)
This adds rtt.canon and rtt.sub together with RTT type support that is necessary for them. Together this lets us test roundtripping the instructions and types. Also fixes a missing traversal over globals in collectHeapTypes, which the example from the GC docs requires, as the RTTs are in globals there. This does not yet add full interpreter support and other things. It disables initial contents on GC in the fuzzer, to avoid the fuzzer breaking. Renames the binary ID for exnref, which is being removed from the spec, and which overlaps with the binary ID for rtt.
Diffstat (limited to 'src/wasm-interpreter.h')
-rw-r--r--src/wasm-interpreter.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index a22bb6e54..65a4417c8 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -1388,13 +1388,13 @@ public:
NOTE_ENTER("BrOnCast");
WASM_UNREACHABLE("TODO (gc): br_on_cast");
}
- Flow visitRttCanon(RttCanon* curr) {
- NOTE_ENTER("RttCanon");
- WASM_UNREACHABLE("TODO (gc): rtt.canon");
- }
+ Flow visitRttCanon(RttCanon* curr) { return Literal(curr->type); }
Flow visitRttSub(RttSub* curr) {
- NOTE_ENTER("RttSub");
- WASM_UNREACHABLE("TODO (gc): rtt.sub");
+ Flow parent = this->visit(curr->parent);
+ if (parent.breaking()) {
+ return parent;
+ }
+ return Literal(curr->type);
}
Flow visitStructNew(StructNew* curr) {
NOTE_ENTER("StructNew");