diff options
Diffstat (limited to 'src/wasm-stack.h')
-rw-r--r-- | src/wasm-stack.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/wasm-stack.h b/src/wasm-stack.h index fbd28b0d5..91c0c5383 100644 --- a/src/wasm-stack.h +++ b/src/wasm-stack.h @@ -128,6 +128,9 @@ public: void visitSelect(Select* curr); void visitReturn(Return* curr); void visitHost(Host* curr); + void visitRefNull(RefNull* curr); + void visitRefIsNull(RefIsNull* curr); + void visitRefFunc(RefFunc* curr); void visitTry(Try* curr); void visitThrow(Throw* curr); void visitRethrow(Rethrow* curr); @@ -207,6 +210,9 @@ public: void visitSelect(Select* curr); void visitReturn(Return* curr); void visitHost(Host* curr); + void visitRefNull(RefNull* curr); + void visitRefIsNull(RefIsNull* curr); + void visitRefFunc(RefFunc* curr); void visitTry(Try* curr); void visitThrow(Throw* curr); void visitRethrow(Rethrow* curr); @@ -698,6 +704,30 @@ void BinaryenIRWriter<SubType>::visitHost(Host* curr) { emit(curr); } +template<typename SubType> +void BinaryenIRWriter<SubType>::visitRefNull(RefNull* curr) { + emit(curr); +} + +template<typename SubType> +void BinaryenIRWriter<SubType>::visitRefIsNull(RefIsNull* curr) { + visit(curr->value); + if (curr->type == Type::unreachable) { + emitUnreachable(); + return; + } + emit(curr); +} + +template<typename SubType> +void BinaryenIRWriter<SubType>::visitRefFunc(RefFunc* curr) { + if (curr->type == Type::unreachable) { + emitUnreachable(); + return; + } + emit(curr); +} + template<typename SubType> void BinaryenIRWriter<SubType>::visitTry(Try* curr) { emit(curr); visitPossibleBlockContents(curr->body); |