dcode
c92643832c
move stuff, run both untouched and optimized
2019-05-21 15:02:39 +02:00
dcode
f73d807d5a
rt hooks all over the place
...
still some work to do on optimizing away retain/release calls, but this looks promising
2019-05-15 21:17:41 +02:00
dcode
ba1a0c2369
Initial new rt integration
2019-05-12 13:50:28 +02:00
dcode
8ec51423ca
Merge branch 'master' into runtime
2019-04-08 18:37:38 +02:00
Daniel Wirtz
5b58b9aa8d
Update Binaryen to latest ( #571 )
2019-04-08 08:18:21 +02:00
dcode
e1070cee86
rtti & refactoring
2019-04-06 20:17:48 +02:00
dcode
3bcd32f3ba
directize
2019-04-02 10:12:57 +02:00
dcode
7693b543f4
optimize array literal init, warn on unsupported inlining
2019-03-19 08:20:10 +01:00
dcode
84ddd97761
if that's what's necessary
2019-03-14 06:09:49 +01:00
dcode
a5e14a0eaa
srsly
2019-03-14 05:11:03 +01:00
dcode
6163a73ab5
take a step back
2019-03-14 04:33:58 +01:00
dcode
e38f627c8b
more
2019-03-13 22:35:47 +01:00
dcode
cb77760562
unsafe, stub
2019-03-10 21:38:15 +01:00
dcode
0ad9d560e0
integrate
2019-03-09 00:40:03 +01:00
Daniel Wirtz
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
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
Max Graey
aad263e670
Add isArrayLike builtin ( #453 )
2019-02-27 21:47:52 +01:00
Daniel Wirtz
f318d68383
Add isFunction and isNullable builtins ( #504 )
2019-02-22 01:11:05 +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
Daniel Wirtz
1bd1d26152
Put atomics behind a feature flag ( #470 )
2019-02-07 18:21:09 +01:00
Nidin Vinayakan
7ce3296b5e
Add atomic built-ins ( #440 )
2019-02-07 15:25:49 +01:00
Daniel Wirtz
2131c51932
Rework constructor handling ( #446 )
2019-02-02 16:03:21 +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
dcodeIO
1149abf824
Add 'instantiate<T>' builtin (like 'new' but from a type), see #349
2018-11-29 15:28:08 +01:00
Max Graey
4e89456dcb
Add more numeric builtins ( #330 )
2018-11-12 07:42:28 +01:00
Max Graey
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
Daniel Wirtz
dc0f271fc2
Initial GC integration ( #196 )
2018-08-02 18:23:02 +02:00
dcodeIO
34839353fd
Inline isNaN and isFinite
...
Looking at our existing tests it seems that inlining these can be performed by reusing locals most of the time, and sometimes enables erasing quite a bit of unnecessary code when optimizing.
2018-07-19 04:12:40 +02:00
dcodeIO
26e46f6f86
Reintroduce builtin decorator so these can appear anywhere in stdlib again
...
Avoids wrapping an undocumented function within 'memory.size' for example.
2018-07-19 02:10:04 +02:00
dcodeIO
a1b75b69b7
Rename memory instructions; Rework constant handling
2018-07-18 23:49:32 +02:00
dcodeIO
3b0fd9aac2
Implement isDefined and isConstant builtins
2018-07-14 16:42:00 +02:00
dcodeIO
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
dcodeIO
73417a9a06
Move 'abort' out of builtins and make it overridable
...
Now defaults to 'env.abort' as imported in lib/env.ts, but can be overridden through '--use abort=someThingElseOrNothingAtAll'
2018-05-21 18:48:29 +02:00
dcodeIO
2aea14b518
Add more inline-assembler-ish builtins; Update Binaryen
2018-04-27 19:12:25 +02:00
dcodeIO
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
dcodeIO
6d6d1dddcf
Improve inlining where locals can be aliased; Add a crude mechanism for explicit unchecked array accesses
...
The `unchecked` builtin should be handled with ultimate care and it would be a lot better if there'd be a mechanism doing this automatically.
2018-04-25 05:04:35 +02:00
Max Graey
a15457d8b9
Simplify isFinite & isNaN ( #78 )
2018-04-18 15:14:24 +02:00
dcodeIO
4929fca363
Move some numeric builtins to stdlib; Minor refactoring
2018-04-17 02:50:38 +02:00
dcodeIO
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
dcodeIO
dcc0e284fb
Make type checking builtins also accept just a type argument
2018-04-07 23:31:36 +02:00
dcodeIO
06198a3723
Rename lib prefix to '~lib' (parens aren't valid); Add built-in alignof<T>; Prepare for ArrayBufferView
2018-04-02 19:05:26 +02:00
Daniel Wirtz
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
dcodeIO
c80bf35747
Move fmod/fmodf to builtins and bind them to the '%' operator
2018-03-24 18:39:20 +01:00
dcodeIO
721d77012b
Math scaffolding
2018-03-24 17:18:15 +01:00
dcodeIO
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
dcodeIO
49f4d3dff1
Eliminate @builtin
decorator for compatibility with TS
2018-03-21 16:29:08 +01:00
Max Graey
477669d7a3
Add min. normalized positive value (MIN_POSITIVE_VALUE) for floats ( #50 )
2018-03-21 01:06:56 +01:00
dcodeIO
2ed9fac171
Initial compile time type check builtins
2018-03-17 12:54:37 +01:00
dcodeIO
4633fdab96
Update binary expression inference, see #35 ; Update dependencies
2018-03-01 19:42:07 +01:00