mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-17 08:51:34 +00:00
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:
@ -2412,6 +2412,7 @@
|
||||
(func $~lib/array/Array<Foo>#__set (; 28 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
get_local $0
|
||||
i32.load
|
||||
set_local $3
|
||||
@ -2430,7 +2431,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 72
|
||||
i32.const 109
|
||||
i32.const 110
|
||||
i32.const 41
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -2452,11 +2453,15 @@
|
||||
i32.add
|
||||
i32.store offset=4
|
||||
end
|
||||
i32.const 0
|
||||
set_local $5
|
||||
get_local $3
|
||||
get_local $1
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
get_local $5
|
||||
i32.add
|
||||
get_local $2
|
||||
i32.store offset=8
|
||||
get_local $0
|
||||
|
Reference in New Issue
Block a user