Rename wast to wat

This commit is contained in:
dcodeIO 2018-02-17 11:09:22 +01:00
parent 6b459259f9
commit e50a23bf75
123 changed files with 8534 additions and 176 deletions

View File

@ -129,7 +129,7 @@ exports.main = function main(argv, options, callback) {
"Syntax: asc [entryFile ...] [options]",
"",
"Examples: asc hello.ts",
" asc hello.ts -b hello.wasm -t hello.wast",
" asc hello.ts -b hello.wasm -t hello.wat",
" asc hello1.ts hello2.ts -b -O > hello.wasm",
"",
"Options:"
@ -392,7 +392,7 @@ exports.main = function main(argv, options, callback) {
let hasStdout = false;
if (args.outFile != null) {
if (/\.wast$/.test(args.outFile) && args.textFile == null)
if (/\.was?t$/.test(args.outFile) && args.textFile == null)
args.textFile = args.outFile;
else if (/\.js$/.test(args.outFile) && args.asmjsFile == null)
args.asmjsFile = args.outFile;

View File

@ -53,7 +53,7 @@
"aliases": [ "b" ]
},
"textFile": {
"desc": "Specifies the text output file (.wast).",
"desc": "Specifies the text output file (.wat).",
"type": "string",
"aliases": [ "t" ]
},

4
dist/asc.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
examples/.gitignore vendored
View File

@ -1,4 +1,3 @@
*.wast
*.wasm
*.wasm.map
node_modules/

View File

@ -0,0 +1,377 @@
(module
(type $iiv (func (param i32 i32)))
(type $v (func))
(global $assembly/game-of-life/w (mut i32) (i32.const 0))
(global $assembly/game-of-life/h (mut i32) (i32.const 0))
(global $assembly/game-of-life/s (mut i32) (i32.const 0))
(memory $0 1)
(export "init" (func $assembly/game-of-life/init))
(export "step" (func $assembly/game-of-life/step))
(export "memory" (memory $0))
(func $assembly/game-of-life/init (; 0 ;) (type $iiv) (param $0 i32) (param $1 i32)
;;@ assembly/game-of-life.ts:9:2
(set_global $assembly/game-of-life/w
;;@ assembly/game-of-life.ts:9:6
(get_local $0)
)
;;@ assembly/game-of-life.ts:10:2
(set_global $assembly/game-of-life/h
;;@ assembly/game-of-life.ts:10:6
(get_local $1)
)
;;@ assembly/game-of-life.ts:11:2
(set_global $assembly/game-of-life/s
;;@ assembly/game-of-life.ts:11:6
(i32.mul
(get_global $assembly/game-of-life/w)
;;@ assembly/game-of-life.ts:11:10
(get_global $assembly/game-of-life/h)
)
)
)
(func $assembly/game-of-life/step (; 1 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(set_local $6
;;@ assembly/game-of-life.ts:16:12
(i32.sub
(get_global $assembly/game-of-life/h)
;;@ assembly/game-of-life.ts:16:16
(i32.const 1)
)
)
(set_local $7
;;@ assembly/game-of-life.ts:17:12
(i32.sub
(get_global $assembly/game-of-life/w)
;;@ assembly/game-of-life.ts:17:16
(i32.const 1)
)
)
(loop $continue|0
(if
;;@ assembly/game-of-life.ts:18:23
(i32.lt_u
(get_local $0)
;;@ assembly/game-of-life.ts:18:27
(get_global $assembly/game-of-life/h)
)
(block
(set_local $4
;;@ assembly/game-of-life.ts:19:14
(select
;;@ assembly/game-of-life.ts:19:31
(i32.sub
(get_local $0)
;;@ assembly/game-of-life.ts:19:35
(i32.const 1)
)
;;@ assembly/game-of-life.ts:19:26
(get_local $6)
;;@ assembly/game-of-life.ts:19:38
(get_local $0)
)
)
(set_local $5
;;@ assembly/game-of-life.ts:20:14
(select
;;@ assembly/game-of-life.ts:20:26
(i32.const 0)
;;@ assembly/game-of-life.ts:20:29
(i32.add
(get_local $0)
;;@ assembly/game-of-life.ts:20:33
(i32.const 1)
)
;;@ assembly/game-of-life.ts:20:36
(i32.eq
(get_local $0)
;;@ assembly/game-of-life.ts:20:41
(get_local $6)
)
)
)
;;@ assembly/game-of-life.ts:21:9
(set_local $1
;;@ assembly/game-of-life.ts:21:22
(i32.const 0)
)
(loop $continue|1
(if
;;@ assembly/game-of-life.ts:21:25
(i32.lt_u
(get_local $1)
;;@ assembly/game-of-life.ts:21:29
(get_global $assembly/game-of-life/w)
)
(block
;;@ assembly/game-of-life.ts:24:6
(set_local $2
;;@ assembly/game-of-life.ts:24:14
(i32.add
;;@ assembly/game-of-life.ts:25:8
(i32.add
(i32.add
(i32.add
(i32.add
(i32.add
(i32.add
(i32.load8_u
;;@ assembly/game-of-life.ts:25:17
(i32.add
(i32.mul
(get_local $4)
;;@ assembly/game-of-life.ts:25:23
(get_global $assembly/game-of-life/w)
)
(tee_local $2
;;@ assembly/game-of-life.ts:22:16
(select
;;@ assembly/game-of-life.ts:22:33
(i32.sub
(get_local $1)
;;@ assembly/game-of-life.ts:22:37
(i32.const 1)
)
;;@ assembly/game-of-life.ts:22:28
(get_local $7)
;;@ assembly/game-of-life.ts:22:40
(get_local $1)
)
)
)
)
;;@ assembly/game-of-life.ts:25:34
(i32.load8_u
;;@ assembly/game-of-life.ts:25:43
(i32.add
(i32.mul
(get_local $4)
;;@ assembly/game-of-life.ts:25:49
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:25:53
(get_local $1)
)
)
)
;;@ assembly/game-of-life.ts:25:58
(i32.load8_u
;;@ assembly/game-of-life.ts:25:67
(i32.add
(i32.mul
(get_local $4)
;;@ assembly/game-of-life.ts:25:73
(get_global $assembly/game-of-life/w)
)
(tee_local $3
;;@ assembly/game-of-life.ts:23:16
(select
;;@ assembly/game-of-life.ts:23:28
(i32.const 0)
;;@ assembly/game-of-life.ts:23:31
(i32.add
(get_local $1)
;;@ assembly/game-of-life.ts:23:35
(i32.const 1)
)
;;@ assembly/game-of-life.ts:23:38
(i32.eq
(get_local $1)
;;@ assembly/game-of-life.ts:23:43
(get_local $7)
)
)
)
)
)
)
;;@ assembly/game-of-life.ts:26:8
(i32.load8_u
;;@ assembly/game-of-life.ts:26:17
(i32.add
(i32.mul
(get_local $0)
;;@ assembly/game-of-life.ts:26:23
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:26:27
(get_local $2)
)
)
)
;;@ assembly/game-of-life.ts:26:58
(i32.load8_u
;;@ assembly/game-of-life.ts:26:67
(i32.add
(i32.mul
(get_local $0)
;;@ assembly/game-of-life.ts:26:73
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:26:77
(get_local $3)
)
)
)
;;@ assembly/game-of-life.ts:27:8
(i32.load8_u
;;@ assembly/game-of-life.ts:27:17
(i32.add
(i32.mul
(get_local $5)
;;@ assembly/game-of-life.ts:27:23
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:27:27
(get_local $2)
)
)
)
;;@ assembly/game-of-life.ts:27:34
(i32.load8_u
;;@ assembly/game-of-life.ts:27:43
(i32.add
(i32.mul
(get_local $5)
;;@ assembly/game-of-life.ts:27:49
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:27:53
(get_local $1)
)
)
)
;;@ assembly/game-of-life.ts:27:58
(i32.load8_u
;;@ assembly/game-of-life.ts:27:67
(i32.add
(i32.mul
(get_local $5)
;;@ assembly/game-of-life.ts:27:73
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:27:77
(get_local $3)
)
)
)
)
;;@ assembly/game-of-life.ts:29:6
(if
;;@ assembly/game-of-life.ts:29:10
(i32.load8_u
;;@ assembly/game-of-life.ts:29:19
(i32.add
(i32.mul
(get_local $0)
;;@ assembly/game-of-life.ts:29:23
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:29:27
(get_local $1)
)
)
;;@ assembly/game-of-life.ts:30:8
(if
;;@ assembly/game-of-life.ts:30:12
(i32.and
(if (result i32)
(tee_local $3
(i32.lt_s
(get_local $2)
;;@ assembly/game-of-life.ts:30:16
(i32.const 2)
)
)
(get_local $3)
;;@ assembly/game-of-life.ts:30:21
(i32.gt_s
(get_local $2)
;;@ assembly/game-of-life.ts:30:25
(i32.const 3)
)
)
(i32.const 1)
)
;;@ assembly/game-of-life.ts:31:10
(i32.store8
;;@ assembly/game-of-life.ts:31:20
(i32.add
(i32.add
(get_global $assembly/game-of-life/s)
;;@ assembly/game-of-life.ts:31:24
(i32.mul
(get_local $0)
;;@ assembly/game-of-life.ts:31:28
(get_global $assembly/game-of-life/w)
)
)
;;@ assembly/game-of-life.ts:31:32
(get_local $1)
)
;;@ assembly/game-of-life.ts:31:35
(i32.const 0)
)
)
;;@ assembly/game-of-life.ts:32:13
(if
;;@ assembly/game-of-life.ts:32:17
(i32.eq
(get_local $2)
;;@ assembly/game-of-life.ts:32:22
(i32.const 3)
)
;;@ assembly/game-of-life.ts:33:8
(i32.store8
;;@ assembly/game-of-life.ts:33:18
(i32.add
(i32.add
(get_global $assembly/game-of-life/s)
;;@ assembly/game-of-life.ts:33:22
(i32.mul
(get_local $0)
;;@ assembly/game-of-life.ts:33:26
(get_global $assembly/game-of-life/w)
)
)
;;@ assembly/game-of-life.ts:33:30
(get_local $1)
)
;;@ assembly/game-of-life.ts:33:33
(i32.const 1)
)
)
)
;;@ assembly/game-of-life.ts:21:32
(set_local $1
(i32.add
;;@ assembly/game-of-life.ts:21:34
(get_local $1)
(i32.const 1)
)
)
(br $continue|1)
)
)
)
;;@ assembly/game-of-life.ts:18:30
(set_local $0
(i32.add
;;@ assembly/game-of-life.ts:18:32
(get_local $0)
(i32.const 1)
)
)
(br $continue|0)
)
)
)
)
)

View File

@ -0,0 +1,417 @@
(module
(type $iiv (func (param i32 i32)))
(type $v (func))
(global $assembly/game-of-life/w (mut i32) (i32.const 0))
(global $assembly/game-of-life/h (mut i32) (i32.const 0))
(global $assembly/game-of-life/s (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "init" (func $assembly/game-of-life/init))
(export "step" (func $assembly/game-of-life/step))
(export "memory" (memory $0))
(func $assembly/game-of-life/init (; 0 ;) (type $iiv) (param $0 i32) (param $1 i32)
;;@ assembly/game-of-life.ts:9:2
(set_global $assembly/game-of-life/w
;;@ assembly/game-of-life.ts:9:6
(get_local $0)
)
;;@ assembly/game-of-life.ts:10:2
(set_global $assembly/game-of-life/h
;;@ assembly/game-of-life.ts:10:6
(get_local $1)
)
;;@ assembly/game-of-life.ts:11:2
(set_global $assembly/game-of-life/s
;;@ assembly/game-of-life.ts:11:6
(i32.mul
(get_global $assembly/game-of-life/w)
;;@ assembly/game-of-life.ts:11:10
(get_global $assembly/game-of-life/h)
)
)
)
(func $assembly/game-of-life/step (; 1 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i32)
;;@ assembly/game-of-life.ts:16:2
(block
(set_local $0
;;@ assembly/game-of-life.ts:16:12
(i32.sub
(get_global $assembly/game-of-life/h)
;;@ assembly/game-of-life.ts:16:16
(i32.const 1)
)
)
(set_local $1
;;@ assembly/game-of-life.ts:17:12
(i32.sub
(get_global $assembly/game-of-life/w)
;;@ assembly/game-of-life.ts:17:16
(i32.const 1)
)
)
)
;;@ assembly/game-of-life.ts:18:2
(block $break|0
;;@ assembly/game-of-life.ts:18:7
(set_local $2
;;@ assembly/game-of-life.ts:18:20
(i32.const 0)
)
(loop $continue|0
(if
;;@ assembly/game-of-life.ts:18:23
(i32.lt_u
(get_local $2)
;;@ assembly/game-of-life.ts:18:27
(get_global $assembly/game-of-life/h)
)
(block
(block
(block
(set_local $3
;;@ assembly/game-of-life.ts:19:14
(select
;;@ assembly/game-of-life.ts:19:26
(get_local $0)
;;@ assembly/game-of-life.ts:19:31
(i32.sub
(get_local $2)
;;@ assembly/game-of-life.ts:19:35
(i32.const 1)
)
;;@ assembly/game-of-life.ts:19:38
(i32.eq
(get_local $2)
;;@ assembly/game-of-life.ts:19:43
(i32.const 0)
)
)
)
(set_local $4
;;@ assembly/game-of-life.ts:20:14
(select
;;@ assembly/game-of-life.ts:20:26
(i32.const 0)
;;@ assembly/game-of-life.ts:20:29
(i32.add
(get_local $2)
;;@ assembly/game-of-life.ts:20:33
(i32.const 1)
)
;;@ assembly/game-of-life.ts:20:36
(i32.eq
(get_local $2)
;;@ assembly/game-of-life.ts:20:41
(get_local $0)
)
)
)
)
;;@ assembly/game-of-life.ts:21:4
(block $break|1
;;@ assembly/game-of-life.ts:21:9
(set_local $5
;;@ assembly/game-of-life.ts:21:22
(i32.const 0)
)
(loop $continue|1
(if
;;@ assembly/game-of-life.ts:21:25
(i32.lt_u
(get_local $5)
;;@ assembly/game-of-life.ts:21:29
(get_global $assembly/game-of-life/w)
)
(block
(block
(block
(set_local $6
;;@ assembly/game-of-life.ts:22:16
(select
;;@ assembly/game-of-life.ts:22:28
(get_local $1)
;;@ assembly/game-of-life.ts:22:33
(i32.sub
(get_local $5)
;;@ assembly/game-of-life.ts:22:37
(i32.const 1)
)
;;@ assembly/game-of-life.ts:22:40
(i32.eq
(get_local $5)
;;@ assembly/game-of-life.ts:22:45
(i32.const 0)
)
)
)
(set_local $7
;;@ assembly/game-of-life.ts:23:16
(select
;;@ assembly/game-of-life.ts:23:28
(i32.const 0)
;;@ assembly/game-of-life.ts:23:31
(i32.add
(get_local $5)
;;@ assembly/game-of-life.ts:23:35
(i32.const 1)
)
;;@ assembly/game-of-life.ts:23:38
(i32.eq
(get_local $5)
;;@ assembly/game-of-life.ts:23:43
(get_local $1)
)
)
)
)
;;@ assembly/game-of-life.ts:24:6
(set_local $8
;;@ assembly/game-of-life.ts:24:14
(i32.add
;;@ assembly/game-of-life.ts:25:8
(i32.add
(i32.add
(i32.add
(i32.add
(i32.add
(i32.add
(i32.load8_u
;;@ assembly/game-of-life.ts:25:17
(i32.add
(i32.mul
(get_local $3)
;;@ assembly/game-of-life.ts:25:23
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:25:27
(get_local $6)
)
)
;;@ assembly/game-of-life.ts:25:34
(i32.load8_u
;;@ assembly/game-of-life.ts:25:43
(i32.add
(i32.mul
(get_local $3)
;;@ assembly/game-of-life.ts:25:49
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:25:53
(get_local $5)
)
)
)
;;@ assembly/game-of-life.ts:25:58
(i32.load8_u
;;@ assembly/game-of-life.ts:25:67
(i32.add
(i32.mul
(get_local $3)
;;@ assembly/game-of-life.ts:25:73
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:25:77
(get_local $7)
)
)
)
;;@ assembly/game-of-life.ts:26:8
(i32.load8_u
;;@ assembly/game-of-life.ts:26:17
(i32.add
(i32.mul
(get_local $2)
;;@ assembly/game-of-life.ts:26:23
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:26:27
(get_local $6)
)
)
)
;;@ assembly/game-of-life.ts:26:58
(i32.load8_u
;;@ assembly/game-of-life.ts:26:67
(i32.add
(i32.mul
(get_local $2)
;;@ assembly/game-of-life.ts:26:73
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:26:77
(get_local $7)
)
)
)
;;@ assembly/game-of-life.ts:27:8
(i32.load8_u
;;@ assembly/game-of-life.ts:27:17
(i32.add
(i32.mul
(get_local $4)
;;@ assembly/game-of-life.ts:27:23
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:27:27
(get_local $6)
)
)
)
;;@ assembly/game-of-life.ts:27:34
(i32.load8_u
;;@ assembly/game-of-life.ts:27:43
(i32.add
(i32.mul
(get_local $4)
;;@ assembly/game-of-life.ts:27:49
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:27:53
(get_local $5)
)
)
)
;;@ assembly/game-of-life.ts:27:58
(i32.load8_u
;;@ assembly/game-of-life.ts:27:67
(i32.add
(i32.mul
(get_local $4)
;;@ assembly/game-of-life.ts:27:73
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:27:77
(get_local $7)
)
)
)
)
;;@ assembly/game-of-life.ts:29:6
(if
;;@ assembly/game-of-life.ts:29:10
(i32.load8_u
;;@ assembly/game-of-life.ts:29:19
(i32.add
(i32.mul
(get_local $2)
;;@ assembly/game-of-life.ts:29:23
(get_global $assembly/game-of-life/w)
)
;;@ assembly/game-of-life.ts:29:27
(get_local $5)
)
)
;;@ assembly/game-of-life.ts:30:8
(if
;;@ assembly/game-of-life.ts:30:12
(i32.and
(if (result i32)
(i32.ne
(tee_local $9
(i32.lt_s
(get_local $8)
;;@ assembly/game-of-life.ts:30:16
(i32.const 2)
)
)
(i32.const 0)
)
(get_local $9)
;;@ assembly/game-of-life.ts:30:21
(i32.gt_s
(get_local $8)
;;@ assembly/game-of-life.ts:30:25
(i32.const 3)
)
)
(i32.const 1)
)
;;@ assembly/game-of-life.ts:31:10
(i32.store8
;;@ assembly/game-of-life.ts:31:20
(i32.add
(i32.add
(get_global $assembly/game-of-life/s)
;;@ assembly/game-of-life.ts:31:24
(i32.mul
(get_local $2)
;;@ assembly/game-of-life.ts:31:28
(get_global $assembly/game-of-life/w)
)
)
;;@ assembly/game-of-life.ts:31:32
(get_local $5)
)
;;@ assembly/game-of-life.ts:31:35
(i32.const 0)
)
)
;;@ assembly/game-of-life.ts:32:13
(if
;;@ assembly/game-of-life.ts:32:17
(i32.eq
(get_local $8)
;;@ assembly/game-of-life.ts:32:22
(i32.const 3)
)
;;@ assembly/game-of-life.ts:33:8
(i32.store8
;;@ assembly/game-of-life.ts:33:18
(i32.add
(i32.add
(get_global $assembly/game-of-life/s)
;;@ assembly/game-of-life.ts:33:22
(i32.mul
(get_local $2)
;;@ assembly/game-of-life.ts:33:26
(get_global $assembly/game-of-life/w)
)
)
;;@ assembly/game-of-life.ts:33:30
(get_local $5)
)
;;@ assembly/game-of-life.ts:33:33
(i32.const 1)
)
)
)
)
;;@ assembly/game-of-life.ts:21:32
(set_local $5
(i32.add
;;@ assembly/game-of-life.ts:21:34
(get_local $5)
(i32.const 1)
)
)
(br $continue|1)
)
)
)
)
)
;;@ assembly/game-of-life.ts:18:30
(set_local $2
(i32.add
;;@ assembly/game-of-life.ts:18:32
(get_local $2)
(i32.const 1)
)
)
(br $continue|0)
)
)
)
)
)
)

View File

@ -4,8 +4,8 @@
"private": true,
"scripts": {
"build": "npm run build:untouched && npm run build:optimized",
"build:untouched": "asc assembly/game-of-life.ts -b game-of-life.untouched.wasm -t game-of-life.untouched.wast --validate --sourceMap --measure",
"build:optimized": "asc -O assembly/game-of-life.ts -b game-of-life.optimized.wasm -t game-of-life.optimized.wast --validate --sourceMap --measure",
"build:untouched": "asc assembly/game-of-life.ts -b game-of-life.untouched.wasm -t game-of-life.untouched.wat --validate --sourceMap --measure",
"build:optimized": "asc -O assembly/game-of-life.ts -b game-of-life.optimized.wasm -t game-of-life.optimized.wat --validate --sourceMap --measure",
"browser": "game-of-life.html"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,8 @@
},
"scripts": {
"build": "npm run build:untouched && npm run build:optimized",
"build:untouched": "asc assembly/i64.ts -t i64.untouched.wast -b i64.untouched.wasm --noMemory --validate --sourceMap --measure",
"build:optimized": "asc -O assembly/i64.ts -b i64.optimized.wasm -t i64.optimized.wast --noMemory --validate --sourceMap --measure",
"build:untouched": "asc assembly/i64.ts -t i64.untouched.wat -b i64.untouched.wasm --noMemory --validate --sourceMap --measure",
"build:optimized": "asc -O assembly/i64.ts -b i64.optimized.wasm -t i64.optimized.wat --noMemory --validate --sourceMap --measure",
"test": "node tests"
},
"files": [

View File

@ -4,8 +4,8 @@
"private": true,
"scripts": {
"build": "npm run build:untouched && npm run build:optimized",
"build:untouched": "asc assembly/pson.ts -b pson.untouched.wasm -t pson.untouched.wast --validate --sourceMap --measure",
"build:optimized": "asc -O assembly/pson.ts -b pson.optimized.wasm -t pson.optimized.wast --validate --sourceMap --measure",
"build:untouched": "asc assembly/pson.ts -b pson.untouched.wasm -t pson.untouched.wat --validate --sourceMap --measure",
"build:optimized": "asc -O assembly/pson.ts -b pson.optimized.wasm -t pson.optimized.wat --validate --sourceMap --measure",
"test": "node tests"
},
"devDependencies": {

View File

@ -0,0 +1,562 @@
(module
(type $v (func))
(type $i (func (result i32)))
(type $iv (func (param i32)))
(type $I (func (result i64)))
(type $iiv (func (param i32 i32)))
(type $fv (func (param f32)))
(type $Fv (func (param f64)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(import "pson" "onNull" (func $assembly/pson/pson.onNull))
(import "pson" "onTrue" (func $assembly/pson/pson.onTrue))
(import "pson" "onFalse" (func $assembly/pson/pson.onFalse))
(import "pson" "onEObject" (func $assembly/pson/pson.onEObject))
(import "pson" "onEArray" (func $assembly/pson/pson.onEArray))
(import "pson" "onEString" (func $assembly/pson/pson.onEString))
(import "pson" "onObject" (func $assembly/pson/pson.onObject (param i32)))
(import "pson" "onArray" (func $assembly/pson/pson.onArray (param i32)))
(import "pson" "onInteger" (func $assembly/pson/pson.onInteger (param i32)))
(import "pson" "onLong" (func $assembly/pson/pson.onLong (param i32 i32)))
(import "pson" "onFloat" (func $assembly/pson/pson.onFloat (param f32)))
(import "pson" "onDouble" (func $assembly/pson/pson.onDouble (param f64)))
(import "pson" "onString" (func $assembly/pson/pson.onString (param i32 i32)))
(import "pson" "onBinary" (func $assembly/pson/pson.onBinary (param i32 i32)))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $assembly/pson/offset (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 4) "\10\00\00\00a\00s\00s\00e\00m\00b\00l\00y\00/\00p\00s\00o\00n\00.\00t\00s")
(export "decode" (func $assembly/pson/decode))
(export "memory" (memory $0))
(func $assembly/pson/readVarint32 (; 15 ;) (type $i) (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(loop $continue|0
;;@ assembly/pson.ts:141:4
(set_local $0
(i32.or
(get_local $0)
;;@ assembly/pson.ts:140:21
(block (result i32)
(set_global $assembly/pson/offset
(i32.add
(tee_local $0
(get_global $assembly/pson/offset)
)
(i32.const 1)
)
)
;;@ assembly/pson.ts:141:13
(i32.shl
(i32.and
;;@ assembly/pson.ts:140:4
(tee_local $2
;;@ assembly/pson.ts:140:12
(i32.load8_u
(get_local $0)
)
)
;;@ assembly/pson.ts:141:23
(i32.const 127)
)
;;@ assembly/pson.ts:141:37
(block (result i32)
(set_local $1
(i32.add
(tee_local $0
(get_local $1)
)
(i32.const 1)
)
)
;;@ assembly/pson.ts:141:32
(i32.mul
(get_local $0)
;;@ assembly/pson.ts:141:33
(i32.const 7)
)
)
)
)
)
)
(br_if $continue|0
(i32.and
;;@ assembly/pson.ts:142:11
(get_local $2)
;;@ assembly/pson.ts:142:15
(i32.const 128)
)
)
)
;;@ assembly/pson.ts:143:9
(get_local $0)
)
(func $assembly/pson/readVarint64 (; 16 ;) (type $I) (result i64)
(local $0 i64)
(local $1 i32)
(local $2 i64)
(loop $continue|0
;;@ assembly/pson.ts:151:4
(set_local $0
(i64.or
(get_local $0)
;;@ assembly/pson.ts:150:21
(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:151:37
(get_local $2)
)
(i64.const 1)
)
)
;;@ assembly/pson.ts:151:13
(i64.shl
(i64.extend_u/i32
(i32.and
;;@ assembly/pson.ts:150:4
(tee_local $1
;;@ assembly/pson.ts:150:12
(i32.load8_u
(get_local $1)
)
)
;;@ assembly/pson.ts:151:23
(i32.const 127)
)
)
;;@ assembly/pson.ts:151:32
(i64.mul
(get_local $0)
;;@ assembly/pson.ts:151:33
(i64.const 7)
)
)
)
)
)
(br_if $continue|0
(i32.and
;;@ assembly/pson.ts:152:11
(get_local $1)
;;@ assembly/pson.ts:152:15
(i32.const 128)
)
)
)
;;@ assembly/pson.ts:153:9
(get_local $0)
)
(func $assembly/pson/decodeValue (; 17 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i64)
;;@ assembly/pson.ts:52:2
(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
(block $case0|0
(block $tablify|0
(set_global $assembly/pson/offset
(i32.add
(tee_local $1
;;@ assembly/pson.ts:49:28
(get_global $assembly/pson/offset)
)
(i32.const 1)
)
)
(br_table $case0|0 $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
(tee_local $1
;;@ assembly/pson.ts:49:2
(tee_local $0
;;@ assembly/pson.ts:49:19
(i32.load8_u
(get_local $1)
)
)
)
(i32.const 240)
)
)
)
(br_if $case14|0
(i32.or
(i32.eq
(get_local $1)
;;@ assembly/pson.ts:117:9
(i32.const 253)
)
(i32.eq
(get_local $1)
;;@ assembly/pson.ts:118:9
(i32.const 254)
)
)
)
(br_if $case15|0
(i32.eq
(get_local $1)
;;@ assembly/pson.ts:122:9
(i32.const 255)
)
)
(br $case16|0)
)
;;@ assembly/pson.ts:55:11
(call $assembly/pson/pson.onNull)
;;@ assembly/pson.ts:56:6
(br $break|0)
)
;;@ assembly/pson.ts:59:11
(call $assembly/pson/pson.onTrue)
;;@ assembly/pson.ts:60:6
(br $break|0)
)
;;@ assembly/pson.ts:63:11
(call $assembly/pson/pson.onFalse)
;;@ assembly/pson.ts:64:6
(br $break|0)
)
;;@ assembly/pson.ts:67:11
(call $assembly/pson/pson.onEObject)
;;@ assembly/pson.ts:68:6
(br $break|0)
)
;;@ assembly/pson.ts:71:11
(call $assembly/pson/pson.onEArray)
;;@ assembly/pson.ts:72:6
(br $break|0)
)
;;@ assembly/pson.ts:75:11
(call $assembly/pson/pson.onEString)
;;@ assembly/pson.ts:76:6
(br $break|0)
)
;;@ assembly/pson.ts:79:11
(call $assembly/pson/pson.onObject
;;@ assembly/pson.ts:79:20
(tee_local $0
;;@ assembly/pson.ts:79:27
(call $assembly/pson/readVarint32)
)
)
(loop $continue|1
(if
;;@ assembly/pson.ts:80:13
(block (result i32)
(set_local $0
(i32.sub
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(get_local $1)
)
(block
;;@ assembly/pson.ts:81:8
(call $assembly/pson/decodeValue)
;;@ assembly/pson.ts:82:8
(call $assembly/pson/decodeValue)
(br $continue|1)
)
)
)
;;@ assembly/pson.ts:84:6
(br $break|0)
)
;;@ assembly/pson.ts:87:11
(call $assembly/pson/pson.onArray
;;@ assembly/pson.ts:87:19
(tee_local $0
;;@ assembly/pson.ts:87:26
(call $assembly/pson/readVarint32)
)
)
(loop $continue|2
(if
;;@ assembly/pson.ts:88:13
(block (result i32)
(set_local $0
(i32.sub
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(get_local $1)
)
(block
;;@ assembly/pson.ts:89:8
(call $assembly/pson/decodeValue)
(br $continue|2)
)
)
)
;;@ assembly/pson.ts:90:6
(br $break|0)
)
;;@ assembly/pson.ts:93:11
(call $assembly/pson/pson.onInteger
;;@ assembly/pson.ts:93:21
(i32.xor
(i32.shr_u
;;@ assembly/pson.ts:93:22
(tee_local $0
;;@ assembly/pson.ts:93:30
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:93:49
(i32.const 1)
)
;;@ assembly/pson.ts:93:54
(i32.sub
(i32.const 0)
;;@ assembly/pson.ts:93:55
(i32.and
;;@ assembly/pson.ts:93:56
(get_local $0)
;;@ assembly/pson.ts:93:63
(i32.const 1)
)
)
)
)
;;@ assembly/pson.ts:94:6
(br $break|0)
)
;;@ assembly/pson.ts:98:11
(call $assembly/pson/pson.onLong
;;@ assembly/pson.ts:98:18
(i32.wrap/i64
;;@ assembly/pson.ts:97:6
(tee_local $2
;;@ assembly/pson.ts:97:13
(i64.xor
(i64.shr_u
;;@ assembly/pson.ts:97:14
(tee_local $2
;;@ assembly/pson.ts:97:22
(call $assembly/pson/readVarint64)
)
;;@ assembly/pson.ts:97:41
(i64.const 1)
)
;;@ assembly/pson.ts:97:46
(i64.sub
(i64.const 0)
;;@ assembly/pson.ts:97:47
(i64.and
;;@ assembly/pson.ts:97:48
(get_local $2)
;;@ assembly/pson.ts:97:55
(i64.const 1)
)
)
)
)
)
;;@ assembly/pson.ts:98:29
(i32.wrap/i64
;;@ assembly/pson.ts:98:35
(i64.shr_u
(get_local $2)
;;@ assembly/pson.ts:98:44
(i64.const 32)
)
)
)
;;@ assembly/pson.ts:99:6
(br $break|0)
)
;;@ assembly/pson.ts:102:11
(call $assembly/pson/pson.onFloat
;;@ assembly/pson.ts:102:19
(f32.load
;;@ assembly/pson.ts:102:29
(get_global $assembly/pson/offset)
)
)
;;@ assembly/pson.ts:103:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:103:16
(i32.const 4)
)
)
;;@ assembly/pson.ts:104:6
(br $break|0)
)
;;@ assembly/pson.ts:107:11
(call $assembly/pson/pson.onDouble
;;@ assembly/pson.ts:107:20
(f64.load
;;@ assembly/pson.ts:107:30
(get_global $assembly/pson/offset)
)
)
;;@ assembly/pson.ts:108:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:108:16
(i32.const 8)
)
)
;;@ assembly/pson.ts:109:6
(br $break|0)
)
;;@ assembly/pson.ts:112:6
(set_local $0
;;@ assembly/pson.ts:112:13
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:113:11
(call $assembly/pson/pson.onString
;;@ assembly/pson.ts:113:20
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:113:28
(get_local $0)
)
;;@ assembly/pson.ts:114:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:114:16
(get_local $0)
)
)
;;@ assembly/pson.ts:115:6
(br $break|0)
)
;;@ assembly/pson.ts:120:6
(unreachable)
)
;;@ assembly/pson.ts:123:6
(set_local $0
;;@ assembly/pson.ts:123:13
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:124:11
(call $assembly/pson/pson.onBinary
;;@ assembly/pson.ts:124:20
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:124:28
(get_local $0)
)
;;@ assembly/pson.ts:125:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:125:16
(get_local $0)
)
)
;;@ assembly/pson.ts:126:6
(br $break|0)
)
;;@ assembly/pson.ts:129:6
(if
;;@ assembly/pson.ts:129:10
(i32.gt_u
(get_local $0)
;;@ assembly/pson.ts:129:18
(i32.const 239)
)
;;@ assembly/pson.ts:130:8
(unreachable)
)
;;@ assembly/pson.ts:131:11
(call $assembly/pson/pson.onInteger
;;@ assembly/pson.ts:131:21
(i32.xor
(i32.shr_u
;;@ assembly/pson.ts:131:22
(get_local $0)
;;@ assembly/pson.ts:131:31
(i32.const 1)
)
;;@ assembly/pson.ts:131:36
(i32.sub
(i32.const 0)
;;@ assembly/pson.ts:131:37
(i32.and
;;@ assembly/pson.ts:131:38
(get_local $0)
;;@ assembly/pson.ts:131:46
(i32.const 1)
)
)
)
)
)
)
(func $assembly/pson/decode (; 18 ;) (type $iv) (param $0 i32)
;;@ assembly/pson.ts:42:2
(set_global $assembly/pson/offset
;;@ assembly/pson.ts:42:11
(i32.const 0)
)
(loop $continue|0
(if
;;@ assembly/pson.ts:43:9
(i32.lt_u
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:43:18
(get_local $0)
)
(block
;;@ assembly/pson.ts:44:4
(call $assembly/pson/decodeValue)
(br $continue|0)
)
)
)
;;@ assembly/pson.ts:45:2
(if
;;@ assembly/pson.ts:45:9
(i32.ne
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:45:19
(get_local $0)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 45)
(i32.const 2)
)
(unreachable)
)
)
)
)

View File

@ -0,0 +1,756 @@
(module
(type $v (func))
(type $i (func (result i32)))
(type $iv (func (param i32)))
(type $I (func (result i64)))
(type $iiv (func (param i32 i32)))
(type $fv (func (param f32)))
(type $Fv (func (param f64)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(import "pson" "onNull" (func $assembly/pson/pson.onNull))
(import "pson" "onTrue" (func $assembly/pson/pson.onTrue))
(import "pson" "onFalse" (func $assembly/pson/pson.onFalse))
(import "pson" "onEObject" (func $assembly/pson/pson.onEObject))
(import "pson" "onEArray" (func $assembly/pson/pson.onEArray))
(import "pson" "onEString" (func $assembly/pson/pson.onEString))
(import "pson" "onObject" (func $assembly/pson/pson.onObject (param i32)))
(import "pson" "onArray" (func $assembly/pson/pson.onArray (param i32)))
(import "pson" "onInteger" (func $assembly/pson/pson.onInteger (param i32)))
(import "pson" "onLong" (func $assembly/pson/pson.onLong (param i32 i32)))
(import "pson" "onFloat" (func $assembly/pson/pson.onFloat (param f32)))
(import "pson" "onDouble" (func $assembly/pson/pson.onDouble (param f64)))
(import "pson" "onString" (func $assembly/pson/pson.onString (param i32 i32)))
(import "pson" "onBinary" (func $assembly/pson/pson.onBinary (param i32 i32)))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $assembly/pson/offset (mut i32) (i32.const 0))
(global $assembly/pson/Token.ZERO i32 (i32.const 0))
(global $assembly/pson/Token.MAX i32 (i32.const 239))
(global $assembly/pson/Token.NULL i32 (i32.const 240))
(global $assembly/pson/Token.TRUE i32 (i32.const 241))
(global $assembly/pson/Token.FALSE i32 (i32.const 242))
(global $assembly/pson/Token.EOBJECT i32 (i32.const 243))
(global $assembly/pson/Token.EARRAY i32 (i32.const 244))
(global $assembly/pson/Token.ESTRING i32 (i32.const 245))
(global $assembly/pson/Token.OBJECT i32 (i32.const 246))
(global $assembly/pson/Token.ARRAY i32 (i32.const 247))
(global $assembly/pson/Token.INTEGER i32 (i32.const 248))
(global $assembly/pson/Token.LONG i32 (i32.const 249))
(global $assembly/pson/Token.FLOAT i32 (i32.const 250))
(global $assembly/pson/Token.DOUBLE i32 (i32.const 251))
(global $assembly/pson/Token.STRING i32 (i32.const 252))
(global $assembly/pson/Token.STRING_ADD i32 (i32.const 253))
(global $assembly/pson/Token.STRING_GET i32 (i32.const 254))
(global $assembly/pson/Token.BINARY i32 (i32.const 255))
(global $HEAP_BASE i32 (i32.const 40))
(memory $0 1)
(data (i32.const 4) "\10\00\00\00a\00s\00s\00e\00m\00b\00l\00y\00/\00p\00s\00o\00n\00.\00t\00s\00")
(export "decode" (func $assembly/pson/decode))
(export "memory" (memory $0))
(func $assembly/pson/readVarint32 (; 15 ;) (type $i) (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
;;@ assembly/pson.ts:137:2
(set_local $0
;;@ assembly/pson.ts:137:19
(i32.const 0)
)
;;@ assembly/pson.ts:138:2
(set_local $1
;;@ assembly/pson.ts:138:19
(i32.const 0)
)
;;@ assembly/pson.ts:139:2
(block $break|0
(loop $continue|0
;;@ assembly/pson.ts:139:5
(block
;;@ assembly/pson.ts:140:4
(set_local $3
;;@ assembly/pson.ts:140:12
(i32.load8_u
;;@ assembly/pson.ts:140:21
(block (result i32)
(set_local $2
(get_global $assembly/pson/offset)
)
(set_global $assembly/pson/offset
(i32.add
(get_local $2)
(i32.const 1)
)
)
(get_local $2)
)
)
)
;;@ assembly/pson.ts:141:4
(set_local $0
(i32.or
(get_local $0)
;;@ assembly/pson.ts:141:13
(i32.shl
(i32.and
(i32.and
;;@ assembly/pson.ts:141:19
(get_local $3)
;;@ assembly/pson.ts:141:23
(i32.const 127)
)
(i32.const 255)
)
;;@ assembly/pson.ts:141:32
(i32.mul
;;@ assembly/pson.ts:141:33
(i32.const 7)
;;@ assembly/pson.ts:141:37
(block (result i32)
(set_local $2
(get_local $1)
)
(set_local $1
(i32.add
(get_local $2)
(i32.const 1)
)
)
(get_local $2)
)
)
)
)
)
)
(br_if $continue|0
;;@ assembly/pson.ts:142:11
(i32.and
(i32.and
(get_local $3)
;;@ assembly/pson.ts:142:15
(i32.const 128)
)
(i32.const 255)
)
)
)
)
;;@ assembly/pson.ts:143:9
(return
(get_local $0)
)
)
(func $assembly/pson/readVarint64 (; 16 ;) (type $I) (result i64)
(local $0 i64)
(local $1 i64)
(local $2 i32)
(local $3 i32)
(local $4 i64)
;;@ assembly/pson.ts:147:2
(set_local $0
;;@ assembly/pson.ts:147:19
(i64.const 0)
)
;;@ assembly/pson.ts:148:2
(set_local $1
;;@ assembly/pson.ts:148:19
(i64.const 0)
)
;;@ assembly/pson.ts:149:2
(block $break|0
(loop $continue|0
;;@ assembly/pson.ts:149:5
(block
;;@ assembly/pson.ts:150:4
(set_local $3
;;@ assembly/pson.ts:150:12
(i32.load8_u
;;@ assembly/pson.ts:150:21
(block (result i32)
(set_local $2
(get_global $assembly/pson/offset)
)
(set_global $assembly/pson/offset
(i32.add
(get_local $2)
(i32.const 1)
)
)
(get_local $2)
)
)
)
;;@ assembly/pson.ts:151:4
(set_local $0
(i64.or
(get_local $0)
;;@ assembly/pson.ts:151:13
(i64.shl
(i64.extend_u/i32
;;@ assembly/pson.ts:151:19
(i32.and
(i32.and
(get_local $3)
;;@ assembly/pson.ts:151:23
(i32.const 127)
)
(i32.const 255)
)
)
;;@ assembly/pson.ts:151:32
(i64.mul
;;@ assembly/pson.ts:151:33
(i64.const 7)
;;@ assembly/pson.ts:151:37
(block (result i64)
(set_local $4
(get_local $1)
)
(set_local $1
(i64.add
(get_local $4)
(i64.const 1)
)
)
(get_local $4)
)
)
)
)
)
)
(br_if $continue|0
;;@ assembly/pson.ts:152:11
(i32.and
(i32.and
(get_local $3)
;;@ assembly/pson.ts:152:15
(i32.const 128)
)
(i32.const 255)
)
)
)
)
;;@ assembly/pson.ts:153:9
(return
(get_local $0)
)
)
(func $assembly/pson/decodeValue (; 17 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i64)
;;@ assembly/pson.ts:49:2
(set_local $1
;;@ assembly/pson.ts:49:19
(i32.load8_u
;;@ assembly/pson.ts:49:28
(block (result i32)
(set_local $0
(get_global $assembly/pson/offset)
)
(set_global $assembly/pson/offset
(i32.add
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
)
)
)
;;@ assembly/pson.ts:50:2
(nop)
;;@ assembly/pson.ts:51:2
(nop)
;;@ assembly/pson.ts:52:2
(block $break|0
(block $case16|0
(block $case15|0
(block $case14|0
(block $case13|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
(block $case0|0
(set_local $0
;;@ assembly/pson.ts:52:10
(get_local $1)
)
(br_if $case0|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:54:9
(i32.const 240)
)
)
(br_if $case1|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:58:9
(i32.const 241)
)
)
(br_if $case2|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:62:9
(i32.const 242)
)
)
(br_if $case3|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:66:9
(i32.const 243)
)
)
(br_if $case4|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:70:9
(i32.const 244)
)
)
(br_if $case5|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:74:9
(i32.const 245)
)
)
(br_if $case6|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:78:9
(i32.const 246)
)
)
(br_if $case7|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:86:9
(i32.const 247)
)
)
(br_if $case8|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:92:9
(i32.const 248)
)
)
(br_if $case9|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:96:9
(i32.const 249)
)
)
(br_if $case10|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:101:9
(i32.const 250)
)
)
(br_if $case11|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:106:9
(i32.const 251)
)
)
(br_if $case12|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:111:9
(i32.const 252)
)
)
(br_if $case13|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:117:9
(i32.const 253)
)
)
(br_if $case14|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:118:9
(i32.const 254)
)
)
(br_if $case15|0
(i32.eq
(get_local $0)
;;@ assembly/pson.ts:122:9
(i32.const 255)
)
)
(br $case16|0)
)
;;@ assembly/pson.ts:55:11
(call $assembly/pson/pson.onNull)
;;@ assembly/pson.ts:56:6
(br $break|0)
)
;;@ assembly/pson.ts:59:11
(call $assembly/pson/pson.onTrue)
;;@ assembly/pson.ts:60:6
(br $break|0)
)
;;@ assembly/pson.ts:63:11
(call $assembly/pson/pson.onFalse)
;;@ assembly/pson.ts:64:6
(br $break|0)
)
;;@ assembly/pson.ts:67:11
(call $assembly/pson/pson.onEObject)
;;@ assembly/pson.ts:68:6
(br $break|0)
)
;;@ assembly/pson.ts:71:11
(call $assembly/pson/pson.onEArray)
;;@ assembly/pson.ts:72:6
(br $break|0)
)
;;@ assembly/pson.ts:75:11
(call $assembly/pson/pson.onEString)
;;@ assembly/pson.ts:76:6
(br $break|0)
)
;;@ assembly/pson.ts:79:11
(call $assembly/pson/pson.onObject
;;@ assembly/pson.ts:79:20
(tee_local $2
;;@ assembly/pson.ts:79:27
(call $assembly/pson/readVarint32)
)
)
;;@ assembly/pson.ts:80:6
(block $break|1
(loop $continue|1
(if
;;@ assembly/pson.ts:80:13
(block (result i32)
(set_local $0
(get_local $2)
)
(set_local $2
(i32.sub
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
)
(block
(block
;;@ assembly/pson.ts:81:8
(call $assembly/pson/decodeValue)
;;@ assembly/pson.ts:82:8
(call $assembly/pson/decodeValue)
)
(br $continue|1)
)
)
)
)
;;@ assembly/pson.ts:84:6
(br $break|0)
)
;;@ assembly/pson.ts:87:11
(call $assembly/pson/pson.onArray
;;@ assembly/pson.ts:87:19
(tee_local $2
;;@ assembly/pson.ts:87:26
(call $assembly/pson/readVarint32)
)
)
;;@ assembly/pson.ts:88:6
(block $break|2
(loop $continue|2
(if
;;@ assembly/pson.ts:88:13
(block (result i32)
(set_local $0
(get_local $2)
)
(set_local $2
(i32.sub
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
)
(block
;;@ assembly/pson.ts:89:8
(call $assembly/pson/decodeValue)
(br $continue|2)
)
)
)
)
;;@ assembly/pson.ts:90:6
(br $break|0)
)
;;@ assembly/pson.ts:93:11
(call $assembly/pson/pson.onInteger
;;@ assembly/pson.ts:93:21
(i32.xor
(i32.shr_u
;;@ assembly/pson.ts:93:22
(tee_local $2
;;@ assembly/pson.ts:93:30
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:93:49
(i32.const 1)
)
;;@ assembly/pson.ts:93:54
(i32.sub
(i32.const 0)
;;@ assembly/pson.ts:93:55
(i32.and
;;@ assembly/pson.ts:93:56
(get_local $2)
;;@ assembly/pson.ts:93:63
(i32.const 1)
)
)
)
)
;;@ assembly/pson.ts:94:6
(br $break|0)
)
;;@ assembly/pson.ts:97:6
(set_local $3
;;@ assembly/pson.ts:97:13
(i64.xor
(i64.shr_u
;;@ assembly/pson.ts:97:14
(tee_local $3
;;@ assembly/pson.ts:97:22
(call $assembly/pson/readVarint64)
)
;;@ assembly/pson.ts:97:41
(i64.const 1)
)
;;@ assembly/pson.ts:97:46
(i64.sub
(i64.const 0)
;;@ assembly/pson.ts:97:47
(i64.and
;;@ assembly/pson.ts:97:48
(get_local $3)
;;@ assembly/pson.ts:97:55
(i64.const 1)
)
)
)
)
;;@ assembly/pson.ts:98:11
(call $assembly/pson/pson.onLong
;;@ assembly/pson.ts:98:18
(i32.wrap/i64
(get_local $3)
)
;;@ assembly/pson.ts:98:29
(i32.wrap/i64
;;@ assembly/pson.ts:98:35
(i64.shr_u
(get_local $3)
;;@ assembly/pson.ts:98:44
(i64.const 32)
)
)
)
;;@ assembly/pson.ts:99:6
(br $break|0)
)
;;@ assembly/pson.ts:102:11
(call $assembly/pson/pson.onFloat
;;@ assembly/pson.ts:102:19
(f32.load
;;@ assembly/pson.ts:102:29
(get_global $assembly/pson/offset)
)
)
;;@ assembly/pson.ts:103:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:103:16
(i32.const 4)
)
)
;;@ assembly/pson.ts:104:6
(br $break|0)
)
;;@ assembly/pson.ts:107:11
(call $assembly/pson/pson.onDouble
;;@ assembly/pson.ts:107:20
(f64.load
;;@ assembly/pson.ts:107:30
(get_global $assembly/pson/offset)
)
)
;;@ assembly/pson.ts:108:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:108:16
(i32.const 8)
)
)
;;@ assembly/pson.ts:109:6
(br $break|0)
)
;;@ assembly/pson.ts:112:6
(set_local $2
;;@ assembly/pson.ts:112:13
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:113:11
(call $assembly/pson/pson.onString
;;@ assembly/pson.ts:113:20
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:113:28
(get_local $2)
)
;;@ assembly/pson.ts:114:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:114:16
(get_local $2)
)
)
;;@ assembly/pson.ts:115:6
(br $break|0)
)
)
;;@ assembly/pson.ts:120:6
(unreachable)
)
;;@ assembly/pson.ts:123:6
(set_local $2
;;@ assembly/pson.ts:123:13
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:124:11
(call $assembly/pson/pson.onBinary
;;@ assembly/pson.ts:124:20
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:124:28
(get_local $2)
)
;;@ assembly/pson.ts:125:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:125:16
(get_local $2)
)
)
;;@ assembly/pson.ts:126:6
(br $break|0)
)
;;@ assembly/pson.ts:129:6
(if
;;@ assembly/pson.ts:129:10
(i32.gt_u
(get_local $1)
;;@ assembly/pson.ts:129:18
(i32.const 239)
)
;;@ assembly/pson.ts:130:8
(unreachable)
)
;;@ assembly/pson.ts:131:11
(call $assembly/pson/pson.onInteger
;;@ assembly/pson.ts:131:21
(i32.xor
(i32.shr_u
;;@ assembly/pson.ts:131:22
(get_local $1)
;;@ assembly/pson.ts:131:31
(i32.const 1)
)
;;@ assembly/pson.ts:131:36
(i32.sub
(i32.const 0)
;;@ assembly/pson.ts:131:37
(i32.and
;;@ assembly/pson.ts:131:38
(get_local $1)
;;@ assembly/pson.ts:131:46
(i32.const 1)
)
)
)
)
;;@ assembly/pson.ts:132:6
(br $break|0)
)
)
(func $assembly/pson/decode (; 18 ;) (type $iv) (param $0 i32)
;;@ assembly/pson.ts:42:2
(set_global $assembly/pson/offset
;;@ assembly/pson.ts:42:11
(i32.const 0)
)
;;@ assembly/pson.ts:43:2
(block $break|0
(loop $continue|0
(if
;;@ assembly/pson.ts:43:9
(i32.lt_u
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:43:18
(get_local $0)
)
(block
;;@ assembly/pson.ts:44:4
(call $assembly/pson/decodeValue)
(br $continue|0)
)
)
)
)
;;@ assembly/pson.ts:45:2
(if
(i32.eqz
;;@ assembly/pson.ts:45:9
(i32.eq
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:45:19
(get_local $0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 45)
(i32.const 2)
)
(unreachable)
)
)
)
)

