summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for sign-extension operators from threading proposal (#1167)Derek Schuff2017-09-061-0/+6
| | | These are not atomic operations, but are added with the atomic operations to keep from having to define atomic versions of all the sign-extending loads (an atomic zero-extending load + signext operation can be used instead).
* Add support for atomic wait and wake operators (#1140)Derek Schuff2017-08-241-0/+8
| | | According to spec at https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-wake-operators
* Ignore unreachable code in wasm binaries (#1122)Alon Zakai2017-08-221-0/+6
| | | Ignoring unreachable code in wasm binaries lets us avoid corner cases with unstructured code in wasm binaries that is a poor fit for Binaryen's structured IR.
* Emit optimal-size LEBs in section/subsection/function body sizes (#1128)Alon Zakai2017-08-151-4/+22
| | | | * emit optimal-size LEBs in section/subsection/function body sizes, instead of preallocating 5 bytes
* New fuzzer (#1126)Alon Zakai2017-08-111-0/+7
| | | | | | This adds a new method of fuzzing, "translate to fuzz" which means we consider the input to be a stream of data that we translate into a valid wasm module. It's sort of like a random seed for a process that creates a random wasm module. By using the input that way, we can explore the space of valid wasm modules quickly, and it makes afl-fuzz integration easy. Also adds a "fuzz binary" option which is similar to "fuzz execution". It makes wasm-opt not only execute the code before and after opts, but also write to binary and read from it, helping to fuzz the binary format.
* fix reading of stacky unreadable code with elements we need to dropAlon Zakai (kripken)2017-08-051-0/+1
|
* add the option to seek named breaks, not just taken breaks; refactor headers ↵Alon Zakai (kripken)2017-07-111-1/+0
| | | | to make this practical
* Add IR, parsing, printing, and binary for atomic cmpxchg (#1083)Derek Schuff2017-07-101-0/+12
|
* Add IR, parsing and binary support for AtomicRMW instructions from wasm ↵Derek Schuff2017-07-061-1/+49
| | | | | threads proposal (#1082) Also leave a stub (but valid) visitAtomicRMW in the visitor template so that not all visitors need to implement this function yet.
* Add atomic loads and stores (#1077)Derek Schuff2017-06-281-3/+22
| | | | | Add IR, wast and binary support for atomic loads and stores. Currently all IR generated by means other than parsing wast and binary files always generates non-atomic accesses, and optimizations have not yet been made aware of atomics, so they are certainly not ready to be used yet.
* Add shared memories (#1069)Derek Schuff2017-06-271-2/+7
| | | | | Begin to implement wasm threading proposal in https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md This PR just has shared memory attribute with wast and binary support.
* Exporting/importing debug location information from .wast/.asm.js/.s formats ↵Yury Delendik2017-06-011-2/+41
| | | | | | | | (#1017) * Extends wasm-as, wasm-dis and s2wasm to consume debug locations. * Exports source map from asm2wasm
* Parsing fixes (#990)Alon Zakai2017-05-021-4/+11
| | | | | | | | | | * 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
* Extensible name section (#933)pipcet2017-04-131-1/+8
| | | | | | | | | | | | | 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)
* Wasm h to cpp (#926)jgravelle-google2017-03-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | * 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
* read unknown users sections as binary data stored on the Module (#918)Alon Zakai2017-02-211-1/+1
|
* update wasm version to 0x01 (#913)Alon Zakai2017-02-161-1/+1
| | | | | | * update wasm version to 0x01, in prep for release, and since browsers are ready to accept it * update wasm.js
* Merge pull request #865 from WebAssembly/fix-abAlon Zakai2017-01-101-1/+6
|\ | | | | Fix AngryBots parsing
| * handle a binary that breaks to returnAlon Zakai (kripken)2017-01-041-1/+6
| |
* | Merge pull request #871 from WebAssembly/fix-c-api-unused-memAlon Zakai2017-01-051-0/+1
|\ \ | |/ |/| Mark memory as existing when it is created in the C API
| * ensure exports are added deterministically from binariesAlon Zakai (kripken)2017-01-041-0/+1
| |
* | Handle stacky code (#868)Alon Zakai2017-01-041-1/+2
|/ | | | * handle stacky code in binaries, using a block+local
* ignore unknown user sections, fixes #857 (#858)Alon Zakai2016-12-071-1/+1
|
* add a --symbolmap option to wasm-as, which emits a side file with the name ↵Alon Zakai2016-11-091-0/+3
| | | | mapping (similar to Names section, but external)
* Binary 0xd changes (#803)Derek Schuff2016-10-261-188/+211
| | | | | | | | | | | | | | | | | | | | | * 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-4/+3
| | | | 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-201-1815/+128
|
* Don't create a memory section for an imported memory; fixes #772 (#773)Benjamin Bouvier2016-10-131-1/+5
|
* allow a maximum 0 size for a tableAlon Zakai2016-10-111-18/+18
|
* Don't create table sections for imported tables (#756)Derek Schuff2016-10-111-1/+3
| | | Previously the Print pass searched the imports for a table import and skipped printing a local table declaration if found. Instead this refactors to make importation explicit, and also create importation records (previously we were inconsistent about whether such records were created in the IR depending on the wast syntax).
* Binary 0xc: Remove arity on return instruction (#740)Derek Schuff2016-10-041-4/+2
| | | | Also skip binary roundtrip on stacky spec tests
* Write global mutability into wasm binary (#739)Derek Schuff2016-10-041-3/+6
| | | | | For compatibility with 0xc Also update opcode for get_global
* More binary updates for 0xc (#733)Derek Schuff2016-10-031-26/+51
| | | | | | | | | | | | | | | Refine tables to explicitly exist or not. Previously they were printed or encoded if it had any segments, or an initial or max size. However tables can be defined but empty, so we had a special hack that defined an empty segment when we really just wanted an empty table. Now, just make the existence explicit. Update Function table encoding for 0xc (Table and Element sections) Add end opcodes after function bodies (these are consumed by getMaybeBlock with the same behavior that it had before when it reached the function end, so no explicit decode) Update call_indirect encoding for 0xc (no arity, call target is last)
* Refactor Import::Kind and Export::Kind into an ExternalKind enum class (#725)Alon Zakai2016-10-031-25/+25
|
* fix signed int64 LEB bug with large negative values (#719)Alon Zakai2016-09-281-7/+43
|
* Type check block/loop/if sigs (#717)Alon Zakai2016-09-281-40/+12
| | | | | | * type check using block/loop/if types provided in text and binary formats. * print if and loop sigs which were missing. * remove dsl from OptimizeInstructions as after those changes it needs rethinking.
* Update binary encoding for block, loop, and if signatures (#711)Derek Schuff2016-09-271-26/+67
| | | | | | Also updates the tests and has a few other changes for binary 0xc: Update nop/unrechable opcodes Fix for "name" section
* Make wasm-as emit the names section/debug info only with -g (#705)Alon Zakai2016-09-261-1/+6
|
* Update binary encodings for call instructions and segments (#706)Derek Schuff2016-09-221-9/+10
| | | | | * Call instructions no longer encode the arity * Segments encode the linear memory index (0 for MVP)
* Update binary format toward 0xc (#704)Derek Schuff2016-09-221-88/+137
| | | | | | Updates section headers and formats for type, import, function, table, memory, and export sections, as well as "names" section, which is now a user section.
* fix use of endOfFunction in an uninitialized state in wasm-binaryAlon Zakai2016-09-211-1/+1
|
* fix start section in binary formatAlon Zakai2016-09-211-2/+2
|
* refactor wasm.h to remove numericIndex hacks, and move indexing to the parsersAlon Zakai2016-09-211-4/+6
|
* globals mutability fixesAlon Zakai2016-09-191-2/+7
|
* global parsingAlon Zakai2016-09-191-0/+1
|
* call_import changes: no more call_import, shared index space with functionsAlon Zakai2016-09-161-52/+69
|
* make sure to use the right order of operations when loading composite ints ↵Alon Zakai2016-09-071-3/+6
| | | | in binary format reading
* use globals in asm2wasmAlon Zakai2016-09-071-7/+42
|
* get_global and set_global use a Name instead of an Index, to be more ↵Alon Zakai2016-09-071-7/+7
| | | | consistent with refering to other global objects; e.g. this avoids ordering issues with imported vs non-imported globals
* import type for globalsAlon Zakai2016-09-071-6/+6
|