summaryrefslogtreecommitdiff
path: root/src/wasm
Commit message (Collapse)AuthorAgeFilesLines
* s-expr parsing: handle empty switchAlon Zakai (kripken)2017-06-011-0/+1
|
* harden s-expr parsingAlon Zakai (kripken)2017-06-011-25/+29
|
* handle the wrong number of functions being provided in binary formatAlon Zakai (kripken)2017-06-011-0/+8
|
* Exporting/importing debug location information from .wast/.asm.js/.s formats ↵Yury Delendik2017-06-014-7/+273
| | | | | | | | (#1017) * Extends wasm-as, wasm-dis and s2wasm to consume debug locations. * Exports source map from asm2wasm
* afl-fuzz bug fixes (#1018)Alon Zakai2017-05-201-0/+4
| | | | | | | | * values cannot flow through an if without an else, they never return a value * check pass tests in pass-debug mode too * add missing finalization in binary reading
* Validate finalization (#1014)Alon Zakai2017-05-181-0/+2
| | | | | | | * 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.
* Unreachable typing fixes (#1004)Alon Zakai2017-05-093-2/+77
| | | | | | | | | | | | * fix type of drop, set_local, set_global, load, etc: when operand is unreachable, so is the node itself * support binary tests properly in test/passes * fix unreachable typing of blocks with no name and an unreachable child * fix continue emitting in asm2wasm * properly handle emitting of unreachable load
* text format parsing fixes (#1002)Alon Zakai2017-05-081-4/+5
|
* optimize duplication checks in binary format reading (#995)Alon Zakai2017-05-041-7/+5
|
* make function name duplicate testing handle the case of just some functions ↵Alon Zakai2017-05-031-5/+8
| | | | being named, and colliding with others' original names (#994)
* fix unreachable typing: for all nodes, if they are not reached - e.g., a ↵Alon Zakai (kripken)2017-05-021-4/+25
| | | | binary with either side unreachable - then they are unreachable. this makes our usage of the unreachable type consistent
* improve dce to handle more cases of nested unreachable code (#989)Alon Zakai2017-05-021-1/+6
| | | | | | | | | | * improve dce to handle more cases of nested unreachable code, in particular, when the child is unreachable in type but not an actual Unreachable node, e.g. if it's a br. in that case, we just need to verify that the br is not to us where we are a block or loop * handle unreachable switch conditions in dce * handle dce of br condition which is unreachable, and host arguments * handle dce of block i32 etc. which is actually unreachable
* Parsing fixes (#990)Alon Zakai2017-05-022-36/+130
| | | | | | | | | | * properly catch a bunch of possible parse errors, found by afl-fuzz * clean up wasm-interpreter, use WASM_UNREACHABLE instead of abort * detect duplicate names in function names section * detect duplicate export names
* wasm-merge tool (#919)Alon Zakai2017-04-171-0/+2
| | | | wasm-merge tool: combines two wasm files into a larger one, handling collisions, and aware of the dynamic linking conventions. it does not do full static linking, but may eventually.
* Extensible name section (#933)pipcet2017-04-131-19/+43
| | | | | | | | | | | | | See https://github.com/WebAssembly/binaryen/issues/914. * extensible name section support: read function names, too * c-api-unused-mem.txt: change expected size to match new name section * * check subsection size matches * print warning for unknown name subsections (including the local section)
* fix emitting of unreachable ifs (#944)Alon Zakai2017-03-141-13/+11
|
* finalize interim ifs in relooper, and other if handling issues (#940)Alon Zakai2017-03-131-1/+1
|
* Wasm h to cpp (#926)jgravelle-google2017-03-106-16/+1126
| | | | | | | | | | | | | | | | | | | | | | | | * Move WasmType function implementations to wasm.cpp * Move Literal methods to wasm.cpp * Reorder wasm.cpp shared constants back to top * Move expression functions to wasm.cpp * Finish moving things to wasm.cpp * Split out Literal into its own .h/.cpp. Also factor out common wasm-type module * Remove unneeded/transitive includes from wasm.h * Add comment to try/check methods * Rename tryX/checkX methods to getXOrNull * Add missing include that should fix appveyor build breakage * More appveyor
* 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>
* read unknown users sections as binary data stored on the Module (#918)Alon Zakai2017-02-211-3/+13
|
* clean up raw pointer import->functionType, make it a Name like everything ↵Alon Zakai2017-02-172-8/+8
| | | | else (#915)
* Fix emitting of unreachable block/if/loop (#911)Alon Zakai2017-02-162-9/+62
| | | | | | | | | | | | | | | | | | | | | | * an unreachable block is one with an unreachable child, plus no breaks * document new difference between binaryen IR and wasm * fix relooper missing finalize * add a bunch of tests * don't assume that test/*.wast files print to themselves exactly; print to from.wast. this allows wast tests with comments in them * emit unreachable blocks as (block .. unreachable) unreachable * if without else and unreachable ifTrue is still not unreachable, it should be none * update wasm.js * cleanups * empty blocks have none type
* only read first 4 bytes to check if a file is a wasm binary (#894)Alon Zakai2017-02-021-3/+8
|
* Read/Write Abstraction (#889)Alon Zakai2017-01-262-0/+87
| | | | | * Added ModuleReader/Writer classes that support text and binary I/O * Use them in wasm-opt and asm2wasm
* Merge pull request #865 from WebAssembly/fix-abAlon Zakai2017-01-101-6/+24
|\ | | | | Fix AngryBots parsing
| * handle a binary that breaks to returnAlon Zakai (kripken)2017-01-041-5/+22
| |
| * handle a module which has no globals at allAlon Zakai (kripken)2017-01-041-1/+2
| |
* | Merge pull request #871 from WebAssembly/fix-c-api-unused-memAlon Zakai2017-01-051-4/+5
|\ \ | |/ |/| Mark memory as existing when it is created in the C API
| * ensure exports are added deterministically from binariesAlon Zakai (kripken)2017-01-041-4/+5
| |
* | Handle stacky code (#868)Alon Zakai2017-01-041-21/+47
|/ | | | * handle stacky code in binaries, using a block+local
* Merge pull request #859 from WebAssembly/linkingAlon Zakai2016-12-272-2/+2
|\ | | | | Dynamic linking
| * fix the order of emitting the start sectionAlon Zakai2016-12-071-1/+1
| |
| * fix table import size when no maximum is providedAlon Zakai2016-12-071-1/+1
| |
* | ignore unknown user sections, fixes #857 (#858)Alon Zakai2016-12-071-7/+12
|/
* emit entries in the Names section for imports as well, as was recently ↵Alon Zakai2016-11-091-3/+35
| | | | changed in the spec
* add a --symbolmap option to wasm-as, which emits a side file with the name ↵Alon Zakai2016-11-091-0/+13
| | | | mapping (similar to Names section, but external)
* Binary 0xd changes (#803)Derek Schuff2016-10-262-21/+29
| | | | | | | | | | | | | | | | | | | | | * Renumber opcodes for 0xd * Unified type encoding * Add reserved flags fields to host instructions and call_indirect * Rename flags->reserved * Fix line numbers in wast parser Also don't throw if the memory is defined in the same Element as the export of memory (the validity is checked later anyway). * Skip spec binary.wast The spec testsuite is still on 0xc, so 0xd doesn't match. In order to update to 0xd we need to implement some additional functionality for the import test, namely (register)
* fix binary format regression from 9afa80951a3e9e59d5348780370a8b67d829ded1 - ↵Alon Zakai2016-10-221-18/+10
| | | | we must handle float literals carefully to not change their sign bit on some platforms/compilers, and that commit made relevant functions non-inline which hit a bug (#801)
* Move wasm binary reader and writer from the header file into libwasm (#797)Derek Schuff2016-10-202-0/+1895
|
* Move wasm.cpp and wasm-s-parser into a library (#796)Derek Schuff2016-10-203-0/+1979
Also moves the bulk of the code in wasm-s-parser into a cpp file. Allows namespace and #include cleanups, and improves j4 compile time by 20%. Should also make any future parser changes easier and more localized.