mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 18:01:31 +00:00
Properly resolve top level enums to i32s, see #116
This commit is contained in:
@ -9,11 +9,10 @@
|
||||
(global $std/string-utf8/str (mut i32) (i32.const 8))
|
||||
(global $std/string-utf8/len (mut i32) (i32.const 0))
|
||||
(global $std/string-utf8/ptr (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 96))
|
||||
(global $HEAP_BASE i32 (i32.const 64))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\06\00\00\00\01\d87\dch\00i\00R\d8b\df")
|
||||
(data (i32.const 24) "\12\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00-\00u\00t\00f\008\00.\00t\00s")
|
||||
(data (i32.const 64) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s")
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $~lib/string/String#get:lengthUTF8 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
@ -21,17 +20,17 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(set_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(set_local $4
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(set_local $1
|
||||
(i32.const 1)
|
||||
)
|
||||
(loop $continue|0
|
||||
(if
|
||||
(i32.lt_s
|
||||
(i32.lt_u
|
||||
(get_local $2)
|
||||
(get_local $4)
|
||||
)
|
||||
@ -243,29 +242,26 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
(local $8 i32)
|
||||
(set_local $5
|
||||
(call $~lib/allocator/arena/allocate_memory
|
||||
(tee_local $6
|
||||
(call $~lib/string/String#get:lengthUTF8
|
||||
(get_local $0)
|
||||
)
|
||||
(call $~lib/string/String#get:lengthUTF8
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_local $7
|
||||
(set_local $6
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(loop $continue|0
|
||||
(if
|
||||
(i32.lt_s
|
||||
(get_local $3)
|
||||
(get_local $7)
|
||||
(i32.lt_u
|
||||
(get_local $2)
|
||||
(get_local $6)
|
||||
)
|
||||
(block
|
||||
(set_local $2
|
||||
(set_local $3
|
||||
(if (result i32)
|
||||
(i32.lt_u
|
||||
(tee_local $1
|
||||
@ -273,7 +269,7 @@
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.shl
|
||||
(get_local $3)
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
@ -285,18 +281,18 @@
|
||||
(i32.store8
|
||||
(i32.add
|
||||
(get_local $5)
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(set_local $3
|
||||
(set_local $2
|
||||
(i32.add
|
||||
(get_local $3)
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.add
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
@ -310,7 +306,7 @@
|
||||
(tee_local $4
|
||||
(i32.add
|
||||
(get_local $5)
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
(i32.or
|
||||
@ -331,14 +327,14 @@
|
||||
(i32.const 128)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(set_local $2
|
||||
(i32.add
|
||||
(get_local $3)
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.add
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
@ -346,7 +342,7 @@
|
||||
(set_local $4
|
||||
(i32.add
|
||||
(get_local $5)
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
(if
|
||||
@ -360,13 +356,13 @@
|
||||
(if
|
||||
(i32.eq
|
||||
(i32.and
|
||||
(tee_local $8
|
||||
(tee_local $7
|
||||
(i32.load16_u offset=4
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.shl
|
||||
(i32.add
|
||||
(get_local $3)
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
@ -396,7 +392,7 @@
|
||||
(i32.const 65536)
|
||||
)
|
||||
(i32.and
|
||||
(get_local $8)
|
||||
(get_local $7)
|
||||
(i32.const 1023)
|
||||
)
|
||||
)
|
||||
@ -442,15 +438,15 @@
|
||||
(i32.const 128)
|
||||
)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.add
|
||||
(get_local $2)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(i32.add
|
||||
(get_local $3)
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.add
|
||||
(get_local $2)
|
||||
(i32.const 2)
|
||||
)
|
||||
)
|
||||
@ -491,14 +487,14 @@
|
||||
(i32.const 128)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(set_local $2
|
||||
(i32.add
|
||||
(get_local $3)
|
||||
(get_local $2)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.add
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
(i32.const 3)
|
||||
)
|
||||
)
|
||||
@ -509,28 +505,10 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(get_local $2)
|
||||
(i32.sub
|
||||
(get_local $6)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 64)
|
||||
(i32.const 471)
|
||||
(i32.const 4)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(i32.store8
|
||||
(i32.add
|
||||
(get_local $5)
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
|
Reference in New Issue
Block a user