diff options
author | Ben Smith <binjimin@gmail.com> | 2017-09-20 09:49:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-20 09:49:58 -0700 |
commit | 447e6f752b157d0a9951525a045d862e62d9b88c (patch) | |
tree | 2484ab5841f35fa50127f6dd83460f943a202fb6 /src/type-checker.h | |
parent | c71918746e06d2afffc46b3da5e3f2c024cc4b92 (diff) | |
download | wabt-447e6f752b157d0a9951525a045d862e62d9b88c.tar.gz wabt-447e6f752b157d0a9951525a045d862e62d9b88c.tar.bz2 wabt-447e6f752b157d0a9951525a045d862e62d9b88c.zip |
Add Atomic instructions (#633)
This adds support for all atomic instructions, enabled via the
`--enable-threads` flag.
It supports all tools: parsing text, decoding binary, validation, and
interpreting. It does not currently ensure that the memory is marked as
shared; that flag is not supported in wabt yet.
Diffstat (limited to 'src/type-checker.h')
-rw-r--r-- | src/type-checker.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/type-checker.h b/src/type-checker.h index d7216cd8..6f1257ce 100644 --- a/src/type-checker.h +++ b/src/type-checker.h @@ -51,6 +51,10 @@ class TypeChecker { Result GetLabel(Index depth, Label** out_label); Result BeginFunction(const TypeVector* sig); + Result OnAtomicLoad(Opcode); + Result OnAtomicStore(Opcode); + Result OnAtomicRmw(Opcode); + Result OnAtomicRmwCmpxchg(Opcode); Result OnBinary(Opcode); Result OnBlock(const TypeVector* sig); Result OnBr(Index depth); @@ -113,9 +117,14 @@ class TypeChecker { const char* desc); Result PopAndCheck1Type(Type expected, const char* desc); Result PopAndCheck2Types(Type expected1, Type expected2, const char* desc); + Result PopAndCheck3Types(Type expected1, + Type expected2, + Type expected3, + const char* desc); Result PopAndCheck2TypesAreEqual(Type* out_type, const char* desc); Result CheckOpcode1(Opcode opcode); Result CheckOpcode2(Opcode opcode); + Result CheckOpcode3(Opcode opcode); Result OnEnd(Label* label, const char* sig_desc, const char* end_desc); ErrorCallback error_callback_; |