Add String.fromCodePoint and 16-bit string compare (#174)

This commit is contained in:
Max Graey
2018-07-23 15:32:55 +03:00
committed by Daniel Wirtz
parent 1ecf85bf7c
commit 298a8f1688
15 changed files with 3188 additions and 3191 deletions

View File

@ -59,38 +59,26 @@
)
)
)
(func $~lib/memory/memcmp (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/internal/string/compareUTF16 (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.eq
(get_local $0)
(get_local $1)
)
(return
(i32.const 0)
)
)
(loop $continue|0
(if
(tee_local $3
(i32.ne
(get_local $2)
(i32.const 0)
)
)
(set_local $3
(i32.eq
(i32.load8_u
(get_local $0)
)
(i32.load8_u
(get_local $1)
(if (result i32)
(get_local $2)
(i32.eqz
(tee_local $3
(i32.sub
(i32.load16_u offset=4
(get_local $0)
)
(i32.load16_u offset=4
(get_local $1)
)
)
)
)
(get_local $2)
)
)
(if
(get_local $3)
(block
(set_local $2
(i32.sub
@ -114,29 +102,9 @@
)
)
)
(tee_local $0
(if (result i32)
(get_local $2)
(i32.sub
(i32.load8_u
(get_local $0)
)
(i32.load8_u
(get_local $1)
)
)
(i32.const 0)
)
)
(get_local $3)
)
(func $~lib/memory/memory.compare (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(call $~lib/memory/memcmp
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $~lib/string/String#startsWith (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/string/String#startsWith (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(if
@ -147,7 +115,7 @@
(call $~lib/env/abort
(i32.const 0)
(i32.const 12)
(i32.const 265)
(i32.const 291)
(i32.const 4)
)
(unreachable)
@ -200,29 +168,20 @@
)
)
(i32.eqz
(call $~lib/memory/memory.compare
(call $~lib/internal/string/compareUTF16
(i32.add
(i32.add
(get_local $0)
(i32.const 4)
)
(get_local $0)
(i32.shl
(get_local $2)
(i32.const 1)
)
)
(i32.add
(get_local $1)
(i32.const 4)
)
(i32.shl
(get_local $4)
(i32.const 1)
)
(get_local $1)
(get_local $4)
)
)
)
(func $std/array-access/stringArrayMethodCall (; 7 ;) (type $ii) (param $0 i32) (result i32)
(func $std/array-access/stringArrayMethodCall (; 6 ;) (type $ii) (param $0 i32) (result i32)
(call $~lib/string/String#startsWith
(call $~lib/array/Array<Array<i32>>#__get
(get_local $0)
@ -232,7 +191,7 @@
(i32.const 0)
)
)
(func $std/array-access/stringArrayArrayPropertyAccess (; 8 ;) (type $ii) (param $0 i32) (result i32)
(func $std/array-access/stringArrayArrayPropertyAccess (; 7 ;) (type $ii) (param $0 i32) (result i32)
(i32.load
(call $~lib/array/Array<Array<i32>>#__get
(call $~lib/array/Array<Array<i32>>#__get
@ -243,7 +202,7 @@
)
)
)
(func $std/array-access/stringArrayArrayMethodCall (; 9 ;) (type $ii) (param $0 i32) (result i32)
(func $std/array-access/stringArrayArrayMethodCall (; 8 ;) (type $ii) (param $0 i32) (result i32)
(call $~lib/string/String#startsWith
(call $~lib/array/Array<Array<i32>>#__get
(call $~lib/array/Array<Array<i32>>#__get