diff options
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/wasm.h b/src/wasm.h index 3ac89b91d..d4441259e 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -479,6 +479,10 @@ public: MemoryFillId, PushId, PopId, + TryId, + ThrowId, + RethrowId, + BrOnExnId, NumExpressionIds }; Id _id; @@ -1003,6 +1007,52 @@ public: Pop(MixedArena& allocator) {} }; +class Try : public SpecificExpression<Expression::TryId> { +public: + Try(MixedArena& allocator) {} + + Expression* body; + Expression* catchBody; + + void finalize(); + void finalize(Type type_); +}; + +class Throw : public SpecificExpression<Expression::ThrowId> { +public: + Throw(MixedArena& allocator) : operands(allocator) {} + + Name event; + ExpressionList operands; + + void finalize(); +}; + +class Rethrow : public SpecificExpression<Expression::RethrowId> { +public: + Rethrow(MixedArena& allocator) {} + + Expression* exnref; + + void finalize(); +}; + +class BrOnExn : public SpecificExpression<Expression::BrOnExnId> { +public: + BrOnExn() { type = unreachable; } + BrOnExn(MixedArena& allocator) : BrOnExn() {} + + Name name; + Name event; + Expression* exnref; + // This is duplicate info of param types stored in Event, but this is required + // for us to know the type of the value sent to the target block. + std::vector<Type> eventParams; + + void finalize(); + Type getSingleSentType(); +}; + // Globals struct Importable { |