summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix asm2wasm dead lock caused by empty modules.Logan Chien2016-08-261-1/+9
| | | | | | | | | This commit fixes an asm2wasm dead lock when asm2wasm is compiling an empty module, i.e. a module without any functions. Without this commit, worker threads are likely to leave `workerMain()` and decrease `liveWorkers` early. Consequently, `waitUntilAllReady()` will never observe `liveWorkers == numWorkers`.
* Remove unnecessary type cast.Logan Chien2016-08-261-2/+1
| | | | | std::thread can forward the arguments to main function properly. We don't have to cast them from/to void*.
* Replace std::unique<T>(new T()) with make_unique<T>().Logan Chien2016-08-266-8/+9
| | | | | | | | | | | | | | | | This commit modernize the code base by replacing: std::unique_ptr<T>(new T(...)) with: make_unique<T>(...) or: wasm::make_unique<T>(...) This is a step closer to adopt C++14 std::make_unique<T>(...).
* Merge pull request #668 from WebAssembly/tables_n_memoriesAlon Zakai2016-08-1618-100/+306
|\ | | | | Tables and memories
| * offset support in tableAlon Zakai2016-08-1514-66/+204
| |
| * support function table initial and max sizes, and new printing formatAlon Zakai2016-08-129-2/+44
| |
| * support expressions in segment offsetsAlon Zakai2016-08-1214-40/+66
| |
* | interpreter debugging fixes (#672)Alon Zakai2016-08-151-11/+13
|/
* parsing fix in compiled-to-js parser (#669)Alon Zakai2016-08-121-4/+4
|
* Implement asm.js style exception handling for Wasm (#664)Heejin Ahn2016-08-112-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement asm.js style exception handling for Wasm Converts invoke wrapper names generated by LLVM backend to real invoke wrapper names that are expected by JavaScript glue code. This is required to support wasm exception handling (asm.js style). LLVM backend lowers invoke @func(arg1, arg2) to label %invoke.cont unwind label %lpad into ... (some code) call @invoke_SIG(func, arg1, arg2) ... (some code) SIG is a mangled string generated based on the LLVM IR-level function signature. In LLVM IR, types are not lowered yet, so this mangling scheme simply takes LLVM's string representtion of parameter types and concatenate them with '_'. For example, the name of an invoke wrapper for function void foo(struct mystruct*, int) will be "__invoke_void_%struct.mystruct*_int". This function converts the names of invoke wrappers based on their lowered argument types and a return type. In the example above, the resulting new wrapper name becomes "invoke_vii". * Address comments Change variable names to camelcase Add a small (semi-)handwritten test case * Export malloc and free from wasm when available * Add a test case for exporting malloc/free feature + cosmetic 'file' name change in text_before_type.s * fixInvokeWrapper -> fixEmExceptionInvoke * Add a TODO
* in DemoteFloat64, if the truncated value is exactly at the limit, return it ↵Alon Zakai2016-08-081-0/+6
| | | | | (#665) and update spec tests
* Fix a parsing bug introduced by #615 (#661)Heejin Ahn2016-08-051-0/+4
| | | | | | | | | | | | | | | Name lhs = getStrToSep(); if (!skipEqual()){ s = strchr(s, '\n'); if (!s) break; continue; } The above code snippet introduced by #615 has a bug when there is only one word (e.g. ".text") in a line. If there is only one word in a line, skipEqual() also skips the newline character at the end of the line, and strchr(s, '\n') moves the cursor to the end of the next line, effectively skipping the whole next line.
* Create a dummy function to prevent NULL miscomparisons, if necessary (#658)Dominic Chen2016-08-032-16/+49
| | | Resolves WebAssembly/spec#312
* support pre-assigning indexes for functions that are called indirectly (#616)Dominic Chen2016-08-023-2/+38
| | | This patch adds support for an ".indidx" primitive that pre-assigns table indexes for functions that are called indirectly. It is used by the upstream LLVM WebAssembly backend to support fine-grained control-flow integrity for indirect function calls by emitting instrumentation at each indirect call site to check that the destination index is within certain ranges that correspond to disjoint equivalence classes of indirect call targets. The reason that this primitive is necessary is because the layout of the table section isn't determined until the WebAssembly linker is executed, but indirect function to table index mappings need to be known when opt is executed to generate the correct range checking in the LLVM IR.
* wast function type name desugaring is changing in spec:301 (#654)Alon Zakai2016-07-282-12/+49
|
* Fix trailing whitespace, single-character strings, checking map element ↵Dominic Chen2016-07-225-64/+55
| | | | presence, and eliminate explicit index counter (#633)
* binary support for wasm globals (#652)Alon Zakai2016-07-222-13/+71
|
* support wasm globals (#650)Alon Zakai2016-07-219-9/+256
|
* more RemoveUnusedName opts: merge names when possible, and do block/loop ↵Alon Zakai2016-07-201-5/+42
| | | | merging based on their names
* remove unused labels from loops too, and general clean ups for RemoveUnusedNamesAlon Zakai2016-07-201-7/+28
|
* avoid label variable usage in relooper for forward branches, just use a ↵Alon Zakai2016-07-202-54/+121
| | | | stack of blocks for them. after this change, only irreducible control flow should cause label variable usage
* improve a validation errorAlon Zakai2016-07-201-1/+6
|
* refactor calling of MakeMultiple in relooperAlon Zakai2016-07-181-5/+4
|
* remove an unneeded param in the relooperAlon Zakai2016-07-181-4/+5
|
* remove some old code in relooperAlon Zakai2016-07-182-52/+5
|
* optimize updating of interference and copy table in CoalesceLocalsAlon Zakai2016-07-171-2/+3
|
* optimize types in CoalesceLocalsAlon Zakai2016-07-171-19/+20
|
* try natural and reverse order in coalese-localsAlon Zakai2016-07-171-2/+20
|
* optimize to remove as many copies as possible in coalesce-localsAlon Zakai2016-07-161-4/+32
|
* make sure to create instances of function-parallel functions, even in debug modeAlon Zakai2016-07-161-1/+8
|
* fix dce bug in non-parallel mode, which happens in debug mode, and add debug ↵Alon Zakai2016-07-161-1/+6
| | | | testing
* fix unreachable constructor without allocator (#643)Alon Zakai2016-07-161-2/+2
|
* eq/ne are ok to optimize even if they are nans (#640)Alon Zakai2016-07-152-0/+32
|
* don't simplify using de-morgan's rules on floats, because of nans (#638)Alon Zakai2016-07-152-64/+0
|
* emit safe calls for i32 div/rem when in precise mode in asm2wasm, as they ↵Alon Zakai2016-07-144-0/+45
| | | | can trap (#637)
* Merge pull request #632 from WebAssembly/tooAlon Zakai2016-07-133-47/+107
|\ | | | | Tool renaming and refactoring
| * validate properly in wasm-optAlon Zakai2016-07-131-1/+4
| |
| * separate wasm-opt out from wasm-shell: opt optimizes, shell runs wast shell ↵Alon Zakai2016-07-133-46/+103
| | | | | | | | tests
| * rename binaryen-shell to wasm-shellAlon Zakai2016-07-131-1/+1
| |
* | Don't emit empty array literals in trace output (#631)Alon Zakai2016-07-132-7/+19
|/ | | | * don't emit empty array literals in trace output
* Handle aliases without size (e.g. weak symbol), add redefinition warnings (#630)Dominic Chen2016-07-132-12/+8
|
* handle param overloading in asm2wasm ffis (#629)Alon Zakai2016-07-121-6/+21
|
* commentAlon Zakai2016-07-121-0/+3
|
* relooper tracing + fixesAlon Zakai2016-07-121-49/+40
|
* allow multiple tracesAlon Zakai2016-07-121-15/+24
|
* add a tracing option to the c api, which logs out a runnable program from c ↵Alon Zakai2016-07-122-14/+439
| | | | api calls
* fix relooper leakAlon Zakai2016-07-121-0/+3
|
* add support for symbol assignments, closes #4422 (#615)Dominic Chen2016-07-115-32/+122
| | | Adds support for aliases to objects, to go along with the existing support for aliases to functions.
* clarify the local/var/param distinctionAlon Zakai2016-07-072-4/+15
|
* update spec tests, and handle some flux in call_indirect in upstreamAlon Zakai2016-07-062-0/+9
|