Resolve string instances to the program's string class

This commit is contained in:
dcodeIO
2018-04-06 00:19:45 +02:00
parent 70a0123554
commit 6268b92eba
13 changed files with 103 additions and 31 deletions

View File

@ -15,7 +15,7 @@
(global $std/string/nullStr (mut i32) (i32.const 0))
(global $argumentCount (mut i32) (i32.const 0))
(global $std/string/c (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 372))
(global $HEAP_BASE i32 (i32.const 384))
(memory $0 1)
(data (i32.const 4) "\10\00\00\00h\00i\00,\00 \00I\00\'\00m\00 \00a\00 \00s\00t\00r\00i\00n\00g")
(data (i32.const 40) "\0d\00\00\00s\00t\00d\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s")
@ -43,6 +43,7 @@
(data (i32.const 344) "\02\00\00\00b\00a")
(data (i32.const 352) "\02\00\00\00a\00a")
(data (i32.const 360) "\03\00\00\00a\00b\00c")
(data (i32.const 372) "\03\00\00\001\002\003")
(export "getString" (func $std/string/getString))
(export "memory" (memory $0))
(start $start)
@ -154,7 +155,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 234)
(i32.const 235)
(i32.const 4)
)
(unreachable)
@ -374,7 +375,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 213)
(i32.const 214)
(i32.const 4)
)
(unreachable)
@ -1085,7 +1086,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 558)
(i32.const 559)
(i32.const 10)
)
(unreachable)
@ -3263,14 +3264,17 @@
(func $~lib/string/String.__eq (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(if
(get_local $0)
(if
(i32.eqz
(get_local $1)
)
(return
(i32.const 0)
)
(i32.eq
(get_local $0)
(get_local $1)
)
(return
(i32.const 1)
)
)
(if
(i32.eqz
(get_local $0)
)
(return
(i32.eqz
@ -3278,6 +3282,14 @@
)
)
)
(if
(i32.eqz
(get_local $1)
)
(return
(i32.const 0)
)
)
(if
(i32.ne
(tee_local $2
@ -4402,5 +4414,22 @@
(unreachable)
)
)
(if
(i32.ne
(i32.load
(i32.const 372)
)
(i32.const 3)
)
(block
(call $abort
(i32.const 0)
(i32.const 40)
(i32.const 64)
(i32.const 0)
)
(unreachable)
)
)
)
)