diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-06-30 16:45:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-30 16:45:00 -0700 |
commit | 44290db4fc014c8e032fb61f95ca9805d2ce57bc (patch) | |
tree | 67936dd5ef8d3d2f0218af91bf3b45b8e2d32983 /src/asm2wasm.h | |
parent | b1975e28f0f188191e0588c5ad2f6a4a774128c6 (diff) | |
download | binaryen-44290db4fc014c8e032fb61f95ca9805d2ce57bc.tar.gz binaryen-44290db4fc014c8e032fb61f95ca9805d2ce57bc.tar.bz2 binaryen-44290db4fc014c8e032fb61f95ca9805d2ce57bc.zip |
parallelize asm2wasm fixups (#614)
Diffstat (limited to 'src/asm2wasm.h')
-rw-r--r-- | src/asm2wasm.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 593943654..fd250694b 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -744,9 +744,9 @@ void Asm2WasmBuilder::processAsm(Ref ast) { // Finalize indirect calls and import calls struct FinalizeCalls : public WalkerPass<PostWalker<FinalizeCalls, Visitor<FinalizeCalls>>> { - //bool isFunctionParallel() override { return true; } + bool isFunctionParallel() override { return true; } - //Pass* create() override { return new FinalizeCalls(parent); } + Pass* create() override { return new FinalizeCalls(parent); } Asm2WasmBuilder* parent; @@ -754,8 +754,9 @@ void Asm2WasmBuilder::processAsm(Ref ast) { void visitCallImport(CallImport* curr) { // fill out call_import - add extra params as needed. asm tolerates ffi overloading, wasm does not - auto type = parent->importedFunctionTypes[curr->target].get(); - if (!type) return; // one of our fake imports for callIndirect fixups + auto iter = parent->importedFunctionTypes.find(curr->target); + if (iter == parent->importedFunctionTypes.end()) return; // one of our fake imports for callIndirect fixups + auto type = iter->second.get(); for (size_t i = curr->operands.size(); i < type->params.size(); i++) { auto val = parent->allocator.alloc<Const>(); val->type = val->value.type = type->params[i]; |