diff options
author | Alon Zakai <azakai@google.com> | 2022-06-29 16:05:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 16:05:10 -0700 |
commit | 19f4db6ef5263a578baef7e64bf9c9169bb771e6 (patch) | |
tree | d9608e8483415332b744701a714ec83d8e8009fb /src/wasm-binary.h | |
parent | d252c3e9e5dee98150c5ac625b6deb0e95139ede (diff) | |
download | binaryen-19f4db6ef5263a578baef7e64bf9c9169bb771e6.tar.gz binaryen-19f4db6ef5263a578baef7e64bf9c9169bb771e6.tar.bz2 binaryen-19f4db6ef5263a578baef7e64bf9c9169bb771e6.zip |
[Strings] Add string.new* instructions (#4761)
This is the first instruction from the Strings proposal.
This includes everything but interpreter support.
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 3b3fa30f6..a5c6d0a46 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -1135,6 +1135,8 @@ enum ASTNodes { BrOnNonFunc = 0x63, BrOnNonData = 0x64, BrOnNonI31 = 0x65, + StringNewWTF8 = 0x80, + StringNewWTF16 = 0x81, }; enum MemoryAccess { @@ -1145,6 +1147,12 @@ enum MemoryAccess { enum MemoryFlags { HasMaximum = 1 << 0, IsShared = 1 << 1, Is64 = 1 << 2 }; +enum StringNewPolicy { + UTF8 = 0x00, + WTF8 = 0x01, + Replace = 0x02, +}; + enum FeaturePrefix { FeatureUsed = '+', FeatureRequired = '=', @@ -1700,6 +1708,7 @@ public: bool maybeVisitArraySet(Expression*& out, uint32_t code); bool maybeVisitArrayLen(Expression*& out, uint32_t code); bool maybeVisitArrayCopy(Expression*& out, uint32_t code); + bool maybeVisitStringNew(Expression*& out, uint32_t code); void visitSelect(Select* curr, uint8_t code); void visitReturn(Return* curr); void visitMemorySize(MemorySize* curr); @@ -1721,7 +1730,7 @@ public: // Let is lowered into a block. void visitLet(Block* curr); - void throwError(std::string text); + [[noreturn]] void throwError(std::string text); // Struct/Array instructions have an unnecessary heap type that is just for // validation (except for the case of unreachability, but that's not a problem |