View File

@ -0,0 +1,2 @@
import "allocator/tlsf";
export { gc_collect, gc_pause, gc_resume } from "./ugc";

View File

@ -4,8 +4,8 @@
"private": true,
"scripts": {
"build": "npm run build:untouched && npm run build:optimized",
"build:untouched": "asc assembly/ugc.ts -t ugc.untouched.wast -b ugc.untouched.wasm --validate --sourceMap --measure",
"build:optimized": "asc -O3 assembly/ugc.ts -b ugc.optimized.wasm -t ugc.optimized.wast --validate --noDebug --noAssert --sourceMap --measure",
"build:untouched": "asc assembly/index.ts -b ugc.untouched.wasm -t ugc.untouched.wat --validate --sourceMap --measure",
"build:optimized": "asc -O3 assembly/index.ts -b ugc.optimized.wasm -t ugc.optimized.wat --validate --noDebug --noAssert --sourceMap --measure",
"test": "node tests"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,8 @@
import {
Program,
LIBRARY_PREFIX
LIBRARY_PREFIX,
PATH_DELIMITER
} from "./program";
import {
@ -108,7 +109,7 @@ export class Parser extends DiagnosticEmitter {
return; // already parsed
this.seenlog.add(normalizedPath);
var source = new Source(normalizedPath, text, isEntry ? SourceKind.ENTRY : path.startsWith(LIBRARY_PREFIX) ? SourceKind.LIBRARY : SourceKind.DEFAULT);
var source = new Source(normalizedPath, text, isEntry ? SourceKind.ENTRY : path.startsWith(LIBRARY_PREFIX) && path.indexOf(PATH_DELIMITER, LIBRARY_PREFIX.length) < 0 ? SourceKind.LIBRARY : SourceKind.DEFAULT);
this.program.sources.push(source);
var tn = new Tokenizer(source, this.program.diagnostics);

View File

@ -10,6 +10,7 @@ const ALIGN_MASK: usize = ALIGN_SIZE - 1;
var HEAP_OFFSET: usize = HEAP_BASE;
@global
export function allocate_memory(size: usize): usize {
if (!size) return 0;
var ptr = HEAP_OFFSET;
@ -25,10 +26,12 @@ export function allocate_memory(size: usize): usize {
return ptr;
}
@global
export function free_memory(ptr: usize): void {
// nop
}
@global
export function reset_memory(): void {
HEAP_OFFSET = HEAP_BASE;
}

View File

@ -7,12 +7,15 @@
declare function _malloc(size: usize): usize;
declare function _free(ptr: usize): void;
@global
export function allocate_memory(size: usize): usize {
return _malloc(size);
}
@global
export function free_memory(ptr: usize): void {
_free(ptr);
}
@global
export { reset_memory } from "./none";

View File

@ -6,12 +6,15 @@
declare function malloc(size: usize): usize;
declare function free(ptr: usize): void;
@global
export function allocate_memory(size: usize): usize {
return malloc(size);
}
@global
export function free_memory(ptr: usize): void {
free(ptr);
}
@global
export { reset_memory } from "./none";

View File

@ -431,6 +431,7 @@ var ROOT: Root = changetype<Root>(0);
// External interface
/** Allocates a chunk of memory. */
@global
export function allocate_memory(size: usize): usize {
// initialize if necessary
@ -474,6 +475,7 @@ export function allocate_memory(size: usize): usize {
}
/** Frees the chunk of memory at the specified address. */
@global
export function free_memory(data: usize): void {
if (data) {
var root = ROOT;

4
std/portable.d.ts vendored
View File

@ -179,9 +179,9 @@ declare class String {
static fromCodePoints(arr: i32[]): string;
readonly length: i32;
private constructor();
indexOf(subject: string): i32;
indexOf(subject: string, position?: i32): i32;
includes(other: string): bool;
lastIndexOf(subject: string): i32;
lastIndexOf(subject: string, position?: i32): i32;
charAt(index: i32): string;
charCodeAt(index: i32): i32;
substring(from: i32, to?: i32): string;

View File

@ -71,11 +71,11 @@ tests.forEach(filename => {
stderr.write(err + os.EOL);
var actual = stdout.toString().replace(/\r\n/g, "\n");
if (args.create) {
fs.writeFileSync(path.join(basedir, basename + ".wast"), actual, { encoding: "utf8" });
fs.writeFileSync(path.join(basedir, basename + ".wat"), actual, { encoding: "utf8" });
console.log("- " + chalk.yellow("Created fixture"));
} else {
let expected = fs.readFileSync(path.join(basedir, basename + ".wast"), { encoding: "utf8" }).replace(/\r\n/g, "\n");
let diffs = diff(basename + ".wast", expected, actual);
let expected = fs.readFileSync(path.join(basedir, basename + ".wat"), { encoding: "utf8" }).replace(/\r\n/g, "\n");
let diffs = diff(basename + ".wat", expected, actual);
if (diffs !== null) {
console.log(diffs);
console.log("- " + chalk.red("diff ERROR"));
@ -98,7 +98,7 @@ tests.forEach(filename => {
"--binaryFile" // -> stdout
];
if (args.create) cmd.push(
"--textFile", basename + ".optimized.wast"
"--textFile", basename + ".optimized.wat"
);
asc.main(cmd, {
stdout: stdout,

View File

@ -26,106 +26,106 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
;;@ (lib)/allocator/arena.ts:14:2
;;@ (lib)/allocator/arena.ts:15:2
(if
;;@ (lib)/allocator/arena.ts:14:6
;;@ (lib)/allocator/arena.ts:15:6
(i32.eqz
;;@ (lib)/allocator/arena.ts:14:7
;;@ (lib)/allocator/arena.ts:15:7
(get_local $0)
)
;;@ (lib)/allocator/arena.ts:14:20
;;@ (lib)/allocator/arena.ts:15:20
(return
(i32.const 0)
)
)
;;@ (lib)/allocator/arena.ts:15:2
;;@ (lib)/allocator/arena.ts:16:2
(set_local $1
;;@ (lib)/allocator/arena.ts:15:12
;;@ (lib)/allocator/arena.ts:16:12
(get_global "$(lib)/allocator/arena/HEAP_OFFSET")
)
;;@ (lib)/allocator/arena.ts:16:2
;;@ (lib)/allocator/arena.ts:17:2
(set_local $2
;;@ (lib)/allocator/arena.ts:16:12
;;@ (lib)/allocator/arena.ts:17:12
(i32.and
(i32.add
;;@ (lib)/allocator/arena.ts:16:13
;;@ (lib)/allocator/arena.ts:17:13
(i32.add
(get_local $1)
;;@ (lib)/allocator/arena.ts:16:19
;;@ (lib)/allocator/arena.ts:17:19
(get_local $0)
)
;;@ (lib)/allocator/arena.ts:16:26
;;@ (lib)/allocator/arena.ts:17:26
(i32.const 7)
)
;;@ (lib)/allocator/arena.ts:16:40
;;@ (lib)/allocator/arena.ts:17:40
(i32.xor
;;@ (lib)/allocator/arena.ts:16:41
;;@ (lib)/allocator/arena.ts:17:41
(i32.const 7)
(i32.const -1)
)
)
)
;;@ (lib)/allocator/arena.ts:17:2
;;@ (lib)/allocator/arena.ts:18:2
(set_local $3
;;@ (lib)/allocator/arena.ts:17:14
;;@ (lib)/allocator/arena.ts:18:14
(i32.shl
(current_memory)
;;@ (lib)/allocator/arena.ts:17:41
;;@ (lib)/allocator/arena.ts:18:41
(i32.const 16)
)
)
;;@ (lib)/allocator/arena.ts:18:2
;;@ (lib)/allocator/arena.ts:19:2
(if
;;@ (lib)/allocator/arena.ts:18:6
;;@ (lib)/allocator/arena.ts:19:6
(i32.and
(if (result i32)
(i32.ne
(tee_local $4
(i32.gt_u
(get_local $2)
;;@ (lib)/allocator/arena.ts:18:12
;;@ (lib)/allocator/arena.ts:19:12
(get_local $3)
)
)
(i32.const 0)
)
;;@ (lib)/allocator/arena.ts:18:21
;;@ (lib)/allocator/arena.ts:19:21
(i32.lt_s
(grow_memory
;;@ (lib)/allocator/arena.ts:19:4
;;@ (lib)/allocator/arena.ts:20:4
(select
(tee_local $4
;;@ (lib)/allocator/arena.ts:20:6
;;@ (lib)/allocator/arena.ts:21:6
(i32.shr_u
(i32.sub
;;@ (lib)/allocator/arena.ts:20:7
;;@ (lib)/allocator/arena.ts:21:7
(i32.and
;;@ (lib)/allocator/arena.ts:20:8
;;@ (lib)/allocator/arena.ts:21:8
(i32.add
;;@ (lib)/allocator/arena.ts:20:9
;;@ (lib)/allocator/arena.ts:21:9
(get_local $2)
;;@ (lib)/allocator/arena.ts:20:15
;;@ (lib)/allocator/arena.ts:21:15
(i32.const 65535)
)
;;@ (lib)/allocator/arena.ts:20:25
;;@ (lib)/allocator/arena.ts:21:25
(i32.xor
;;@ (lib)/allocator/arena.ts:20:26
;;@ (lib)/allocator/arena.ts:21:26
(i32.const 65535)
(i32.const -1)
)
)
;;@ (lib)/allocator/arena.ts:20:36
;;@ (lib)/allocator/arena.ts:21:36
(get_local $3)
)
;;@ (lib)/allocator/arena.ts:20:46
;;@ (lib)/allocator/arena.ts:21:46
(i32.const 16)
)
)
(tee_local $5
;;@ (lib)/allocator/arena.ts:21:6
;;@ (lib)/allocator/arena.ts:22:6
(i32.shr_u
(get_local $3)
;;@ (lib)/allocator/arena.ts:21:46
;;@ (lib)/allocator/arena.ts:22:46
(i32.const 16)
)
)
@ -135,22 +135,22 @@
)
)
)
;;@ (lib)/allocator/arena.ts:23:6
;;@ (lib)/allocator/arena.ts:24:6
(i32.const 0)
)
(get_local $4)
)
(i32.const 1)
)
;;@ (lib)/allocator/arena.ts:23:9
;;@ (lib)/allocator/arena.ts:24:9
(unreachable)
)
;;@ (lib)/allocator/arena.ts:24:2
;;@ (lib)/allocator/arena.ts:25:2
(set_global "$(lib)/allocator/arena/HEAP_OFFSET"
;;@ (lib)/allocator/arena.ts:24:16
;;@ (lib)/allocator/arena.ts:25:16
(get_local $2)
)
;;@ (lib)/allocator/arena.ts:25:9
;;@ (lib)/allocator/arena.ts:26:9
(return
(get_local $1)
)
@ -3446,9 +3446,9 @@
(func "$(lib)/allocator/arena/free_memory" (; 6 ;) (type $iv) (param $0 i32)
)
(func "$(lib)/allocator/arena/reset_memory" (; 7 ;) (type $v)
;;@ (lib)/allocator/arena.ts:33:2
;;@ (lib)/allocator/arena.ts:36:2
(set_global "$(lib)/allocator/arena/HEAP_OFFSET"
;;@ (lib)/allocator/arena.ts:33:16
;;@ (lib)/allocator/arena.ts:36:16
(get_global $HEAP_BASE)
)
)

View File

@ -27,106 +27,106 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
;;@ (lib)/allocator/arena.ts:14:2
;;@ (lib)/allocator/arena.ts:15:2
(if
;;@ (lib)/allocator/arena.ts:14:6
;;@ (lib)/allocator/arena.ts:15:6
(i32.eqz
;;@ (lib)/allocator/arena.ts:14:7
;;@ (lib)/allocator/arena.ts:15:7
(get_local $0)
)
;;@ (lib)/allocator/arena.ts:14:20
;;@ (lib)/allocator/arena.ts:15:20
(return
(i32.const 0)
)
)
;;@ (lib)/allocator/arena.ts:15:2
;;@ (lib)/allocator/arena.ts:16:2
(set_local $1
;;@ (lib)/allocator/arena.ts:15:12
;;@ (lib)/allocator/arena.ts:16:12
(get_global "$(lib)/allocator/arena/HEAP_OFFSET")
)
;;@ (lib)/allocator/arena.ts:16:2
;;@ (lib)/allocator/arena.ts:17:2
(set_local $2
;;@ (lib)/allocator/arena.ts:16:12
;;@ (lib)/allocator/arena.ts:17:12
(i32.and
(i32.add
;;@ (lib)/allocator/arena.ts:16:13
;;@ (lib)/allocator/arena.ts:17:13
(i32.add
(get_local $1)
;;@ (lib)/allocator/arena.ts:16:19
;;@ (lib)/allocator/arena.ts:17:19
(get_local $0)
)
;;@ (lib)/allocator/arena.ts:16:26
;;@ (lib)/allocator/arena.ts:17:26
(i32.const 7)
)
;;@ (lib)/allocator/arena.ts:16:40
;;@ (lib)/allocator/arena.ts:17:40
(i32.xor
;;@ (lib)/allocator/arena.ts:16:41
;;@ (lib)/allocator/arena.ts:17:41
(i32.const 7)
(i32.const -1)
)
)
)
;;@ (lib)/allocator/arena.ts:17:2
;;@ (lib)/allocator/arena.ts:18:2
(set_local $3
;;@ (lib)/allocator/arena.ts:17:14
;;@ (lib)/allocator/arena.ts:18:14
(i32.shl
(current_memory)
;;@ (lib)/allocator/arena.ts:17:41
;;@ (lib)/allocator/arena.ts:18:41
(i32.const 16)
)
)
;;@ (lib)/allocator/arena.ts:18:2
;;@ (lib)/allocator/arena.ts:19:2
(if
;;@ (lib)/allocator/arena.ts:18:6
;;@ (lib)/allocator/arena.ts:19:6
(i32.and
(if (result i32)
(i32.ne
(tee_local $4
(i32.gt_u
(get_local $2)
;;@ (lib)/allocator/arena.ts:18:12
;;@ (lib)/allocator/arena.ts:19:12
(get_local $3)
)
)
(i32.const 0)
)
;;@ (lib)/allocator/arena.ts:18:21
;;@ (lib)/allocator/arena.ts:19:21
(i32.lt_s
(grow_memory
;;@ (lib)/allocator/arena.ts:19:4
;;@ (lib)/allocator/arena.ts:20:4
(select
(tee_local $4
;;@ (lib)/allocator/arena.ts:20:6
;;@ (lib)/allocator/arena.ts:21:6
(i32.shr_u
(i32.sub
;;@ (lib)/allocator/arena.ts:20:7
;;@ (lib)/allocator/arena.ts:21:7
(i32.and
;;@ (lib)/allocator/arena.ts:20:8
;;@ (lib)/allocator/arena.ts:21:8
(i32.add
;;@ (lib)/allocator/arena.ts:20:9
;;@ (lib)/allocator/arena.ts:21:9
(get_local $2)
;;@ (lib)/allocator/arena.ts:20:15
;;@ (lib)/allocator/arena.ts:21:15
(i32.const 65535)
)
;;@ (lib)/allocator/arena.ts:20:25
;;@ (lib)/allocator/arena.ts:21:25
(i32.xor
;;@ (lib)/allocator/arena.ts:20:26
;;@ (lib)/allocator/arena.ts:21:26
(i32.const 65535)
(i32.const -1)
)
)
;;@ (lib)/allocator/arena.ts:20:36
;;@ (lib)/allocator/arena.ts:21:36
(get_local $3)
)
;;@ (lib)/allocator/arena.ts:20:46
;;@ (lib)/allocator/arena.ts:21:46
(i32.const 16)
)
)
(tee_local $5
;;@ (lib)/allocator/arena.ts:21:6
;;@ (lib)/allocator/arena.ts:22:6
(i32.shr_u
(get_local $3)
;;@ (lib)/allocator/arena.ts:21:46
;;@ (lib)/allocator/arena.ts:22:46
(i32.const 16)
)
)
@ -136,22 +136,22 @@
)
)
)
;;@ (lib)/allocator/arena.ts:23:6
;;@ (lib)/allocator/arena.ts:24:6
(i32.const 0)
)
(get_local $4)
)
(i32.const 1)
)
;;@ (lib)/allocator/arena.ts:23:9
;;@ (lib)/allocator/arena.ts:24:9
(unreachable)
)
;;@ (lib)/allocator/arena.ts:24:2
;;@ (lib)/allocator/arena.ts:25:2
(set_global "$(lib)/allocator/arena/HEAP_OFFSET"
;;@ (lib)/allocator/arena.ts:24:16
;;@ (lib)/allocator/arena.ts:25:16
(get_local $2)
)
;;@ (lib)/allocator/arena.ts:25:9
;;@ (lib)/allocator/arena.ts:26:9
(return
(get_local $1)
)

Some files were not shown because too many files have changed in this diff Show More