From 6d62e3c4be466888239a89c2e98713f60074aaea Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Fri, 22 Jan 2021 18:07:46 +0900 Subject: Remove exnref and br_on_exn (#3505) This removes `exnref` type and `br_on_exn` instruction. --- src/wasm/wasm-s-parser.cpp | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'src/wasm/wasm-s-parser.cpp') diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 0356db235..d34698131 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -858,9 +858,6 @@ Type SExpressionWasmBuilder::stringToType(const char* str, if (strncmp(str, "externref", 9) == 0 && (prefix || str[9] == 0)) { return Type::externref; } - if (strncmp(str, "exnref", 6) == 0 && (prefix || str[6] == 0)) { - return Type::exnref; - } if (strncmp(str, "anyref", 6) == 0 && (prefix || str[6] == 0)) { return Type::anyref; } @@ -892,14 +889,9 @@ HeapType SExpressionWasmBuilder::stringToHeapType(const char* str, if (str[1] == 'q' && (prefix || str[2] == 0)) { return HeapType::eq; } - if (str[1] == 'x') { - if (str[2] == 'n' && (prefix || str[3] == 0)) { - return HeapType::exn; - } - if (str[2] == 't' && str[3] == 'e' && str[4] == 'r' && str[5] == 'n' && - (prefix || str[6] == 0)) { - return HeapType::ext; - } + if (str[1] == 'x' && str[2] == 't' && str[3] == 'e' && str[4] == 'r' && + str[5] == 'n' && (prefix || str[6] == 0)) { + return HeapType::ext; } } if (str[0] == 'i') { @@ -2073,25 +2065,6 @@ Expression* SExpressionWasmBuilder::makeRethrow(Element& s) { return ret; } -Expression* SExpressionWasmBuilder::makeBrOnExn(Element& s) { - auto ret = allocator.alloc(); - size_t i = 1; - ret->name = getLabel(*s[i++]); - ret->event = getEventName(*s[i++]); - if (!wasm.getEventOrNull(ret->event)) { - throw ParseException("bad event name", s[1]->line, s[1]->col); - } - ret->exnref = parseExpression(s[i]); - - Event* event = wasm.getEventOrNull(ret->event); - assert(event && "br_on_exn's event must exist"); - // Copy params info into BrOnExn, because it is necessary when BrOnExn is - // refinalized without the module. - ret->sent = event->sig.params; - ret->finalize(); - return ret; -} - Expression* SExpressionWasmBuilder::makeTupleMake(Element& s) { auto ret = allocator.alloc(); parseCallOperands(s, 1, s.size(), ret); -- cgit v1.2.3