summaryrefslogtreecommitdiff
path: root/src/ast
Commit message (Collapse)AuthorAgeFilesLines
* Address review feedback for #1014 (#1016)Alon Zakai2017-05-184-14/+60
| | | | | | * address review feedback for #1014
* Validate finalization (#1014)Alon Zakai2017-05-184-0/+418
| | | | | | | * validate that types are properly finalized, when in pass-debug mode (BINARYEN_PASS_DEBUG env var): check after each pass is run that the type of each node is equal to the proper type (when finalizing it, i.e., fully recomputing the type). * fix many fuzz bugs found by that. * in particular, fix dce bugs with type changes not being fully updated during code removal. add a new TypeUpdater helper class that lets a pass update types efficiently, by the helper tracking deps between blocks and branches etc., and updating/propagating type changes only as necessary.
* ctor-eval fixes (#996)Alon Zakai2017-05-051-0/+55
| | | | | | | | * fix wasm-ctor-eval, we need to look for the STACKTOP etc. imports, they may not be named, if this build is not with -g * pack memory after ctor evalling, since we merge it up which is less efficient * do some useful opts after ctor-evalling, to clean things up
* ctor evaller (#982)Alon Zakai2017-04-281-0/+56
| | | | | Add wasm-ctor-eval, which evaluates functions at compile time - typically static constructor functions - and applies their effects into memory, saving work at startup. If we encounter something we can't evaluate at compile time in our interpreter, stop there. This is similar to ctor_evaller.py in emscripten (which was for asm.js).
* optimize pow (#934)Alon Zakai2017-03-101-0/+47
| | | | | | * optimize pow(x,2) => x*x * optimize pow(x, 0.5) => sqrt(x)
* Local CSE (#930)Alon Zakai2017-03-081-0/+59
| | | Simple local common subexpression elimination. Useful mostly to reduce code size (as VMs do GVN etc.). Enabled by default in -Oz.
* 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>
* fix a sign/unsigned compare compiler warningAlon Zakai2017-02-161-2/+2
|
* refactor sign/zero extension code into nice headers, and prepare ↵Alon Zakai2017-02-162-0/+124
| | | | PickLoadSigns pass
* Make ast_utils into a library (#892)Derek Schuff2017-01-313-0/+652
| | | | Split ExpressionAnalyzer and ExpressionManipulator into cpp files, and turn their giant template functions into simple functions which take a callback. More organization, fewer mammoth headers, makes the build a few seconds faster, and the binaries a couple MB smaller.
* refactor get_local counting out of simplify-locals (#812)Alon Zakai2016-10-281-0/+50
|
* Conditionalize boolean operations based on cost (#805)Alon Zakai2016-10-261-0/+249
| | | When we have expensive | expensive, and both are boolean, then we can execute one of them conditionally if it doesn't have side effects.
* Optimize out bool & 1 (#804)Alon Zakai2016-10-251-0/+60
* asm.js corrections to unit.asm.js test * optimize out bool&1