summaryrefslogtreecommitdiff
path: root/src/wasm2js.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm2js.h')
-rw-r--r--src/wasm2js.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h
index f15e8f9b7..731bf0a8c 100644
--- a/src/wasm2js.h
+++ b/src/wasm2js.h
@@ -124,7 +124,15 @@ public:
bool emscripten = false;
};
- Wasm2JSBuilder(Flags f, PassOptions options) : flags(f), options(options) {}
+ Wasm2JSBuilder(Flags f, PassOptions options_) : flags(f), options(options_) {
+ // We don't try to model wasm's trapping precisely - if we did, each load
+ // and store would need to do a check. Given that, we can just ignore
+ // implicit traps like those when optimizing. (When not optimizing, it's
+ // nice to see codegen that matches wasm more precisely.)
+ if (options.optimizeLevel > 0) {
+ options.ignoreImplicitTraps = true;
+ }
+ }
Ref processWasm(Module* wasm, Name funcName = ASM_FUNC);
Ref processFunction(Module* wasm, Function* func, bool standalone = false);