88 Commits

Author SHA1 Message Date
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
dcode
34d86a0d6a Replace more workarounds with actual lazy compilation in stdlib 2019-02-21 05:42:33 +01:00
Max Graey
6b495f71d0 Ensure Math.clz32/imul compatibility with JS (#474) 2019-02-21 00:32:58 +01:00
Max Graey
0041572052 Reuse respective opposite overload in std/string comparisions (#479) 2019-02-21 00:30: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
2f1a6c44ce
Add SIMD prerequisites (#469) 2019-02-07 15:26:26 +01:00
Max Graey
41a89fa773 Fix default comparator for strings (#462) 2019-02-07 12:26:45 +01:00
Daniel Wirtz
831054dfd3
Rework inlining logic (#463) 2019-02-06 23:42:43 +01:00
dcode
cd1cfe6957 Update Binaryen to latest and rebuild dist files 2019-02-05 17:12:10 +01:00
Max Graey
4829f3a3e4 Add ArrayBuffer.isView and rework Array.isArray (#431) 2019-02-03 10:41:04 +01:00
Max Graey
c7441066dc Minor math tweaks + ipow32f/ipow64f (#428) 2019-01-24 23:17:44 +01:00
Max Graey
d3715688fc Fix Math.imul and add tests (#432) 2019-01-24 01:23:53 +01:00
Max Graey
54b02c287c Fix functional Array & String methods and avoid buffer caching (#415) 2019-01-17 01:34:09 +01:00
Max Graey
d82995c686 Improve mandelbort example (#308) 2019-01-09 17:26:31 +01:00
LiaoPeng
9ec226de1b Fix possible use after free in Array#forEach if the array resizes halfway (#408) 2019-01-09 13:06:34 +01:00
dcode
20f4092eb2 Update Binaryen and other dependencies; Update dist files 2019-01-09 13:02:47 +01:00
Max Graey
8e61e0ead8 Improve reallocateUnsafe and properly free unmanaged objects (#368) 2018-12-08 23:54:45 +01:00
dcodeIO
3ed83ef3ae Use macro style for more internal helpers; Update dist files 2018-12-08 23:38:49 +01:00
Max Graey
934f05eed9 Optimize array functional loops (#359) 2018-12-07 15:37:33 +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
a661ff7d89 Update Binaryen to latest 2018-12-01 03:09:43 +01:00
Max Graey
3c5c2cef80 Fix implementation of Array#splice (#347) 2018-11-29 15:41:42 +01:00
Daniel Wirtz
c30c62e383
Cast to bool by comparing to zero (#343) 2018-11-23 15:20:52 +01:00
Max Graey
6393921c12 Fix unsafeCompare (#336) 2018-11-19 12:23:45 +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
dcodeIO
04a0cb8de7 Remove left-over line in std Array 2018-11-12 12:45:44 +01:00
Max Graey
1882679807 Implement Array.isArray and Array#copyWithin (#331) 2018-11-12 07:45:40 +01:00
Max Graey
410036e445 Use mixed Horner scheme in Math.exp/expm1 to improve instruction parallelization (#311) 2018-11-09 17:56:42 +01:00
dcodeIO
4f95dce6e2 Do not emit debug info by default
This basically flips the --noDebug flag to become a --debug flag, so some optimizations, like inlining, aren't skipped by default, which might be unexpected.
2018-11-09 12:28:10 +01:00
Daniel Wirtz
2bdc2a72f1
Use stack IR when emitting text format (#312) 2018-11-08 08:04:24 +01:00
LiaoPeng
d864977a1a Add Array#concat and add a return type for Array#push (#214) 2018-10-30 15:07:53 +01:00
Max Graey
83fa12164f Add TypedArray#fill (#274) 2018-10-26 18:28:31 +02:00
Max Graey
376afd45fc Improve Math routines; Add Mathf-specific prng (#297) 2018-10-26 00:10:17 +02:00
Max Graey
711f73b15d Implement String#split (#301) 2018-10-18 19:05:35 +02:00
Daniel Wirtz
f7c734789e
Update Binaryen to latest; Various fixes 2018-10-11 08:49:08 +02:00
Max Graey
53b030fed5 Add Array#join and Array#toString + dtoa (#275) 2018-10-01 22:57:56 +02:00
Max Graey
3f035395cd Add Array#fill (#250) 2018-09-19 00:59:22 +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
dcodeIO
4498b28442 Use outer-most identifier when resolving queued exports, fixes #248 2018-09-09 03:51:29 +02:00
Max Graey
947cee08c7 Implement <TypedArray>#sort and improve default comparator (#208) 2018-08-04 15:30:03 +02:00
dcodeIO
631478c7c9 Rework static memory segment creation; Fix stdlib gc hooks not marking own fields; Align everything to 8 bytes that might be touched by GC 2018-08-04 00:36:59 +02:00
Daniel Wirtz
dc0f271fc2
Initial GC integration (#196) 2018-08-02 18:23:02 +02:00
Max Graey
671121bf70 Implement String#padStart/padEnd; Refactor internal string copy, compare and repeat (#171) 2018-07-25 16:25:53 +02:00
Max Graey
298a8f1688 Add String.fromCodePoint and 16-bit string compare (#174) 2018-07-23 14:32:55 +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
Max Graey
29081b6323 Assert that comparator is not null in Array#sort (#155) 2018-07-14 14:56:05 +02:00
Max Graey
d7c1c608bd Implement itoa32/64 for base 10 (#151) 2018-07-13 15:40:37 +02:00
Max Graey
365884ff73 Add String#lastIndexOf and improve tests (#163) 2018-07-10 03:31:51 +02:00