summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* First stage of cleeanup in source tree pollution (#2105)Sam Clegg2019-05-167-56/+33
| | | | | | | | | | | Update build-js.sh to output to `out` directory. This is district from the `bin` directory which is used by the cmake build and may or may not live in the source tree. The `out` directory currently always lives in the source tree. As a followup change I hope to additionally move all test outout into this tree. See #2104
* wasm2js: more coercion optimization (#2109)Alon Zakai2019-05-155-19/+209
|
* wasm2js: remove unnecessary labels (#2108)Alon Zakai2019-05-156-15/+43
|
* wasm2js: optimize away unneeded load coercions (#2107)Alon Zakai2019-05-1597-20/+287
|
* wasm2js: Emit table in a way that is friendly to emscripten minification (#2102)Alon Zakai2019-05-133-4/+13
| | | Set it to a local in the asmFunc scope, so that minifiers can easily see it's a simple local value (instead of using it as an upvar from the parameters higher up, which was how the emscripten glue was emitting it).
* wasm2js: precompute bitwise operations (#2101)Alon Zakai2019-05-1316-183/+213
| | | This happens on e.g. an i32 load of a constant offset, then we have constant >> 2.
* Add missing methods for globals to binaryen.js (#2099)Heejin Ahn2019-05-1311-19/+151
| | | | | - Print `globals` array in the tracing mode like other arrays (`functions`, `exports`, `imports`, ...) - Add accessor functions for globals
* Delete WasmBinaryBuilder::mappedGlobals (NFC) (#2098)Heejin Ahn2019-05-122-37/+18
| | | | | | It doesn't seem to be used anywhere and I don't know why the implementation for `WasmBinaryBuilder::getGlobalName` and `WasmBinaryBuilder::getFunctionIndexName` are different. Renamed `getFunctionIndexName` to `getFunctionName` for consistency.
* Generate `dynCall` function for all signature used by `invoke` functions. ↵Sam Clegg2019-05-103-29/+46
| | | | | | | | | (#2095) Previously we were only creating `dynCall` functions for signatures that we have statically in the table. However for dynamic linking we may need to invoke functions that we don't have table entries for (e.g. table entries from a different module).
* Look through fallthrough values in precompute-propagate (#2093)Alon Zakai2019-05-1014-358/+107
| | | This helps quite a lot on wasm2js.
* wasm2js: avoid reinterprets (#2094)Alon Zakai2019-05-1021-326/+689
| | | | | In JS a reinterpret is especially expensive, as we implement it as a write to a temp buffer and a read using another view. This finds places where we load a value from memory, then reinterpret it later - in that case, we can load it using another view, at the cost of another load and another local. This is helpful on things like Box2D, where there are many reinterprets due to the main 2D vector class being an union over two floats/ints, and LLVM likes to do a single i64 load of them.
* Emit process ID in the filenames of byn* tempfiles (#1916)Alon Zakai2019-05-101-1/+10
| | | Helps to avoid trampling each other when binaryen is called multiple times from emcc, for example.
* Add except_ref type (#2081)Heejin Ahn2019-05-0733-9/+157
| | | | This adds except_ref type, which is a part of the exception handling proposal.
* wasm2js: optimize booleans (#2090)Alon Zakai2019-05-074-26/+78
|
* Make sexp instruction parser pass clang-tidy (#2088)Heejin Ahn2019-05-062-396/+396
| | | | | | Our current clang-tidy setting requires {} after ifs. Unlike clang-format, I couldn't find any directives or options that allow us to exclude the generated inc file from clang-tidy. Anyway adding a pair of braces is all it takes to make it pass.
* Fix formatting of some comments (NFC) (#2091)Heejin Ahn2019-05-062-5/+6
| | | A few things that were missing in #2048.
* Update readme with some wasm2js docs and other stuff (#2086)Alon Zakai2019-05-061-42/+58
|
* wasm2js: 'handle' saturating float to int conversions - we don't handle any ↵Alon Zakai2019-05-061-5/+12
| | | | of them precisely anyhow (#2087)
* Don't show stderr output of clang-tidy in Travis CI (#2089)Heejin Ahn2019-05-061-1/+1
| | | | | When we run clang-tidy for the second time to show the error, don't show stderr output because they are not very helpful and all error messages are printed in stdout.
* Add exception handling feature (#2083)Heejin Ahn2019-05-035-2/+19
| | | This only adds the feature and its flag and not the instructions yet.
* wasm2js: optimize loads (#2085)Alon Zakai2019-05-0396-127/+55
| | | | When loading a boolean, prefer the signed heap (which is more commonly used, and may be faster). We never use HEAPU32 (HEAP32 is always enough), just remove it.
* wasm2js: avoid some slow operations when not optimizing (#2082)Alon Zakai2019-05-0320-3751/+4087
| | | Without this PR, wasm2js0.test_printf in emscripten took an extremely long time to compile.
* wasm2js: don't emit obviously unnecessary parens (#2080)Alon Zakai2019-05-0250-8700/+5594
| | | A minifier would probably remove them later anyhow, but they make reading the code annoying and hard.
* wasm2js: ignore implicit traps (#2079)Alon Zakai2019-05-029-60/+41
| | | | | We don't actually try to emit traps for loads, stores, invalid float to ints, etc., so when optimizing we may as well do so under the assumption those traps do not exist. This lets us emit nice code for a select whose operands are loads, for example - otherwise, the values seem to have side effects.
* Optimize mutable globals (#2066)Alon Zakai2019-05-0221-69/+296
| | | | | | | 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
* Add a pass to lower unaligned loads and stores (#2078)Alon Zakai2019-05-0211-148/+936
| | | | | This replaces the wasm2js code that lowered them to pessimistic (1-byte aligned) loads and stores. The new pass will do the optimal thing, keeping 2-byte alignment where possible. This is also nicer as a standalone pass, which has the simple property that after it runs all loads and stores are aligned, instead of some code scattered inside wasm2js.
* Reenable clang-tidy Travis CI hook (#2077)Heejin Ahn2019-05-011-1/+1
| | | Reenable the clang-tidy hook temporarily disabled by #2075.
* wasm2js: don't run coalesce-locals if not optimizing (#2076)Alon Zakai2019-05-0152-16964/+22102
| | | That pass is very slow on unoptimized code (super-linear on the number of locals, which if unoptimized can be massive due to flatten).
* clang-tidy braces changes (#2075)Alon Zakai2019-05-01117-1509/+2946
| | | Applies the changes in #2065, and temprarily disables the hook since it's too slow to run on a change this large. We should re-enable it in a later commit.
* wasm2js: run more optimizations (#2073)Alon Zakai2019-05-0163-22435/+17249
| | | In particular, coalesce-locals is useful even if closure is run later (apparently it finds stuff closure can't).
* Proper errors on unsupported segment types in ↵Alon Zakai2019-05-011-1/+6
| | | | EmscriptenGlueGenerator::separateDataSegments (#2068)
* wasm2js: run full optimizations during the pipeline (#2071)Alon Zakai2019-04-3080-6058/+23001
| | | | | We flatten for the i64 lowering etc. passes, and it is worth optimizing afterwards, to clean up stuff they created. That is run if the user ran wasm2js with an optimization level (like wasm2js -O3). Split the test files to check both optimized and unoptimized code.
* Make clang-tidy check header files too (#2072)Heejin Ahn2019-04-301-0/+1
| | | Without this header file errors would be ignored.
* Add clang-tidy-diff hook to Travis CI (#2060)Heejin Ahn2019-04-302-1/+16
|\ | | | | | | | | This adds clang-tidy hook to Travis CI. This runs clang-tidy to the diff between the current HEAD and master. (It takes very long time to run clang-tidy on the whole repo, so it is not feasible anyway.)
| * Merge branch 'master' into clang_tidy_hookHeejin Ahn2019-04-3019-73968/+457
| |\
| * | Change error message slightlyHeejin Ahn2019-04-301-1/+1
| | |
| * | Remove the clang-tidy error used to trigger Travis CI errorHeejin Ahn2019-04-301-4/+0
| | |
| * | Run clang-tidy-diff.sh only if it existsHeejin Ahn2019-04-291-1/+2
| | |
| * | Change error to a brace-related oneHeejin Ahn2019-04-291-3/+3
| | |
| * | tempHeejin Ahn2019-04-291-1/+4
| | |
| * | FinalHeejin Ahn2019-04-272-7/+1
| | |
| * | WellHeejin Ahn2019-04-271-1/+1
| | |
| * | TestHeejin Ahn2019-04-271-1/+3
| | |
| * | What is clang-tidy version?Heejin Ahn2019-04-271-3/+1
| | |
| * | Why not working??Heejin Ahn2019-04-271-0/+3
| | |
| * | Remove special case handlingHeejin Ahn2019-04-271-10/+0
| | |
| * | Change clang-tidy-error to brace-related oneHeejin Ahn2019-04-271-0/+1
| | |
| * | Add a helpful message when skipping testHeejin Ahn2019-04-271-0/+1
| | |
| * | Add a clang-tidy error again to show how Travis CI worksHeejin Ahn2019-04-272-3/+6
| | |
| * | Wingardium leviosaHeejin Ahn2019-04-271-2/+1
| | |