1Changelog 2========= 3 4This document describes changes between tagged Binaryen versions. 5 6To browse or download snapshots of old tagged versions, visit 7https://github.com/WebAssembly/binaryen/releases. 8 9Not all changes are documented here. In particular, new features, user-oriented 10fixes, options, command-line parameters, usage changes, deprecations, 11significant internal modifications and optimizations etc. generally deserve a 12mention. To examine the full set of changes between versions, visit the link to 13full changeset diff at the end of each section. 14 15Current Trunk 16------------- 17 18v98 19--- 20 21- Add `--fast-math` mode. (#3155) 22- Initial implementation of "Memory64" proposal (#3130) 23- Lots of changes in support of GC proposal 24 25v97 26--- 27 28- Remove asm2wasm, which supported Emscripten's fastcomp backend, after fastcomp 29 was removed. 30- The new feature flag `--enable-anyref` enables just the `anyref` type incl. 31 basic subtyping of `externref`, `funcref` and `exnref` (if enabled). 32- Enabling the exception handling or anyref features without also enabling 33 reference types is a validation error now. 34- The `Host` expression and its respective APIs have been refactored into 35 separate `MemorySize` and `MemoryGrow` expressions to align with other memory 36 instructions. 37 38v96 39--- 40 41- Fuzzing: Compare wasm2js to the interpreter (#3026) 42- Fix CountLeadingZeroes on MSVC, which lead to bad optimizations (#3028) 43- Asyncify verbose option (#3022) 44- wasm2js: Add an "Export" scope for name resolution, avoids annoying 45 warnings (#2998) 46- Extend the C- and JS-APIs (#2586) 47 48v95 49--- 50 51- Add Asyncify "add list" that adds to the list of functions to be instrumented. 52 Rename old lists to be clearer and more consistent with that, so now there is 53 "remove list" to remove, "add list" to add, and "only list" which if set means 54 that only those functions should be instrumented and nothing else. 55- Renamed various ambiguous C-API functions for consistency: 56 - `BinaryenBlockGetChild` to `BinaryenBlockGetChildAt` 57 - `BinaryenSwitchGetName` to `BinaryenSwitchGetNameAt` 58 - `BinaryenCallGetOperand` to `BinaryenCallGetOperandAt` 59 - `BinaryenCallIndirectGetOperand` to `BinaryenCallIndirectGetOperandAt` 60 - `BinaryenHostGetOperand` to `BinaryenHostGetOperandAt` 61 - `BinaryenThrowGetOperand` to `BinaryenThrowGetOperandAt` 62 - `BinaryenTupleMakeGetOperand` to `BinaryenTupleMakeGetOperandAt` 63 64v94 65--- 66 67- The C-API's `BinaryenSetAPITracing` and the JS-API's `setAPITracing` have been 68 removed because this feature was not very useful anymore and had a significant 69 maintainance cost. 70- wasm-emscripten-finalize will no longer generate `stackSave`, `stackAlloc`, 71 `stackRestore` function. It not expects them to be included in the input 72 file. 73 74v93 75--- 76 77- First release with binaries built with github actions. 78 79 80v92 81--- 82 83- The `multivalue` feature has been added. It allows functions and control flow 84 structures to return tuples and for locals and globals to have tuple types. 85 Tuples are created with the new `tuple.make` pseudoinstruction and their 86 elements are retrieved with the new `tuple.extract` pseudoinstruction. 87- The internal type interner has been rewritten to avoid taking locks in far 88 more situations. Depending on the workload, this may result in large speedups 89 and increased parallelism. 90- Represent the `dylink` section in Binaryen IR, so we can read, write, and 91 update it. 92 93v91 94--- 95 96- `BinaryenExpressionGetSideEffects` (C API) and `getSideEffects` (JS API) now 97 takes an additional `features` parameter. 98- Reference type support is added. Supported instructions are `ref.null`, 99 `ref.is_null`, `ref.func`, and typed `select`. Table instructions are not 100 supported yet. For typed `select`, C/JS API can take an additional 'type' 101 parameter. 102 103v90 104--- 105 106- `local.tee`'s C/Binaryen.js API now takes an additional type parameter for its 107 local type, like `local.get`. This is required to handle subtypes. 108- Added load_splat SIMD instructions 109- Binaryen.js instruction API changes: 110 - `notify` -> `atomic.notify` 111 - `i32.wait` / `i64.wait` -> `i32.atomic.wait` / `i64.atomic.wait` 112- Binaryen.js: `flags` argument in `setMemory` function is removed. 113- `atomic.fence` instruction support is added. 114- wasm-emscripten-finalize: Don't rely on name section being present in the 115 input. Use the exported names for things instead. 116- Added `mutable` parameter to BinaryenAddGlobalImport. 117- Replace BinaryenSIMDBitselect* with BinaryenSIMDTernary* in the C API and add 118 qfma/qfms instructions. 119- Added `offset` parameter to BinaryenSetFunctionTable. 120- Add the ability to create multivalue Types in the C and JS APIs. 121- Remove named function types. They are replaced by `params` and `results` types 122 local to each function. 123- Binaryen.js can now be compiled to Wasm using the `binaryen_wasm` target. 124 Unlike the JS variant, the Wasm variant requires asynchronously awaiting the 125 Wasm blob's instantiation and initialization before being usable, using the 126 `binaryen.ready` promise, e.g. `binaryen.ready.then(() => ...)`. 127- Binaryen.js now uses `binaryen` (was `Binaryen`) as its global name to align 128 with the npm package. 129- Binaryen.js: The result of `getMemorySegmentInfoByIndex` now has the same 130 structure as the respective inputs on creation (`byteOffset` -> `offset`). 131 132v88 133--- 134 135- wasm-emscripten-finalize: For -pie binaries that import a mutable stack 136 pointer we internalize this an import it as immutable. 137- The `tail-call` feature including the `return_call` and `return_call_indirect` 138 instructions is ready to use. 139 140v87 141--- 142 143- Rename Bysyncify => Asyncify 144 145v86 146--- 147 148- The --initial-stack-pointer argument to wasm-emscripten-finalize no longer 149 has any effect. It will be removed completely in future release. 150 151v85 152--- 153 154- Wast file parsing rules now don't allow a few invalid formats for typeuses 155 that were previously allowed. Typeuse entries should follow this format, 156 meaning they should have (type) -> (param) -> (result) order if more than one 157 of them exist. 158 ``` 159 typeuse ::= (type index|name)+ | 160 (type index|name)+ (param ..)* (result ..)* | 161 (param ..)* (result ..)* 162 ``` 163 Also, all (local) nodes in function definition should be after all typeuse 164 elements. 165- Removed APIs related to deprecated instruction names in Binaryen.js: 166 - `get_local` / `getLocal` 167 - `set_local` / `setLocal` 168 - `tee_local` / `teeLocal` 169 - `get_global` / `getGlobal` 170 - `set_global` / `setGlobal` 171 - `current_memory` / `currentMemory` 172 - `grow_memory` / `growMemory` 173 They are now available as their new instruction names: 174 `local.get`, `local.set`, `local.tee`, `global.get`, `global.set`, 175 `memory.size`, and `memory.grow`. 176- Add feature handling to the C/JS API with no feature enabled by default. 177 178v84 179--- 180 181- Generate dynCall thunks for any signatures used in "invoke" calls. 182 183v81 184--- 185 186- Fix AsmConstWalker handling of string address in arg0 with -fPIC code 187 188v80 189--- 190 191- Change default feature set in the absence of a target features section from 192 all features to MVP. 193 194v79 195--- 196 197- Improve support for side modules 198 199v78 200--- 201 202- Add `namedGlobals` to metadata output of wasm-emscripten-finalize 203- Add support for llvm PIC code. 204- Add --side-module option to wasm-emscripten-finalize. 205- Add `segmentPassive` argument to `BinaryenSetMemory` for marking segments 206 passive. 207- Make `-o -` print to stdout instead of a file named "-". 208 209v73 210--- 211 212- Remove wasm-merge tool. 213 214v73 215--- 216 217- Remove jsCall generation from wasm-emscripten-finalize. This is not needed 218 as of https://github.com/emscripten-core/emscripten/pull/8255. 219 220v55 221--- 222 223- `RelooperCreate` in the C API now has a Module parameter, and 224 `RelooperRenderAndDispose` does not. 225 - The JS API now has the `Relooper` constructor receive the `Module`. 226- Relooper: Condition properties on Branches must not have side effects. 227 228older 229----- 230 231- `BinaryenSetFunctionTable` in the C API no longer accepts an array of 232 functions, instead it accepts an array of function names, `const char** 233 funcNames`. Previously, you could not include imported functions because they 234 are of type `BinaryenImportRef` instead of `BinaryenFunctionRef`. #1650 235 236- `BinaryenSetFunctionTable` in the C API now expects the initial and maximum 237 table size as additional parameters, like `BinaryenSetMemory` does for pages, 238 so tables can be grown dynamically. #1687 239 240- Add `shared` parameters to `BinaryenAddMemoryImport` and `BinaryenSetMemory`, 241 to support a shared memory. #1686 242