From 127f9688cc26ab362dabadac5494af23cd78ac8b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 27 Apr 2016 10:43:21 -0700 Subject: allocate only expressions in arenas - functions, imports, exports, function types, can more simply be held by unique_ptrs on the owning module. this avoids need to coordinate arena allocation for their elements, and only the far more plentiful expression nodes are a perf factor anyhow --- src/asmjs/asm_v_wasm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/asmjs/asm_v_wasm.cpp') diff --git a/src/asmjs/asm_v_wasm.cpp b/src/asmjs/asm_v_wasm.cpp index 3e7e0241e..14a7fbdae 100644 --- a/src/asmjs/asm_v_wasm.cpp +++ b/src/asmjs/asm_v_wasm.cpp @@ -82,8 +82,8 @@ WasmType sigToWasmType(char sig) { } } -FunctionType* sigToFunctionType(std::string sig, MixedArena& allocator) { - auto ret = allocator.alloc(); +FunctionType* sigToFunctionType(std::string sig) { + auto ret = new FunctionType; ret->result = sigToWasmType(sig[0]); for (size_t i = 1; i < sig.size(); i++) { ret->params.push_back(sigToWasmType(sig[i])); @@ -97,7 +97,7 @@ FunctionType* ensureFunctionType(std::string sig, Module* wasm) { return wasm->getFunctionType(name); } // add new type - auto type = wasm->allocator.alloc(); + auto type = new FunctionType; type->name = name; type->result = sigToWasmType(sig[0]); for (size_t i = 1; i < sig.size(); i++) { -- cgit v1.2.3