310 Commits

Author SHA1 Message Date
Daniel Wirtz
fd99589527
Fix enum initialization (#545) 2019-03-18 04:54:44 +01:00
dcode
edb2299f13 fixes 2019-03-17 12:25:54 +01:00
dcode
f21b339563 checked builtin array get, optimize abv layout 2019-03-17 08:46:26 +01:00
dcode
e63c6bd388 local flow flags, see what works 2019-03-17 01:35:44 +01:00
dcode
2d76da9465 alias locals when inlining a tail call 2019-03-17 00:11:16 +01:00
dcode
0c388ca4c6 make std/string test ok again 2019-03-16 14:48:22 +01:00
dcode
b8a08da7a5 more static array 2019-03-16 07:26:33 +01:00
dcode
058dc8d4fa static array stuff 2019-03-15 13:13:48 +01:00
dcode
968b0321a0 decisions 2019-03-15 09:26:31 +01:00
dcode
cdf3e2cf12 fixes 2019-03-14 09:22:20 +01:00
dcode
e38f627c8b more 2019-03-13 22:35:47 +01:00
dcode
6f70826e45 hmm 2019-03-13 09:05:02 +01:00
dcode
d9a5681489 arraybufferview 2019-03-11 07:45:47 +01:00
dcode
cb77760562 unsafe, stub 2019-03-10 21:38:15 +01:00
Daniel Wirtz
8e5b9c734b
Add atomic definitions (#524) 2019-03-02 10:14:09 +01:00
Daniel Wirtz
e1f1a3b49c
Implement v128 instructions (#508) 2019-02-28 17:36:22 +01:00
Daniel Wirtz
e8b0767143
Infer function expressions in matching contexts (#514)
* legalizes omitting types on function expressions within function type contexts
* legalizes omitting any number of arguments
2019-02-27 21:45:36 +01:00
Max Graey
65c799c925 Speedup some compiler routines (#441) 2019-02-22 14:03:33 +01:00
Daniel Wirtz
3b5b96f496
Fix declaration mismatch in generated constructors (#505) 2019-02-22 00:50:29 +01:00
dcode
8d2194f045 Require exact type in instanceof basicType, fixes #493 2019-02-21 02:09:06 +01:00
Nidin Vinayakan
951b6f9f45 Add shared memory support to compiler (#494) 2019-02-21 00:22:25 +01:00
Daniel Wirtz
0c64f21250
Rework resolver (#489)
* Rework IR and resolver to use nested lookup tables
* Integrate types into IR
* Make components prefer IR, slimmed down AST
* Implement `export *`
* Add `@lazy` annotation and remove `--noTreeShaking`
* Add `@start` annotation and remove magic `main`
* Related refactoring, cleanup and docs
2019-02-21 00:11:22 +01:00
dcode
e623786b42 Emit proper diagnostic when returning void from a function with a return value, fixes #475 2019-02-08 16:00:35 +01:00
Daniel Wirtz
1bd1d26152
Put atomics behind a feature flag (#470) 2019-02-07 18:21:09 +01:00
Daniel Wirtz
2f1a6c44ce
Add SIMD prerequisites (#469) 2019-02-07 15:26:26 +01:00
Daniel Wirtz
f551bc78e1
Implement bulk memory operations (#467) 2019-02-07 11:40:23 +01:00
Daniel Wirtz
831054dfd3
Rework inlining logic (#463) 2019-02-06 23:42:43 +01:00
dcode
c95c0f5fbe Emit diagnostic when redeclaring a local name, fixes #452 2019-02-03 13:37:32 +01:00
Daniel Wirtz
2131c51932
Rework constructor handling (#446) 2019-02-02 16:03:21 +01:00
Daniel Wirtz
75328f3feb
Implement calls to 'super()' (#445) 2019-01-31 10:35:49 +01:00
Daniel Wirtz
d843772314
Implement non-null assertions (#443) 2019-01-30 09:56:13 +01:00
dcode
2aa5c437c7 Properly set up memory if memoryBase is specified even if there are no static segments, fixes #414 2019-01-11 21:54:59 +01:00
Daniel Wirtz
f714afab3c
Implement explicit this type (#373)
* Add backing classes for basic types (I32...)
* Move standard numeric constants to backing classes
2019-01-09 12:45:29 +01:00
Daniel Wirtz
ebae7cbd73
Implement optional type parameters (#360)
* Add a NATIVE<T> macro type to simplify use of a native WebAssembly type
* Add default type parameters for internal helpers for explicit loads and stores
* Unify loadUnsafe/loadUnsafeWithOffset etc. into one
* Renamed loadUnsafe etc. into just LOAD, like a macro
* Implement parsing of index signatures, but ignore them, for properly linting code
* Refactor TypedArray<T> to use macros
2018-12-07 14:33:32 +01:00
dcodeIO
4c35dd6f7c Fix partial function prototypes not sharing their instances
This also made it necessary to extend the internal per-function instances map by one level for the respective class instance key so functions on differnt class instances with the same own type arguments don't collide.
2018-12-01 19:46:10 +01:00
dcodeIO
0e33806cf6 Add a way to ensure that lazy globals are resolved, fixes #355
This only affects static fields that currently must have a type annotation, while it wouldn't work if there wasn't an annotated type, like on normal globals, which aren't compiled lazily, though. Must be revisted if requirements on type annotations on fields ever become relaxed.
2018-12-01 13:31:37 +01:00
dcodeIO
9744c319c7 Fix an issue with 'super' not being present when inlining 2018-12-01 00:07:44 +01:00
dcodeIO
1149abf824 Add 'instantiate<T>' builtin (like 'new' but from a type), see #349 2018-11-29 15:28:08 +01:00
dcodeIO
7596d73284 Shortcut f32/f64/i64 conversions to bool 2018-11-23 16:01:50 +01:00
Daniel Wirtz
c30c62e383
Cast to bool by comparing to zero (#343) 2018-11-23 15:20:52 +01:00
dcodeIO
4289683946 Handle the case where an inlined body is empty 2018-11-12 17:30:28 +01:00
dcodeIO
d62d84521e Reduce inlining verbosity
With debug info and source maps in place there is not much value anymore in emitting explicitly named blocks.
2018-11-12 14:54:08 +01:00
Daniel Wirtz
2bdc2a72f1
Use stack IR when emitting text format (#312) 2018-11-08 08:04:24 +01:00
Max Graey
dc4e2060ba Add unary postfix operator overloading (#309) 2018-10-30 15:23:18 +01:00
dcodeIO
6f8a0fe03a Rework compileUnaryPostfixExpression
Previously this tried to reuse too much code, making it hard to implement operator overloading
2018-10-29 20:06:21 +01:00
Daniel Wirtz
f7c734789e
Update Binaryen to latest; Various fixes 2018-10-11 08:49:08 +02:00
dcodeIO
eeb8a8fd6c Make sure temp locals don't collide when allocating literal arrays, fixes #281
Originally part of #288
2018-10-03 01:32:28 +02:00
dcodeIO
9c770d801e Add initial newArray and getArray helpers to loader
Essentially creates an unmanaged typed array in memory that one can work with and free again respectively obtain from the AS side. No support for GC or generic arrays yet, and is likely to change substentially once WASM GC becomes a thing.
2018-09-18 15:17:44 +02:00
dcodeIO
16d1a833dd Always add a null function at table index zero
This allows function references (a table index internally) to be nullable
2018-09-17 01:48:35 +02:00
dcodeIO
d90cd085e5 Update Binaryen 2018-09-13 23:10:49 +02:00