Commit Graph

32 Commits

Author SHA1 Message Date
f318d68383 Add isFunction and isNullable builtins (#504) 2019-02-22 01:11:05 +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
4e89456dcb Add more numeric builtins (#330) 2018-11-12 07:42:28 +01:00
ff87857f40 Change semantics of f32/f64.MIN_VALUE to match JS's Number.MIN_VALUE
* Also renames MIN_POSITIVE_VALUE to MIN_NORMAL_VALUE
* Also adds POSITIVE_INFINITY/NEGATIVE_INFINITY and NaN
2018-10-01 22:54:00 +02:00
d90cd085e5 Update Binaryen 2018-09-13 23:10:49 +02:00
a1b75b69b7 Rename memory instructions; Rework constant handling 2018-07-18 23:49:32 +02:00
3b0fd9aac2 Implement isDefined and isConstant builtins 2018-07-14 16:42:00 +02:00
9c16363796 Initial external decorator for annotating explicit import names; Use file name as default module name in imports; Emit empty memory if there are no static segments; Update TLSF and examples accordingly 2018-06-28 01:44:32 +02:00
7ad13f9d65 Add a 'call_indirect' builtin to emit arbitrary calls (might trap at runtime); Optimize 'for' loop compilation a bit 2018-05-25 15:59:17 +02:00
2aea14b518 Add more inline-assembler-ish builtins; Update Binaryen 2018-04-27 19:12:25 +02:00
06f99406be Experimenting with inline-assembler-ish explicit builtins
Starting with explicit loads and stores as part of the respective type namespaces. Might become handy for use with portable code, because these can be polyfilled, while load<T> and store<T> can't.
2018-04-27 00:08:41 +02:00
ee73a4d28f Initial type parameter inference, see #61
This catches the most common cases but doesn't yet implement inference involving the return type because some prequesites are not yet in place (see test case).
2018-04-13 12:25:27 +02:00
748e811137 Proper isNaN/isFinite without a temp. local 2018-04-12 20:40:00 +02:00
dcc0e284fb Make type checking builtins also accept just a type argument 2018-04-07 23:31:36 +02:00
164f134053 Even more math (#56)
Remaining implementations of JavaScript's Math functions (except sin/cos/tan), both double (Math) and single (Mathf) precision, ported from musl incl. tests from libc-test, plus some changes to match JS semantics. Also binds fmod to `%` and pow to `**`.
2018-03-30 17:25:54 +02:00
c80bf35747 Move fmod/fmodf to builtins and bind them to the '%' operator 2018-03-24 18:39:20 +01:00
664f2a1c0d Add offsetof<T> builtin; Put a function's trampoline into the function table if a it has optional parameters; TypedArray scaffolding 2018-03-24 00:38:49 +01:00
49f4d3dff1 Eliminate @builtin decorator for compatibility with TS 2018-03-21 16:29:08 +01:00
83e96892f2 Statically eliminate unnecessary branches in generic contexts
In order to use the new compile time type checks in generics, untaken branches must be skipped because these might be invalid.
2018-03-17 14:40:58 +01:00
2ed9fac171 Initial compile time type check builtins 2018-03-17 12:54:37 +01:00
2fa7fc7885 Take advantage of smaller integer load and store ops 2018-01-23 15:44:25 +01:00
a257b6e529 Load/store constant offset utility 2018-01-21 16:34:50 +01:00
dd596b015d Simplify reinterpret to require one type argument only, fixes #9 2018-01-13 01:15:09 +01:00
1221ff129d More built-in constants; Get/set parsing fixes; I64.toF64 fixes 2018-01-02 21:41:25 +01:00
2888ba14ad PSON decoder example using namespaced imports 2017-12-30 05:11:58 +01:00
ad1fbcf5b2 A first take on imported built-ins 2017-12-12 01:35:48 +01:00
f045975a4b Built-in abs/min/max for integers; For-loop fixes 2017-12-05 22:47:20 +01:00
b7030d4dea reinterpret and select builtins 2017-12-04 22:47:08 +01:00
df3e34f2aa More options for asc 2017-12-04 19:26:50 +01:00
c6af2d1454 Implement ternary using if, see AssemblyScript/assemblyscript#123 2017-12-04 14:49:24 +01:00
63a67e7c67 sizeof, load and store builtins 2017-12-04 02:00:48 +01:00
017efc71b6 Fixes; Builtins; Testing in the interpreter 2017-12-03 23:04:33 +01:00