Infer u32 from 32-bit integer literals if MSB is set

This commit is contained in:
dcodeIO
2018-06-21 22:47:37 +02:00
parent c74eed2bd8
commit 525795b354
12 changed files with 101 additions and 27 deletions

View File

@@ -30,16 +30,21 @@
(export "memory" (memory $0))
(start $start)
(func $~lib/symbol/Symbol#constructor (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(set_global $~lib/symbol/nextId
(i32.add
(tee_local $2
(tee_local $0
(get_global $~lib/symbol/nextId)
)
(i32.const 1)
)
)
(get_local $2)
(if
(i32.eqz
(get_local $0)
)
(unreachable)
)
(get_local $0)
)
(func $~lib/allocator/arena/allocate_memory (; 2 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
@@ -1639,6 +1644,12 @@
(i32.const 1)
)
)
(if
(i32.eqz
(get_local $1)
)
(unreachable)
)
(call $~lib/map/Map<String,usize>#set
(get_global $~lib/symbol/stringToId)
(get_local $0)