summaryrefslogtreecommitdiff
path: root/src/shared-constants.h
Commit message (Collapse)AuthorAgeFilesLines
* Wasi followups to #2323 (#2329)Alon Zakai2019-09-031-2/+0
| | | | | Remove wasi, as only wasi_unstable makes sense. Also remove shared constant for wasi as we don't know yet if it'll be needed later.
* Minify wasi imports and exports, and not just "env" (#2323)Alon Zakai2019-09-011-0/+2
| | | This makes the minification pass aware of "wasi_unstable" and "wasi" as well.
* Don't minify __stack_pointer import (#2219)Sam Clegg2019-07-111-0/+1
| | | This is core import like __memory_base and __table_base.
* Add event section (#2151)Heejin Ahn2019-05-311-0/+2
| | | | | | | | | | | | | | | | | | This adds support for the event and the event section, as specified in https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model. Wasm events are features that suspend the current execution and transfer the control flow to a corresponding handler. Currently the only supported event kind is exceptions. For events, this includes support for - Binary file reading/writing - Wast file reading/writing - Binaryen.js API - Fuzzer - Validation - Metadce - Passes: metrics, minify-imports-and-exports, remove-unused-module-elements
* Factor out elementStartsWith (NFC) (#2137)Heejin Ahn2019-05-231-0/+1
| | | | | Checking if a first string matches a certain string within a list element appears many times within the parser, so extracted it as a helper function.
* Apply format changes from #2048 (#2059)Alon Zakai2019-04-261-40/+40
| | | 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
* Passive segments (#1976)Thomas Lively2019-04-051-1/+1
| | | | | Adds support for the bulk memory proposal's passive segments. Uses a new (data passive ...) s-expression syntax to mark sections as passive.
* wasm-emscripten-finalize: Improve shared library support (#1961)Sam Clegg2019-04-021-0/+1
| | | | | | | | | | | | | | | | | Convert PIC code generated by llvm to work with the current emscripten ABI for dynamic linking: - Convert mutable global imports from GOT.mem and GOT.func into internal globals. - Initialize these globals on started up in g$foo and f$foo imported functions to calculate addresses at runtime. Also: - Add a test case for linking and finalizing a shared library - Allow __stack_pointer global to be non-existent as can be case for a shared library. - Allow __stack_pointer global to be an import, as can be the case for a shared library.
* Massive renaming (#1855)Thomas Lively2019-01-071-1/+1
| | | | | | Automated renaming according to https://github.com/WebAssembly/spec/issues/884#issuecomment-426433329.
* Cleanup shared constants (#1784)Sam Clegg2018-11-291-0/+2
|
* Share trap mode between asm2wasm and s2wasm (#1168)jgravelle-google2017-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extract Asm2WasmBuilder::TrapMode to shared FloatTrapMode * Extract makeTrappingI32Binary * Extract makeTrappingI64Binary * Extract asm2wasm test script into scripts/test/asm2wasm.py This matches s2wasm.py, and makes iterating on asm2wasm slightly faster. * Simplify callsites with an arg struct * Combine func adding across i32 and i64 * Support f32-to-int in asm2wasm * Add BinaryenTrapMode pass, run pass from s2wasm * BinaryenTrapMode pass takes trap context as a parameter * Pass fully supports non-trapping binary ops * Defer adding functions until after iteration (hackily) * Update asm2wasm to work with deferred function adding, rebuild tests * Extract makeTrappingFloatToInt32 * Extract makeTrappingFloatToInt64 * Add unary conversions to trap pass * Add functions in the pass itself * Set s2wasm trap mode with command-line arguments * Print BINARYEN_PASS_DEBUG state when testing * Get asm2wasm using the BinaryenTrapMode pass instead of handling it inline * Also handle f32 to int in asm2wasm * Make BinaryenTrapMode only need a FloatTrapMode from the caller * Just pass the current binary Expression directly * Combine makeTrappingI32Binary with makeTrappingI64Binary * Pass Unary expr to makeTrappingFloatToInt32 * Unify makeTrappingFloatToInt32 & 64 * Move makeTrapping* functions inside BinaryenTrapMode, make addedFunctions non-static * Remove FloatTrapContext * Minor cleanups * Extract some smaller subfunctions * Emit name switch/casing, rename is32Bit to isI64 for consistency * Rename BinaryenTrapMode to FloatTrap, make trap mode a nested enum * Add some comments explaining why FloatTrap is non-parallel * Rename addedFunctions to generatedFunctions for precision * Rename move and split float-clamp.h to passes/FloatTrap.(h|cpp) * Use builder instead of allocator * Instantiate trap handling passes via the pass manager * Move passes/FloatTrap.h to ast/trapping.h * Add helper function to add trap-handling passes * Add trap mode pass tests * Rename FloatTrap.cpp to TrapMode.cpp * Add s2wasm trap mode tests. Force float->int conversion to be signed * Add trapping_sint_div_s test to unit.asm.js * Fix flake8 issues with test scripts * Update pass description comment * Extract building functions methods * Make generate functions into top-level functions * Add GeneratedTrappingFunctions class to manage function/import additions * Move ensure/makeTrapping functions outside class scope * Use GeneratedTrappingFunctions to add immediately in asm2wasm mode * Remove trapping_sint_div_s test We only added it to test that trapping divisions would get constant-folded at the correct time. Now that we're not changing the timing of trapping modes, the test is unneeded (and problematic). * Review feedback, add validator/*.wasm to .gitignore * Add support for unsigned float-to-int conversion * Use opcode directly instead of bools * Update s2wasm clamp test for unsigned ftoi
* Make header guards consistent (#997)Sam Clegg2017-05-041-1/+0
|
* wasm-merge tool (#919)Alon Zakai2017-04-171-0/+8
| | | | 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.
* global parsingAlon Zakai2016-09-191-0/+1
|
* support module operations in shell testsAlon Zakai2016-09-171-1/+0
|
* support assert_malformed in shell test runnerAlon Zakai2016-09-161-3/+0
|
* support function table initial and max sizes, and new printing formatAlon Zakai2016-08-121-0/+2
|
* support expressions in segment offsetsAlon Zakai2016-08-121-0/+1
|
* add shared-constants.h for wasm constantsAlon Zakai2016-06-261-0/+56
|
* Split construction, scanning, and building phases of S2WasmBuilder (#400)Derek Schuff2016-04-271-104/+0
| | | | | | | | | | | Instead of doing all of the S2Wasm work in the constructor, split construction, scanning (to determine implemented functions) and building of the wasm module. This allows the linker to get the symbol information (e.g. implemented functions) without having to build an entire module (which will be useful for archives) and to allow the linker to link a new object into the existing one by building the wasm module in place on the existing module.
* refactor shell interface into its own fileAlon Zakai2016-04-041-1/+8
|
* de-recurse operations on nested blocksAlon Zakai2016-03-101-0/+1
|
* refactoring in preparation for then-else parsingAlon Zakai2016-03-071-0/+2
|
* support asm.js ceilAlon Zakai2016-02-211-0/+1
|
* Support startJF Bastien2016-02-051-0/+1
| | | | | | | | | | | | | | As spec'd in: https://github.com/WebAssembly/design/pull/495 And discussed in: https://github.com/WebAssembly/spec/issues/231 This will make it simpler and more uniform to add a start entry point. s2wasm is the right place to add start because it'll eventually need to do other basic setup, e.g. put code in start to setup the stack, as dschuff is doing in: https://github.com/WebAssembly/binaryen/pull/179 Or rather, the linker is the right place and s2wasm happens to act as our linker right now.
* s2wasm const parsing fixesAlon Zakai2015-12-231-0/+2
|
* Fix / uniformize include guardsJF Bastien2015-12-221-3/+3
|
* Fix the license headersJF Bastien2015-12-211-1/+16
| | | | 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.
* use Math.imul in wasm2asmAlon Zakai2015-12-071-0/+1
|
* emit heap views in wasm2asmAlon Zakai2015-12-061-0/+2
|
* emit 'use asm' in wasm2asmAlon Zakai2015-12-061-0/+1
|
* more wasm2asm progressAlon Zakai2015-12-041-1/+12
|
* refactor wasm.js so that it will be able to support multiple wasm loading ↵Alon Zakai2015-11-281-0/+60
methods