diff options
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/wasm.h b/src/wasm.h index 8d1587d42..451039d45 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -743,6 +743,7 @@ public: StringIterMoveId, StringSliceWTFId, StringSliceIterId, + ResumeId, NumExpressionIds }; Id _id; @@ -1995,6 +1996,32 @@ public: void finalize(); }; +class Resume : public SpecificExpression<Expression::ResumeId> { +public: + Resume(MixedArena& allocator) + : handlerTags(allocator), handlerBlocks(allocator), operands(allocator), + sentTypes(allocator) {} + + HeapType contType; + ArenaVector<Name> handlerTags; + ArenaVector<Name> handlerBlocks; + + ExpressionList operands; + Expression* cont; + + // When 'Module*' parameter is given, we populate the 'sentTypes' array, so + // that the types can be accessed in other analyses without accessing the + // module. + void finalize(Module* wasm = nullptr); + + // sentTypes[i] contains the type of the values that will be sent to the block + // handlerBlocks[i] if suspending with tag handlerTags[i]. Not part of the + // instruction's syntax, but stored here for subsequent use. + // This information is cached here in order not to query the module + // every time we query the sent types. + ArenaVector<Type> sentTypes; +}; + // Globals struct Named { |