Ensure consistent variable modifiers

'var' is a distinct local or mutable global, 'let' a shared local
This commit is contained in:
dcodeIO
2018-03-13 02:32:10 +01:00
parent 7ee6e1cf7b
commit 23a7db4dc3
33 changed files with 736 additions and 570 deletions

View File

@ -27,7 +27,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(if
(i32.eqz
(get_local $0)
@ -84,7 +83,7 @@
(i32.const 16)
)
)
(set_local $7
(set_local $5
(select
(tee_local $5
(get_local $3)
@ -101,7 +100,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $7)
(get_local $5)
)
(i32.const 0)
)

View File

@ -2164,7 +2164,7 @@
(block
(if
(i32.le_s
(tee_local $3
(tee_local $4
(select
(i32.shl
(get_local $2)
@ -2188,10 +2188,10 @@
(unreachable)
)
)
(set_local $4
(set_local $3
(call "$(lib)/allocator/arena/allocate_memory"
(i32.shl
(get_local $3)
(get_local $4)
(i32.const 2)
)
)
@ -2203,7 +2203,7 @@
(block
(call "$(lib)/memory/move_memory"
(i32.add
(get_local $4)
(get_local $3)
(i32.const 4)
)
(i32.load
@ -2223,11 +2223,11 @@
)
(i32.store
(get_local $0)
(get_local $4)
(get_local $3)
)
(i32.store offset=4
(get_local $0)
(get_local $3)
(get_local $4)
)
)
(call "$(lib)/memory/move_memory"
@ -2254,7 +2254,7 @@
)
(i32.store offset=8
(get_local $0)
(tee_local $0
(tee_local $3
(i32.add
(i32.load offset=8
(get_local $0)
@ -2263,7 +2263,7 @@
)
)
)
(get_local $0)
(get_local $3)
)
(func "$(lib)/memory/set_memory" (; 11 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i64)

View File

@ -29,7 +29,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(if
(i32.eqz
(get_local $0)
@ -86,7 +85,7 @@
(i32.const 16)
)
)
(set_local $7
(set_local $5
(select
(tee_local $5
(get_local $3)
@ -103,7 +102,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $7)
(get_local $5)
)
(i32.const 0)
)
@ -2449,7 +2448,6 @@
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(set_local $2
(i32.load offset=4
(get_local $0)
@ -2558,7 +2556,7 @@
)
(return
(block (result i32)
(set_local $5
(set_local $4
(i32.add
(i32.load offset=8
(get_local $0)
@ -2568,9 +2566,9 @@
)
(i32.store offset=8
(get_local $0)
(get_local $5)
(get_local $4)
)
(get_local $5)
(get_local $4)
)
)
)

View File

@ -19,7 +19,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(if
(i32.eqz
(get_local $0)
@ -76,7 +75,7 @@
(i32.const 16)
)
)
(set_local $7
(set_local $5
(select
(tee_local $5
(get_local $3)
@ -93,7 +92,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $7)
(get_local $5)
)
(i32.const 0)
)

View File

@ -2002,7 +2002,7 @@
(i32.shl
(tee_local $3
(select
(tee_local $2
(tee_local $3
(i32.shl
(i32.load offset=4
(get_local $0)
@ -2010,12 +2010,12 @@
(i32.const 1)
)
)
(tee_local $3
(tee_local $2
(i32.const 8)
)
(i32.gt_u
(get_local $2)
(get_local $3)
(get_local $2)
)
)
)

View File

@ -25,7 +25,6 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(if
(i32.eqz
(get_local $0)
@ -82,7 +81,7 @@
(i32.const 16)
)
)
(set_local $7
(set_local $5
(select
(tee_local $5
(get_local $3)
@ -99,7 +98,7 @@
(if
(i32.lt_s
(grow_memory
(get_local $7)
(get_local $5)
)
(i32.const 0)
)
@ -2260,8 +2259,6 @@
(func "$(lib)/set/Set#add" (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(if
(i32.eqz
(i32.ne
@ -2289,7 +2286,7 @@
)
)
(block
(set_local $4
(set_local $2
(select
(tee_local $2
(i32.shl
@ -2308,10 +2305,10 @@
)
)
)
(set_local $5
(set_local $3
(call "$(lib)/allocator/arena/allocate_memory"
(i32.mul
(get_local $4)
(get_local $2)
(i32.const 4)
)
)
@ -2322,7 +2319,7 @@
)
(block
(call "$(lib)/memory/move_memory"
(get_local $5)
(get_local $3)
(i32.load
(get_local $0)
)
@ -2342,11 +2339,11 @@
)
(i32.store offset=4
(get_local $0)
(get_local $4)
(get_local $2)
)
(i32.store
(get_local $0)
(get_local $5)
(get_local $3)
)
)
)