From a84898c11df3d93fb69365fb274a9bb06d60ed47 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 7 Dec 2020 16:58:43 -0800 Subject: [GC] Add struct.set (#3430) Mostly straightforward after struct.get. This renames the value field in struct.get to ref. I think this makes more sense because struct.set has both a reference to a thing, and a value to set onto that thing. So calling the former ref seems more consistent, giving us ref, value. This mirrors load/store for example where we use ptr, value, and ref is playing the role of ptr here basically. --- src/wasm.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/wasm.h') diff --git a/src/wasm.h b/src/wasm.h index cc390573d..c1b5b4bdf 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -1353,7 +1353,7 @@ public: StructGet(MixedArena& allocator) {} Index index; - Expression* value; + Expression* ref; // Packed fields have a sign. bool signed_ = false; @@ -1364,7 +1364,11 @@ class StructSet : public SpecificExpression { public: StructSet(MixedArena& allocator) {} - void finalize() { WASM_UNREACHABLE("TODO (gc): struct.set"); } + Index index; + Expression* ref; + Expression* value; + + void finalize(); }; class ArrayNew : public SpecificExpression { -- cgit v1.2.3