diff options
author | Daniel Wirtz <dcode@dcode.io> | 2020-09-24 12:02:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 12:02:09 +0200 |
commit | e9e1b2ff00aeb05aaeb57af3811add267dc25323 (patch) | |
tree | 4e19032813858b2e650f0cda46fe9fa227aa0a7f /src/wasm-binary.h | |
parent | a42423fafa8cf731c69303ddc0acbe80c890e0ab (diff) | |
download | binaryen-e9e1b2ff00aeb05aaeb57af3811add267dc25323.tar.gz binaryen-e9e1b2ff00aeb05aaeb57af3811add267dc25323.tar.bz2 binaryen-e9e1b2ff00aeb05aaeb57af3811add267dc25323.zip |
GC: Add i31 instructions (#3154)
Adds the `i31.new` and `i31.get_s/u` instructions for creating and working with `i31ref` typed values. Does not include fuzzer integration just yet because the fuzzer expects that trivial values it creates are suitable in global initializers, which is not the case for trivial `i31ref` expressions.
Diffstat (limited to 'src/wasm-binary.h')
-rw-r--r-- | src/wasm-binary.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index df800d470..9ac5664d3 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -599,6 +599,7 @@ enum ASTNodes { // prefixes + GCPrefix = 0xfb, MiscPrefix = 0xfc, SIMDPrefix = 0xfd, AtomicPrefix = 0xfe, @@ -937,7 +938,13 @@ enum ASTNodes { Catch = 0x07, Throw = 0x08, Rethrow = 0x09, - BrOnExn = 0x0a + BrOnExn = 0x0a, + + // gc opcodes + + I31New = 0x20, + I31GetS = 0x21, + I31GetU = 0x22 }; enum MemoryAccess { @@ -1452,6 +1459,8 @@ public: bool maybeVisitDataDrop(Expression*& out, uint32_t code); bool maybeVisitMemoryCopy(Expression*& out, uint32_t code); bool maybeVisitMemoryFill(Expression*& out, uint32_t code); + bool maybeVisitI31New(Expression*& out, uint32_t code); + bool maybeVisitI31Get(Expression*& out, uint32_t code); void visitSelect(Select* curr, uint8_t code); void visitReturn(Return* curr); void visitMemorySize(MemorySize* curr); |