578 lines
16 KiB
Plaintext
Raw Normal View History

2018-02-17 11:09:22 +01:00
(module
2018-05-06 01:32:58 +02:00
(type $v (func))
(type $iv (func (param i32)))
2018-02-17 11:09:22 +01:00
(type $iiv (func (param i32 i32)))
(type $fv (func (param f32)))
(type $Fv (func (param f64)))
(type $i (func (result i32)))
(type $I (func (result i64)))
(memory $0 0)
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "pson" "onNull" (func $assembly/pson/onNull))
(import "pson" "onTrue" (func $assembly/pson/onTrue))
(import "pson" "onFalse" (func $assembly/pson/onFalse))
(import "pson" "onEObject" (func $assembly/pson/onEObject))
(import "pson" "onEArray" (func $assembly/pson/onEArray))
(import "pson" "onEString" (func $assembly/pson/onEString))
(import "pson" "onObject" (func $assembly/pson/onObject (param i32)))
(import "pson" "onArray" (func $assembly/pson/onArray (param i32)))
(import "pson" "onInteger" (func $assembly/pson/onInteger (param i32)))
(import "pson" "onLong" (func $assembly/pson/onLong (param i32 i32)))
(import "pson" "onFloat" (func $assembly/pson/onFloat (param f32)))
(import "pson" "onDouble" (func $assembly/pson/onDouble (param f64)))
(import "pson" "onString" (func $assembly/pson/onString (param i32 i32)))
(import "pson" "onBinary" (func $assembly/pson/onBinary (param i32 i32)))
2018-02-17 11:09:22 +01:00
(global $assembly/pson/offset (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(export "onNull" (func $assembly/pson/onNull))
(export "onTrue" (func $assembly/pson/onTrue))
(export "onFalse" (func $assembly/pson/onFalse))
(export "onEObject" (func $assembly/pson/onEObject))
(export "onEArray" (func $assembly/pson/onEArray))
(export "onEString" (func $assembly/pson/onEString))
(export "onObject" (func $assembly/pson/onObject))
(export "onArray" (func $assembly/pson/onArray))
(export "onInteger" (func $assembly/pson/onInteger))
(export "onLong" (func $assembly/pson/onLong))
(export "onFloat" (func $assembly/pson/onFloat))
(export "onDouble" (func $assembly/pson/onDouble))
(export "onString" (func $assembly/pson/onString))
(export "onBinary" (func $assembly/pson/onBinary))
2018-02-17 11:09:22 +01:00
(export "decode" (func $assembly/pson/decode))
(func $assembly/pson/readVarint32 (; 14 ;) (; has Stack IR ;) (type $i) (result i32)
2018-02-17 11:09:22 +01:00
(local $0 i32)
(local $1 i32)
(local $2 i32)
(loop $continue|0
;;@ assembly/pson.ts:138:4
2018-02-17 11:09:22 +01:00
(set_local $0
(i32.or
(get_local $0)
;;@ assembly/pson.ts:137:17
2018-02-17 11:09:22 +01:00
(block (result i32)
(set_global $assembly/pson/offset
(i32.add
(tee_local $0
(get_global $assembly/pson/offset)
)
(i32.const 1)
)
)
;;@ assembly/pson.ts:138:13
2018-02-17 11:09:22 +01:00
(i32.shl
(i32.and
;;@ assembly/pson.ts:137:4
2018-02-17 11:09:22 +01:00
(tee_local $2
;;@ assembly/pson.ts:137:8
2018-02-17 11:09:22 +01:00
(i32.load8_u
(get_local $0)
)
)
;;@ assembly/pson.ts:138:23
2018-02-17 11:09:22 +01:00
(i32.const 127)
)
;;@ assembly/pson.ts:138:37
2018-02-17 11:09:22 +01:00
(block (result i32)
(set_local $1
(i32.add
(tee_local $0
(get_local $1)
)
(i32.const 1)
)
)
;;@ assembly/pson.ts:138:32
2018-02-17 11:09:22 +01:00
(i32.mul
(get_local $0)
;;@ assembly/pson.ts:138:33
2018-02-17 11:09:22 +01:00
(i32.const 7)
)
)
)
)
)
)
(br_if $continue|0
;;@ assembly/pson.ts:139:11
2018-02-17 11:09:22 +01:00
(i32.and
(get_local $2)
;;@ assembly/pson.ts:139:15
2018-02-17 11:09:22 +01:00
(i32.const 128)
)
)
)
;;@ assembly/pson.ts:140:9
2018-02-17 11:09:22 +01:00
(get_local $0)
)
(func $assembly/pson/readVarint64 (; 15 ;) (; has Stack IR ;) (type $I) (result i64)
2018-02-17 11:09:22 +01:00
(local $0 i64)
(local $1 i32)
(local $2 i64)
(loop $continue|0
;;@ assembly/pson.ts:149:4
2018-02-17 11:09:22 +01:00
(set_local $0
(i64.or
(get_local $0)
;;@ assembly/pson.ts:148:17
2018-02-17 11:09:22 +01:00
(block (result i64)
(set_global $assembly/pson/offset
(i32.add
(tee_local $1
(get_global $assembly/pson/offset)
)
(i32.const 1)
)
)
(set_local $2
(i64.add
(tee_local $0
;;@ assembly/pson.ts:149:37
2018-02-17 11:09:22 +01:00
(get_local $2)
)
(i64.const 1)
)
)
;;@ assembly/pson.ts:149:13
2018-02-17 11:09:22 +01:00
(i64.shl
(i64.extend_u/i32
;;@ assembly/pson.ts:149:19
2018-02-17 11:09:22 +01:00
(i32.and
;;@ assembly/pson.ts:148:4
2018-02-17 11:09:22 +01:00
(tee_local $1
;;@ assembly/pson.ts:148:8
2018-02-17 11:09:22 +01:00
(i32.load8_u
(get_local $1)
)
)
;;@ assembly/pson.ts:149:23
2018-02-17 11:09:22 +01:00
(i32.const 127)
)
)
;;@ assembly/pson.ts:149:32
2018-02-17 11:09:22 +01:00
(i64.mul
(get_local $0)
;;@ assembly/pson.ts:149:33
2018-02-17 11:09:22 +01:00
(i64.const 7)
)
)
)
)
)
(br_if $continue|0
;;@ assembly/pson.ts:150:11
2018-02-17 11:09:22 +01:00
(i32.and
(get_local $1)
;;@ assembly/pson.ts:150:15
2018-02-17 11:09:22 +01:00
(i32.const 128)
)
)
)
;;@ assembly/pson.ts:151:9
2018-02-17 11:09:22 +01:00
(get_local $0)
)
(func $assembly/pson/decodeValue (; 16 ;) (; has Stack IR ;) (type $v)
2018-02-17 11:09:22 +01:00
(local $0 i32)
(local $1 i32)
(local $2 i64)
;;@ assembly/pson.ts:49:2
2018-02-17 11:09:22 +01:00
(block $break|0
(block $case16|0
(block $case15|0
(block $case14|0
(block $case12|0
(block $case11|0
(block $case10|0
(block $case9|0
(block $case8|0
(block $case7|0
(block $case6|0
(block $case5|0
(block $case4|0
(block $case3|0
(block $case2|0
(block $case1|0
(if
;;@ assembly/pson.ts:46:28
(block (result i32)
2018-02-17 11:09:22 +01:00
(set_global $assembly/pson/offset
(i32.add
(tee_local $1
(get_global $assembly/pson/offset)
)
(i32.const 1)
)
)
(i32.ne
(tee_local $1
;;@ assembly/pson.ts:46:2
(tee_local $0
;;@ assembly/pson.ts:46:19
(i32.load8_u
(get_local $1)
2018-02-17 11:09:22 +01:00
)
)
)
(i32.const 240)
2018-02-17 11:09:22 +01:00
)
)
(block
(block $tablify|0
(br_table $case1|0 $case2|0 $case3|0 $case4|0 $case5|0 $case6|0 $case7|0 $case8|0 $case9|0 $case10|0 $case11|0 $case12|0 $tablify|0
(i32.sub
(get_local $1)
(i32.const 241)
)
2018-02-17 11:09:22 +01:00
)
)
(br_if $case14|0
(i32.or
(i32.eq
(get_local $1)
(i32.const 253)
)
(i32.eq
(get_local $1)
(i32.const 254)
)
)
)
(br_if $case15|0
2018-02-17 11:09:22 +01:00
(i32.eq
(get_local $1)
(i32.const 255)
2018-02-17 11:09:22 +01:00
)
)
(br $case16|0)
2018-02-17 11:09:22 +01:00
)
)
;;@ assembly/pson.ts:51:6
(call $assembly/pson/onNull)
;;@ assembly/pson.ts:52:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:55:6
(call $assembly/pson/onTrue)
;;@ assembly/pson.ts:56:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:59:6
(call $assembly/pson/onFalse)
;;@ assembly/pson.ts:60:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:63:6
(call $assembly/pson/onEObject)
;;@ assembly/pson.ts:64:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:67:6
(call $assembly/pson/onEArray)
;;@ assembly/pson.ts:68:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:71:6
(call $assembly/pson/onEString)
;;@ assembly/pson.ts:72:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:75:6
(call $assembly/pson/onObject
;;@ assembly/pson.ts:75:15
2018-02-17 11:09:22 +01:00
(tee_local $0
;;@ assembly/pson.ts:75:22
2018-02-17 11:09:22 +01:00
(call $assembly/pson/readVarint32)
)
)
(loop $continue|1
(if
;;@ assembly/pson.ts:76:13
2018-02-17 11:09:22 +01:00
(block (result i32)
(set_local $0
(i32.sub
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(get_local $1)
)
(block
;;@ assembly/pson.ts:77:8
2018-02-17 11:09:22 +01:00
(call $assembly/pson/decodeValue)
;;@ assembly/pson.ts:78:8
(call $assembly/pson/decodeValue)
2018-02-17 11:09:22 +01:00
(br $continue|1)
)
)
)
;;@ assembly/pson.ts:80:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:83:6
(call $assembly/pson/onArray
;;@ assembly/pson.ts:83:14
2018-02-17 11:09:22 +01:00
(tee_local $0
;;@ assembly/pson.ts:83:21
2018-02-17 11:09:22 +01:00
(call $assembly/pson/readVarint32)
)
)
(loop $continue|2
(if
;;@ assembly/pson.ts:84:13
2018-02-17 11:09:22 +01:00
(block (result i32)
(set_local $0
(i32.sub
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(get_local $1)
)
(block
;;@ assembly/pson.ts:84:21
2018-02-17 11:09:22 +01:00
(call $assembly/pson/decodeValue)
(br $continue|2)
)
)
)
;;@ assembly/pson.ts:85:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:88:6
(call $assembly/pson/onInteger
;;@ assembly/pson.ts:88:16
2018-02-17 11:09:22 +01:00
(i32.xor
(i32.shr_u
;;@ assembly/pson.ts:88:17
2018-02-17 11:09:22 +01:00
(tee_local $0
;;@ assembly/pson.ts:88:25
2018-02-17 11:09:22 +01:00
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:88:44
2018-02-17 11:09:22 +01:00
(i32.const 1)
)
;;@ assembly/pson.ts:88:49
2018-02-17 11:09:22 +01:00
(i32.sub
(i32.const 0)
;;@ assembly/pson.ts:88:50
2018-02-17 11:09:22 +01:00
(i32.and
;;@ assembly/pson.ts:88:51
2018-02-17 11:09:22 +01:00
(get_local $0)
;;@ assembly/pson.ts:88:58
2018-02-17 11:09:22 +01:00
(i32.const 1)
)
)
)
)
;;@ assembly/pson.ts:89:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:93:6
(call $assembly/pson/onLong
;;@ assembly/pson.ts:93:13
2018-02-17 11:09:22 +01:00
(i32.wrap/i64
;;@ assembly/pson.ts:92:6
2018-02-17 11:09:22 +01:00
(tee_local $2
;;@ assembly/pson.ts:92:13
2018-02-17 11:09:22 +01:00
(i64.xor
(i64.shr_u
;;@ assembly/pson.ts:92:14
2018-02-17 11:09:22 +01:00
(tee_local $2
;;@ assembly/pson.ts:92:22
2018-02-17 11:09:22 +01:00
(call $assembly/pson/readVarint64)
)
;;@ assembly/pson.ts:92:41
2018-02-17 11:09:22 +01:00
(i64.const 1)
)
;;@ assembly/pson.ts:92:46
2018-02-17 11:09:22 +01:00
(i64.sub
(i64.const 0)
;;@ assembly/pson.ts:92:47
2018-02-17 11:09:22 +01:00
(i64.and
;;@ assembly/pson.ts:92:48
2018-02-17 11:09:22 +01:00
(get_local $2)
;;@ assembly/pson.ts:92:55
2018-02-17 11:09:22 +01:00
(i64.const 1)
)
)
)
)
)
;;@ assembly/pson.ts:93:24
2018-02-17 11:09:22 +01:00
(i32.wrap/i64
;;@ assembly/pson.ts:93:30
2018-02-17 11:09:22 +01:00
(i64.shr_u
(get_local $2)
;;@ assembly/pson.ts:93:39
2018-02-17 11:09:22 +01:00
(i64.const 32)
)
)
)
;;@ assembly/pson.ts:94:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:97:6
(call $assembly/pson/onFloat
;;@ assembly/pson.ts:97:14
2018-02-17 11:09:22 +01:00
(f32.load
;;@ assembly/pson.ts:97:24
2018-02-17 11:09:22 +01:00
(get_global $assembly/pson/offset)
)
)
;;@ assembly/pson.ts:98:6
2018-02-17 11:09:22 +01:00
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:98:16
2018-02-17 11:09:22 +01:00
(i32.const 4)
)
)
;;@ assembly/pson.ts:99:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:102:6
(call $assembly/pson/onDouble
;;@ assembly/pson.ts:102:15
2018-02-17 11:09:22 +01:00
(f64.load
;;@ assembly/pson.ts:102:25
2018-02-17 11:09:22 +01:00
(get_global $assembly/pson/offset)
)
)
;;@ assembly/pson.ts:103:6
2018-02-17 11:09:22 +01:00
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:103:16
2018-02-17 11:09:22 +01:00
(i32.const 8)
)
)
;;@ assembly/pson.ts:104:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:107:6
2018-02-17 11:09:22 +01:00
(set_local $0
;;@ assembly/pson.ts:107:13
2018-02-17 11:09:22 +01:00
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:108:6
(call $assembly/pson/onString
;;@ assembly/pson.ts:108:15
2018-02-17 11:09:22 +01:00
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:108:23
2018-02-17 11:09:22 +01:00
(get_local $0)
)
;;@ assembly/pson.ts:109:6
2018-02-17 11:09:22 +01:00
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:109:16
2018-02-17 11:09:22 +01:00
(get_local $0)
)
)
;;@ assembly/pson.ts:110:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:115:6
2018-02-17 11:09:22 +01:00
(unreachable)
)
;;@ assembly/pson.ts:119:6
2018-02-17 11:09:22 +01:00
(set_local $0
;;@ assembly/pson.ts:119:13
2018-02-17 11:09:22 +01:00
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:120:6
(call $assembly/pson/onBinary
;;@ assembly/pson.ts:120:15
2018-02-17 11:09:22 +01:00
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:120:23
2018-02-17 11:09:22 +01:00
(get_local $0)
)
;;@ assembly/pson.ts:121:6
2018-02-17 11:09:22 +01:00
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:121:16
2018-02-17 11:09:22 +01:00
(get_local $0)
)
)
;;@ assembly/pson.ts:122:6
2018-02-17 11:09:22 +01:00
(br $break|0)
)
;;@ assembly/pson.ts:125:6
2018-02-17 11:09:22 +01:00
(if
;;@ assembly/pson.ts:125:10
2018-02-17 11:09:22 +01:00
(i32.gt_u
(get_local $0)
(i32.const 239)
)
;;@ assembly/pson.ts:125:34
2018-02-17 11:09:22 +01:00
(unreachable)
)
;;@ assembly/pson.ts:126:6
(call $assembly/pson/onInteger
;;@ assembly/pson.ts:126:16
2018-02-17 11:09:22 +01:00
(i32.xor
(i32.shr_u
;;@ assembly/pson.ts:126:17
2018-02-17 11:09:22 +01:00
(get_local $0)
;;@ assembly/pson.ts:126:26
2018-02-17 11:09:22 +01:00
(i32.const 1)
)
;;@ assembly/pson.ts:126:31
2018-02-17 11:09:22 +01:00
(i32.sub
(i32.const 0)
;;@ assembly/pson.ts:126:32
2018-02-17 11:09:22 +01:00
(i32.and
;;@ assembly/pson.ts:126:33
2018-02-17 11:09:22 +01:00
(get_local $0)
;;@ assembly/pson.ts:126:41
2018-02-17 11:09:22 +01:00
(i32.const 1)
)
)
)
)
)
)
(func $assembly/pson/decode (; 17 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
;;@ assembly/pson.ts:40:2
2018-02-17 11:09:22 +01:00
(set_global $assembly/pson/offset
;;@ assembly/pson.ts:40:11
2018-02-17 11:09:22 +01:00
(i32.const 0)
)
(loop $continue|0
(if
;;@ assembly/pson.ts:41:9
2018-02-17 11:09:22 +01:00
(i32.lt_u
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:41:18
2018-02-17 11:09:22 +01:00
(get_local $0)
)
(block
;;@ assembly/pson.ts:41:26
2018-02-17 11:09:22 +01:00
(call $assembly/pson/decodeValue)
(br $continue|0)
)
)
)
;;@ assembly/pson.ts:42:2
2018-02-17 11:09:22 +01:00
(if
;;@ assembly/pson.ts:42:6
2018-02-17 11:09:22 +01:00
(i32.ne
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:42:16
2018-02-17 11:09:22 +01:00
(get_local $0)
)
;;@ assembly/pson.ts:42:24
2018-05-06 01:32:58 +02:00
(unreachable)
2018-02-17 11:09:22 +01:00
)
)
(func $null (; 18 ;) (; has Stack IR ;) (type $v)
(nop)
)
2018-02-17 11:09:22 +01:00
)