summaryrefslogtreecommitdiff
path: root/src/wasm-emscripten.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Runtime.stackAlloc should grow down for wasm (#1073)jgravelle-google2017-06-281-8/+4
| | | | | | * Runtime.stackAlloc should grow down for wasm * stackAlloc should align properly; update tests
* S2wasm runtime funcs (#1027)jgravelle-google2017-06-051-14/+127
| | | | | | | | | | | | | | | | * Generate stackSave function in s2wasm * Generate stackAlloc in s2wasm * Generate stackRestore in s2wasm * Update dot_s tests for runtime functions * Add s2wasm check for exporting runtime functions * Fix flake8 for s2wasm.py * Rename wasmBuilder to builder
* Refactor AsmConstWalker to use smaller subfunctions (#923)jgravelle-google2017-02-231-35/+61
| | | | | | * Refactor AsmConstWalker to use smaller subfunctions * Replace cashew::IStrings with Names
* Default Walker subclasses to using Visitor<SubType> (#921)jgravelle-google2017-02-231-1/+1
| | | | Most module walkers use PostWalker<T, Visitor<T>>, let that pattern be expressed as simply PostWalker<T>
* Fully handle EM_ASM in s2wasm (#910)jgravelle-google2017-02-231-3/+22
| | | | | | | | | | | | * Fully handle EM_ASM in s2wasm * Iterate with size_ts, remember to erase from importsMap as well * Fix dot_s test EM_ASM signatures * Move Name out to its own file, support/name.h * Move removeImportsWithSubstring out of Module class
* clean up raw pointer import->functionType, make it a Name like everything ↵Alon Zakai2017-02-171-1/+1
| | | | else (#915)
* Generate global imports separately from emscripten glue (#852)jgravelle-google2016-12-011-11/+0
|
* Handle importing globals in s2wasm (#843)jgravelle-google2016-11-301-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Handle importing globals in s2wasm * Make importedGlobals a set of Names, make Names hashable * Revert "Make importedGlobals a set of Names, make Names hashable" This reverts commit 1d0ca7a5e3839b15ca60593330979864c9c3ed60. * Refactor relocation parsing to handle expressions directly * PR Feedback - Move comment where it belongs - Add comment about ownership to addRelocation - Remove do-nothing parseImportGlobal * Reword "imported globals" to "imported objects" - Flip isObjectImported to isObjectImplemented, for consistency * Add tests for s2wasm globals. Also implement import relocation expression handling * Simplify globals.s test * Fix memory leak of relocation * Use unique_ptr instead of delete in getRelocatableExpression
* Refactor Import::Kind and Export::Kind into an ExternalKind enum class (#725)Alon Zakai2016-10-031-2/+2
|
* In AsmConstWalker, don't assume a segment exists (#697)jgravelle-google2016-09-141-2/+10
| | | | | | | | | | It's possible to generate an EM_ASM call with empty contents (due to ifdefs, for example), and this gets converted to an empty string. AsmConstWalker assumes that by this point any addresses it is pointing to have a corresponding data section, which is reasonable. However in the case of an empty string, we don't create a data section, but just leave that address uninitialized, i.e. set to 0. In the case of AsmConstWalker, a correct thing to do is to emit the empty string as metadata, which becomes an empty emscripten_asm_v call.
* Add flag to s2wasm to export __growWasmMemory function (#696)jgravelle-google2016-09-091-0/+208
* Add a flag to s2wasm to export grow_memory Binaryen's wasm.js-post.js calls back in to wasm in order to grow the linear memory, via a function that asm2wasm exports called __growWasmMemory. This changes exposes that method through s2wasm when invoked with a flag. * Move AsmConstWalker from wasm-linker to wasm-emscripten * Add test for memory growth in s2wasm * Move makeDynCallThunks into wasm-emscripten module * Move mutation in getTableSegment into a separate method * Move emscripten metadata generation into wasm-emscripten Also make AsmConstWalker internal to the wasm-emscripten module, as it's only used for the metadata pass.