Commit Graph

347 Commits

Author SHA1 Message Date
252b843c4b General cleanup (#525)
* Cleans up and trims the overly large builtins file by ~1600 lines
* Properly propagate inline assembler-like argument types
* Use https in examples
* Reformat README
2019-03-08 14:24:48 +01:00
8e5b9c734b Add atomic definitions (#524) 2019-03-02 10:14:09 +01:00
4e1bba3a24 Use Binaryen's function signature naming scheme (#522) 2019-03-01 00:01:23 +01:00
e1f1a3b49c Implement v128 instructions (#508) 2019-02-28 17:36:22 +01:00
aad263e670 Add isArrayLike builtin (#453) 2019-02-27 21:47:52 +01:00
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
2945af6557 Don't reset nested unchecked contexts, fixes #515 2019-02-27 17:10:20 +01:00
65c799c925 Speedup some compiler routines (#441) 2019-02-22 14:03:33 +01:00
cc5522d6cc Legalize external decorator for generic functions 2019-02-22 08:25:41 +01:00
f318d68383 Add isFunction and isNullable builtins (#504) 2019-02-22 01:11:05 +01:00
3b5b96f496 Fix declaration mismatch in generated constructors (#505) 2019-02-22 00:50:29 +01:00
4be78147e6 Update dependencies and dist files 2019-02-21 23:04:41 +01:00
34d86a0d6a Replace more workarounds with actual lazy compilation in stdlib 2019-02-21 05:42:33 +01:00
8d2194f045 Require exact type in instanceof basicType, fixes #493 2019-02-21 02:09:06 +01:00
951b6f9f45 Add shared memory support to compiler (#494) 2019-02-21 00:22:25 +01:00
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
e623786b42 Emit proper diagnostic when returning void from a function with a return value, fixes #475 2019-02-08 16:00:35 +01:00
47b2f33564 Emit a better error when expecting a compile-time constant, fixes #222 2019-02-07 23:04:57 +01:00
1bd1d26152 Put atomics behind a feature flag (#470) 2019-02-07 18:21:09 +01:00
2f1a6c44ce Add SIMD prerequisites (#469) 2019-02-07 15:26:26 +01:00
7ce3296b5e Add atomic built-ins (#440) 2019-02-07 15:25:49 +01:00
f551bc78e1 Implement bulk memory operations (#467) 2019-02-07 11:40:23 +01:00
831054dfd3 Rework inlining logic (#463) 2019-02-06 23:42:43 +01:00
c95c0f5fbe Emit diagnostic when redeclaring a local name, fixes #452 2019-02-03 13:37:32 +01:00
4829f3a3e4 Add ArrayBuffer.isView and rework Array.isArray (#431) 2019-02-03 10:41:04 +01:00
2131c51932 Rework constructor handling (#446) 2019-02-02 16:03:21 +01:00
75328f3feb Implement calls to 'super()' (#445) 2019-01-31 10:35:49 +01:00
65c4acd2d4 Skip over duplicate '| null's on nullable types 2019-01-30 10:56:22 +01:00
7877661f35 Emit an error when declaring a nullable basic type (for now) 2019-01-30 10:22:15 +01:00
d843772314 Implement non-null assertions (#443) 2019-01-30 09:56:13 +01:00
2fe228ff00 Cache strings shared with Binaryen 2019-01-27 02:08:04 +01:00
b7c7be1fe9 Add shared memory definitions and initial API (#435) 2019-01-25 10:50:55 +01:00
df3b2befd7 Support type names with enclosed dots, see #423 2019-01-17 00:37:28 +01:00
72dc26e255 Optimize builtin abs for integers (#420) 2019-01-15 18:22:24 +01:00
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
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
d5f72e32d7 Add initial definitions for SIMD ops 2018-12-14 08:17:08 +01:00
b585703eae Replace more RawGit links 2018-12-08 04:01:17 +01:00
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
aedc821c09 Process backlog once more after Transform#afterParse, see #356 2018-12-03 17:22:01 +01:00
6ed45bee98 Expose the full API for now, see #356
Some things might be more useful than others, but we can decide on that later.
2018-12-02 23:46:32 +01:00
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
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
9744c319c7 Fix an issue with 'super' not being present when inlining 2018-12-01 00:07:44 +01:00
1149abf824 Add 'instantiate<T>' builtin (like 'new' but from a type), see #349 2018-11-29 15:28:08 +01:00
1d93877e7c Fix unsupported element access on 'this', see #349 2018-11-29 13:12:06 +01:00
7596d73284 Shortcut f32/f64/i64 conversions to bool 2018-11-23 16:01:50 +01:00
c30c62e383 Cast to bool by comparing to zero (#343) 2018-11-23 15:20:52 +01:00
b723ff3e88 Update Binaryen to latest 2018-11-22 17:15:22 +01:00
a79db87af9 Fix parsing of properties and field names using semi-reserved keywords 2018-11-13 08:48:10 +01:00