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
This commit is contained in:
Daniel Wirtz
2018-12-07 14:33:32 +01:00
committed by GitHub
parent d7f4874650
commit ebae7cbd73
39 changed files with 4698 additions and 4128 deletions

View File

@ -3304,7 +3304,7 @@
if
i32.const 0
i32.const 976
i32.const 45
i32.const 46
i32.const 39
call $~lib/env/abort
unreachable
@ -3452,7 +3452,7 @@
if
i32.const 0
i32.const 976
i32.const 184
i32.const 185
i32.const 42
call $~lib/env/abort
unreachable
@ -3469,10 +3469,10 @@
get_local $0
get_local $3
i32.store offset=4
get_local $4
get_local $2
i32.const 2
i32.shl
get_local $4
i32.add
get_local $1
i32.store offset=8
@ -3787,20 +3787,20 @@
i32.shl
get_local $0
i32.add
get_local $3
get_local $4
i32.const 100
i32.div_u
i32.const 2
i32.shl
get_local $3
i32.add
i64.load32_u offset=8
get_local $3
get_local $4
i32.const 100
i32.rem_u
i32.const 2
i32.shl
get_local $3
i32.add
i64.load32_u offset=8
i64.const 32
@ -3830,10 +3830,10 @@
i32.shl
get_local $0
i32.add
get_local $3
get_local $4
i32.const 2
i32.shl
get_local $3
i32.add
i32.load offset=8
i32.store offset=4
@ -3849,10 +3849,10 @@
i32.shl
get_local $0
i32.add
get_local $3
get_local $1
i32.const 2
i32.shl
get_local $3
i32.add
i32.load offset=8
i32.store offset=4
@ -4022,6 +4022,7 @@
i32.shl
get_local $0
i32.add
get_local $3
get_local $4
i32.const 10000
i32.rem_u
@ -4030,15 +4031,14 @@
i32.div_u
i32.const 2
i32.shl
get_local $3
i32.add
i64.load32_u offset=8
get_local $3
get_local $4
i32.const 100
i32.rem_u
i32.const 2
i32.shl
get_local $3
i32.add
i64.load32_u offset=8
i64.const 32
@ -4053,16 +4053,16 @@
i32.shl
get_local $0
i32.add
get_local $3
get_local $6
i32.const 2
i32.shl
get_local $3
i32.add
i64.load32_u offset=8
get_local $3
get_local $5
i32.const 2
i32.shl
get_local $3
i32.add
i64.load32_u offset=8
i64.const 32
@ -4374,10 +4374,10 @@
get_local $9
i32.add
set_global $~lib/internal/number/_K
get_local $12
get_local $9
i32.const 2
i32.shl
get_local $12
i32.add
i64.load32_u offset=8
get_local $11
@ -4503,12 +4503,12 @@
get_local $9
i32.add
set_global $~lib/internal/number/_K
get_local $12
i32.const 0
get_local $9
i32.sub
i32.const 2
i32.shl
get_local $12
i32.add
i64.load32_u offset=8
get_local $8
@ -4521,9 +4521,9 @@
i32.shl
get_local $0
i32.add
tee_local $4
tee_local $7
i32.load16_u offset=4
set_local $7
set_local $4
loop $continue|4
get_local $1
get_local $8
@ -4561,10 +4561,10 @@
end
get_local $2
if
get_local $7
get_local $4
i32.const 1
i32.sub
set_local $7
set_local $4
get_local $1
get_local $10
i64.add
@ -4572,8 +4572,8 @@
br $continue|4
end
end
get_local $4
get_local $7
get_local $4
i32.store16 offset=4
get_local $6
else
@ -4979,10 +4979,10 @@
i32.add
i64.load offset=8
set_global $~lib/internal/number/_frc_pow
get_local $4
get_local $5
i32.const 1
i32.shl
get_local $4
i32.add
i32.load16_s offset=8
set_global $~lib/internal/number/_exp_pow