From b394fcc887dbb2e02b5ff5b307004e4dc7ec2baf Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 2 May 2019 13:09:18 -0700 Subject: Optimize mutable globals (#2066) If a global is marked mutable but not assigned to, make it immutable. If an immutable global is a copy of another, use the original, so we can remove the duplicates. Fixes #2011 --- src/wasm/wasm-s-parser.cpp | 4 ---- 1 file changed, 4 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 cd9eb690a..a869aa08a 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -1813,10 +1813,6 @@ void SExpressionWasmBuilder::parseExport(Element& s) { ex->kind = ExternalKind::Table; } else if (inner[0]->str() == GLOBAL) { ex->kind = ExternalKind::Global; - if (wasm.getGlobalOrNull(ex->value) && - wasm.getGlobal(ex->value)->mutable_) { - throw ParseException("cannot export a mutable global", s.line, s.col); - } } else { throw ParseException("invalid export"); } -- cgit v1.2.3