mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-17 17:01:37 +00:00
Use move_memory in std Array#unshift
This commit is contained in:
@ -2449,6 +2449,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(block
|
||||
(set_local $2
|
||||
(i32.load offset=4
|
||||
@ -2463,80 +2464,100 @@
|
||||
)
|
||||
(get_local $2)
|
||||
)
|
||||
(call $std:array/Array#__grow
|
||||
(get_local $0)
|
||||
(select
|
||||
(tee_local $3
|
||||
(i32.add
|
||||
(i32.load offset=8
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(tee_local $4
|
||||
(i32.mul
|
||||
(get_local $2)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $4)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(get_local $2)
|
||||
(block $break|0
|
||||
(block
|
||||
(block
|
||||
(set_local $5
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(loop $continue|0
|
||||
(if
|
||||
(i32.gt_u
|
||||
(get_local $5)
|
||||
(i32.const 0)
|
||||
)
|
||||
(block
|
||||
(i32.store
|
||||
(select
|
||||
(tee_local $3
|
||||
(i32.add
|
||||
(i32.load
|
||||
(i32.load offset=8
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.mul
|
||||
(get_local $5)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(i32.load
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.mul
|
||||
(i32.sub
|
||||
(get_local $5)
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $5
|
||||
(i32.sub
|
||||
(get_local $5)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(br $continue|0)
|
||||
(tee_local $4
|
||||
(i32.mul
|
||||
(get_local $2)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $3)
|
||||
(get_local $4)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(i32.gt_s
|
||||
(get_local $5)
|
||||
(i32.load offset=4
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(block
|
||||
(set_local $6
|
||||
(call $std:heap/allocate_memory
|
||||
(i32.mul
|
||||
(get_local $5)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(block
|
||||
(call $std:heap/move_memory
|
||||
(i32.add
|
||||
(get_local $6)
|
||||
(i32.const 4)
|
||||
)
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.mul
|
||||
(get_local $2)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(call $std:heap/free_memory
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.store
|
||||
(get_local $0)
|
||||
(get_local $6)
|
||||
)
|
||||
(i32.store offset=4
|
||||
(get_local $0)
|
||||
(get_local $5)
|
||||
)
|
||||
)
|
||||
(call $std:heap/move_memory
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 4)
|
||||
)
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.mul
|
||||
(get_local $2)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.store
|
||||
|
Reference in New Issue
Block a user