summaryrefslogtreecommitdiff
path: root/src/emscripten-optimizer/optimizer.h
Commit message (Collapse)AuthorAgeFilesLines
* wasm2js: Add basic reference operations (#6648)Alon Zakai2024-06-101-0/+2
| | | This adds ref.eq, ref.null, ref.is_null, ref.func.
* Fix warnings from -Wheader-hygiene and -Wimplicit-const-int-float-conversion ↵Martin Kustermann2022-11-171-4/+3
| | | | | | | | | (#5273) When `-Wheader-hygiene` is enabled, C compiler will warn when using namespace directive in global context in header file. When `-Wimplicit-const-int-float-conversion` is enabled C compiler will warn on implicit integer to double conversions that change values.
* Make `Name` a pointer, length pair (#5122)Thomas Lively2022-10-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | With the goal of supporting null characters (i.e. zero bytes) in strings. Rewrite the underlying interned `IString` to store a `std::string_view` rather than a `const char*`, reduce the number of map lookups necessary to intern a string, and present a more immutable interface. Most importantly, replace the `c_str()` method that returned a `const char*` with a `toString()` method that returns a `std::string`. This new method can correctly handle strings containing null characters. A `const char*` can still be had by calling `data()` on the `std::string_view`, although this usage should be discouraged. This change is NFC in spirit, although not in practice. It does not intend to support any particular new functionality, but it is probably now possible to use strings containing null characters in at least some cases. At least one parser bug is also incidentally fixed. Follow-on PRs will explicitly support and test strings containing nulls for particular use cases. The C API still uses `const char*` to represent strings. As strings containing nulls become better supported by the rest of Binaryen, this will no longer be sufficient. Updating the C and JS APIs to use pointer, length pairs is left as future work.
* [Refactoring] Cleanup asm2wasm. Use JS instead ASM prefix where possible. ↵Max Graey2021-09-011-117/+29
| | | | NFC (#4090)
* clang-tidy braces changes (#2075)Alon Zakai2019-05-011-1/+2
| | | 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.
* Apply format changes from #2048 (#2059)Alon Zakai2019-04-261-22/+25
| | | Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048
* wasm2js: start to optionally optimize the JS (#2046)Alon Zakai2019-04-241-11/+0
| | | Removes redundant | 0s and similar things. (Apparently closure compiler doesn't do that, so makes sense to do here.)
* Code style improvements (#1868)Alon Zakai2019-01-151-2/+2
| | | | * Use modern T p = v; notation to initialize class fields * Use modern X() = default; notation for empty class constructors
* refactor asm.js ast to not use STAT nodes - we don't need to print the ↵Alon Zakai (kripken)2017-01-311-5/+0
| | | | asm.js anyhow, so knowing where ;s are is unnecessary bloat
* asm2wasm i64 support (#723)Alon Zakai2016-09-301-1/+2
| | | | | | | | | | | | * support i64 intrinsics from fastcomp, adding --wasm-only flag * refactor callImport logic in asm2wasm to avoid recomputing wasm types again * legalize illegal i64 params in exports and imports * do safe i64 binary ops depending on precision * fix addVar, only assert on names if we are using a name
* Add Travis builds with sanitizersJF Bastien2016-01-101-4/+0
| | | | | | | | | | | | | | | | This triggers 5 independent build / test runs: - clang, no sanitizer; - clang, UB sanitizer; - clang, address sanitizer (disabled for now); - clang, thread sanitizer (disabled for now); - GCC. Enabling UBSan led to these changes: - Fix a bunch of undefined behavior throughout the code base. - Fix some tests that relied on that undefined behavior. - Make some of the tests easier to debug by printing their command line. - Add ubsan blacklist to work around libstdc++ bug. - Example testcase also needs sanitizer because libsupport.a uses it.
* Fix / uniformize include guardsJF Bastien2015-12-221-3/+3
|
* Fix the license headersJF Bastien2015-12-211-1/+15
| | | | This applies Apache 2.0 properly (as far as our lawyers have told me). We can do this early since all of the code was written by Alon Zakai.
* add makeSigning methodAlon Zakai2015-12-051-0/+2
|
* refactoring, and wasm2asm arags and localsAlon Zakai2015-12-011-0/+3
|
* be very careful when converting doubles to ints in asm2wasmAlon Zakai2015-11-281-1/+1
|
* add deStat from emscripten optimizerAlon Zakai2015-11-241-0/+5
|
* detect minified fround in detectTypeAlon Zakai2015-11-201-1/+1
|
* detect minified froundAlon Zakai2015-11-201-1/+1
|
* port detectSign from emscripten asm optimizer, and use itAlon Zakai2015-11-171-0/+9
|
* restructure code, put emscripten-optimizer stuff in its own dirAlon Zakai2015-11-091-0/+127