summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Create version_79 (#2014)Sam Clegg2019-04-161-0/+8
|
* Make sure we always add signature to `fp$` functions (#1994)Sam Clegg2019-04-165-42/+93
| | | | | | | | Previously we were searching for the function by name but this doesn't work when the internal name for the function is different. In order to repro such a case the shared.c test was converted to C++ since then binaryen's internal name is different since it comes from the de-mangled name section.
* Verify flat IR where it is expected, and give a nice error (#2009)Alon Zakai2019-04-1620-968/+1721
| | | Fixes #2007 #2008
* Do not emit the DataCount section (#2010)Thomas Lively2019-04-154-21/+10
| | | | | Its presence was causing validation errors in the Emscripten test suite. This should be reverted once the default feature set is no longer All.
* Use a single table in wasm2js (#2005)Alon Zakai2019-04-1561-128/+214
| | | | | This replaces the multiple asm.js tables (of power-of-2 size) with a single simple table. Also supports importing the table.
* DataCount section (#2006)Thomas Lively2019-04-159-25/+78
| | | | | | | | * DataCount section Read the DataCount section and verify that it agrees with the data section. Also emit the DataCount section when bulk-memory is enabled and there are a nonzero number of segments. Factor out some shared unit test code.
* Move features from passOptions to Module (#2001)Thomas Lively2019-04-1255-264/+294
| | | | | This allows us to emit a (potentially modified) target features section and conditionally emit other sections such as the DataCount section based on the presence of features.
* Wasm2js memory fixes (#2003)Alon Zakai2019-04-1225-489/+9017
| | | | | | | | * I64ToI32Lowering - don't assume address 0 is a hardcoded location for scratch memory. Import __tempMemory__ for that. * RemoveNonJSOps - also use __tempMemory__. Oddly here the address was a hardcoded 1024 (perhaps where the rust program put a static global?). * Support imported ints in wasm2js, coercing them as needed. * Add "env" import support in the tests, since now we emit imports from there. * Make wasm2js tests split out multi-module tests using split_wast which is more robust and avoids emitting multiple outputs in one file (which makes no sense for ES6 modules)
* wasm2js memory improvements (#2002)Alon Zakai2019-04-124-56/+83
| | | | | * Refactor memory code to share it between the two emitting modes. * Get memory emitting set up in the emscripten mode.
* wasm2js: emscripten glue option (#2000)Alon Zakai2019-04-115-4/+180
| | | | | | Add a wasm2js option for the glue to be in emscripten-compatible format (as opposed to ES6). This does a few things so far: * Emit START_FUNCTIONS, END_FUNCTIONS markers in the code, for future use in the optimizer. * Emit the glue as a function to be called from emscripten.
* Wasm2js refactoring (#1997)Alon Zakai2019-04-1161-620/+698
| | | | | | | | | | | | | Early work for #1929 * Leave core wasm module - the "asm.js function" - to Wasm2JSBuilder, and add Wasm2JSGlue which emits the code before and after that. Currently that's some ES6 code, but we may want to change that later. * Add add AssertionEmitter class for the sole purpose of emitting modules + assertions for testing. This avoids some hacks from before like starting from index 1 (assuming the module at first position was already parsed and printed) and printing of the f32Equal etc. functions not at the very top (which was due to technical limitations before). Logic-wise, there should be no visible change, except some whitespace and reodering, and that I made the exceptions print out the source of the assertion that failed from the wast: -if (!check2()) fail2(); +if (!check2()) throw 'assertion failed: ( assert_return ( call add ( i32.const 1 ) ( i32.const 1 ) ) ( i32.const 2 ) )'; (fail2 etc. did not exist, and seems to just have given a unique number for each assertion?)
* Bulk memory side effects (#1998)Thomas Lively2019-04-113-12/+305
|
* don't precompute anything to a vector for now (#1999)Alon Zakai2019-04-103-1/+16
| | | We handled this for the normal case, but the optimizer can also precompute a return into a value, so check the output of the precomputation as well.
* don't compare running before and after binaryen opts on non-binaryen vms if ↵Alon Zakai2019-04-101-5/+10
| | | | nans are allowed, as they are nondetermnistic (#1996)
* Handle relocatable code in AsmConstWalker (#1992)Sam Clegg2019-04-1013-33/+575
| | | | | | In relocatable code the constant offset might be relative to __memory_base.
* Minor wasm2js cleanups (#1995)Alon Zakai2019-04-106-31/+50
| | | | | * Only look at the sign of loads when they actually matter. * Prepare for imported globals (just refactoring/cleanup).
* Modify .clang-format (#1986)Heejin Ahn2019-04-111-2/+3
| | | | | | | Modifies .clang-format to reflect discussions in #1981. This basically removes the custom 100 cols line length and allows one-line ifs/cases/blocks. There is one more similar option in clang-format, `AllowShortLoopsOnASingleLine`, but I couldn't find any one-line for loop in our codebase, so I think we don't use it.
* Fuzz fixes (#1991)Alon Zakai2019-04-107-3545/+488
| | | | | | | Get fuzzer to attempt to create almost all features. Pass v8 all the flags to allow that. Fix fuzz bugs where we read signed_ even when it was irrelevant for that type of load. Improve wasm-reduce on fuzz testcases, try to replace a node with drops of its children, not just the children themselves.
* avoid signed overflow undefined behavior in OptimizeInstructions constant ↵Alon Zakai2019-04-092-2/+8
| | | | computations (#1990)
* Directize: if we change a type to unreachable, we need to propagate that out ↵Alon Zakai2019-04-093-1/+36
| | | | (#1989)
* Better memory fuzzing (#1987)Alon Zakai2019-04-087-970/+1064
| | | | | | | | Hash the contents of all of memory and log that out in random places in the fuzzer, so we are more sensitive there and can catch memory bugs. Fix UB that was uncovered by this in the binary writing code - if a segment is empty, we should not look at &vector[0], and instead use vector.data(). Add Builder::addExport convenience method.
* wasm-emscripten-finalize: rename function pointer getter functions (#1988)Sam Clegg2019-04-082-7/+28
| | | | | | | | Turns out there was already a precedent in emscripten for using `fp$` for these functions. Also, improve the heuristics for guessing the stack pointer global. There are cases where we don't use have an explicit stack pointer at all but *do* have both imported and exported globals.
* Move segment merging to fit web limits into its own pass (#1980)Thomas Lively2019-04-0820-203571/+273
| | | | | | It was previously part of writing a binary, but changing the number of segments at such a late stage would not work in the presence of bulk memory's datacount section. Also updates the memory packing pass to respect the web's limits on the number of data segments.
* Directize: arguments may have had side effects, don't just remove them when ↵Alon Zakai2019-04-082-5/+38
| | | | optimizing to an unreachable (#1985)
* Passive segments (#1976)Thomas Lively2019-04-0543-958/+1269
| | | | | Adds support for the bulk memory proposal's passive segments. Uses a new (data passive ...) s-expression syntax to mark sections as passive.
* Add missing comma in metadata JSON (#1983)Thomas Lively2019-04-0513-13/+13
|
* Add feature options to emscripten metadata (#1982)Thomas Lively2019-04-0517-25/+170
| | | Emscripten runs wasm-emscripten-finalize before running wasm-opt, so the target features section is stripped out before optimizations are run. One option would have been to add another wasm-opt invocation at the very end to strip the target features section, but dumping the features as metadata avoids the extra tool invocation. In the long run, it would be nice to have only as single binaryen invocation to do all the work that needs doing.
* wasm-emscripten-finalize: add namedGlobals to output metadata (#1979)Sam Clegg2019-04-0415-38/+67
| | | | | | This key is used by emscripten when building with MAIN_MODULE in order to export global variables from the main module to the side modules.
* Attempt to fix sha256 generation on OSX (#1977)Alex Crichton2019-04-041-1/+1
|
* Use target features section in wasm-opt (#1967)Thomas Lively2019-04-0317-114/+286
| | | | | | | If the user does not supply features explicitly on the command line, read and use the features in the target features section for validation and passes. If the user does supply features explicitly, error if they are not a superset of the features marked as used in the target features section and the user does not explicitly handle this.
* Update test/spec/memory.wast to latest upstream (#1801)Alon Zakai2019-04-0336-162/+105
| | | | | | | Minus multi-memory which we don't support yet. Improve validator. Fix some minor validation issues in our tests.
* Add a mechanism to pass arguments to passes (#1941)Alon Zakai2019-04-035-13/+50
| | | | | | | | | This allows wasm-opt --pass-arg=KEY:VALUE where KEY and VALUE are strings. It is then added to passOptions.arguments, where passes can read it. This is used in ExtractFunction instead of an env var.
* Fuzz more carefully when using nans (#1956)Alon Zakai2019-04-031-4/+10
|\ | | | | They are nondeterministic between VMs, so disable VM comparisons in that case.
| * clenaupAlon Zakai2019-03-201-6/+0
| |
| * Merge remote-tracking branch 'origin/master' into nansAlon Zakai2019-03-2070-7567/+8957
| |\
| * | don't compare vms if fuzzing nans, since they are nondeterministicAlon Zakai2019-03-111-4/+16
| | |
* | | Update CHANGELOG.md (#1978)Sam Clegg2019-04-021-5/+17
| | |
* | | Directize: turns indirect calls into direct ones (#1974)Alon Zakai2019-04-028-19/+486
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * wip [ci skip] * works * test output * test update * js build * better location for running directize
| * | | better location for running directizeAlon Zakai2019-04-021-1/+1
| | | |
| * | | js buildAlon Zakai (kripken)2019-03-311-0/+1
| | | |
| * | | test updateAlon Zakai (kripken)2019-03-311-17/+8
| | | |
| * | | test outputAlon Zakai (kripken)2019-03-311-0/+159
| | | |
| * | | worksAlon Zakai (kripken)2019-03-313-16/+200
| | | |
| * | | wip [ci skip]Alon Zakai (kripken)2019-03-314-2/+134
| | | |
* | | | wasm-emscripten-finalize: Improve shared library support (#1961)Sam Clegg2019-04-0219-103/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Add Windows binary releases through AppVeyor (#1700)Alex Crichton2019-04-022-1/+30
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | This commit tweaks the AppVeyor configuration to publish 64 and 32-bit artifacts as part of the normal release builds. Configuration was also added to be sure to compile code with `/MT` on MSVC to ensure that the released artifacts depend on as few DLLs as possible, hopefully making them as portable as possible. cc #1695
* | | Rename atomic wait/notify instructions (#1972)Heejin Ahn2019-03-3038-151/+146
| | | | | | | | | | | | | | | | | | | | | | | | This renames the following: - `i32.wait` -> `i32.atomic.wait` - `i64.wait` -> `i64.atomic.wait` - `wake` -> `atomic.notify` to match the spec.
* | | Warn about running gen-s-parser.py with Python 2 (#1971)Thomas Lively2019-03-291-0/+6
| | |
* | | avoid risky iterator addition (#1970)Alon Zakai2019-03-291-1/+1
| | | | | | | | | Not an actual problem, but hits an assertion in D_GLIBCXX_DEBUG, and is likely UB.
* | | Delete wasm-merge (#1969)Thomas Lively2019-03-2996-2801/+5
| | | | | | | | | It is not very useful.