mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-25 15:12:12 +00:00
* Rework IR and resolver to use nested lookup tables * Integrate types into IR * Make components prefer IR, slimmed down AST * Implement `export *` * Add `@lazy` annotation and remove `--noTreeShaking` * Add `@start` annotation and remove magic `main` * Related refactoring, cleanup and docs
348 lines
5.4 KiB
Plaintext
348 lines
5.4 KiB
Plaintext
(module
|
|
(type $iiii (func (param i32 i32 i32) (result i32)))
|
|
(type $iiii_ (func (param i32 i32 i32 i32)))
|
|
(type $_ (func))
|
|
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
|
(memory $0 1)
|
|
(data (i32.const 8) "\t\00\00\00m\00e\00m\00s\00e\00t\00.\00t\00s")
|
|
(table $0 1 funcref)
|
|
(elem (i32.const 0) $null)
|
|
(global $memset/dest (mut i32) (i32.const 0))
|
|
(export "memory" (memory $0))
|
|
(export "table" (table $0))
|
|
(start $start)
|
|
(func $memset/memset (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
|
(local $3 i32)
|
|
(local $4 i32)
|
|
(local $5 i64)
|
|
local.get $0
|
|
local.set $3
|
|
block $folding-inner0
|
|
local.get $2
|
|
i32.eqz
|
|
br_if $folding-inner0
|
|
local.get $3
|
|
local.get $1
|
|
i32.store8
|
|
local.get $2
|
|
local.get $3
|
|
i32.add
|
|
i32.const 1
|
|
i32.sub
|
|
local.get $1
|
|
i32.store8
|
|
local.get $2
|
|
i32.const 2
|
|
i32.le_u
|
|
br_if $folding-inner0
|
|
local.get $3
|
|
i32.const 1
|
|
i32.add
|
|
local.get $1
|
|
i32.store8
|
|
local.get $3
|
|
i32.const 2
|
|
i32.add
|
|
local.get $1
|
|
i32.store8
|
|
local.get $2
|
|
local.get $3
|
|
i32.add
|
|
local.tee $0
|
|
i32.const 2
|
|
i32.sub
|
|
local.get $1
|
|
i32.store8
|
|
local.get $0
|
|
i32.const 3
|
|
i32.sub
|
|
local.get $1
|
|
i32.store8
|
|
local.get $2
|
|
i32.const 6
|
|
i32.le_u
|
|
br_if $folding-inner0
|
|
local.get $3
|
|
i32.const 3
|
|
i32.add
|
|
local.get $1
|
|
i32.store8
|
|
local.get $2
|
|
local.get $3
|
|
i32.add
|
|
i32.const 4
|
|
i32.sub
|
|
local.get $1
|
|
i32.store8
|
|
local.get $2
|
|
i32.const 8
|
|
i32.le_u
|
|
br_if $folding-inner0
|
|
local.get $2
|
|
i32.const 0
|
|
local.get $3
|
|
i32.sub
|
|
i32.const 3
|
|
i32.and
|
|
local.tee $4
|
|
i32.sub
|
|
local.set $2
|
|
local.get $3
|
|
local.get $4
|
|
i32.add
|
|
local.tee $0
|
|
local.get $1
|
|
i32.const 255
|
|
i32.and
|
|
i32.const 16843009
|
|
i32.mul
|
|
local.tee $1
|
|
i32.store
|
|
local.get $2
|
|
i32.const -4
|
|
i32.and
|
|
local.tee $2
|
|
local.get $0
|
|
i32.add
|
|
i32.const 4
|
|
i32.sub
|
|
local.get $1
|
|
i32.store
|
|
local.get $2
|
|
i32.const 8
|
|
i32.le_u
|
|
br_if $folding-inner0
|
|
local.get $0
|
|
i32.const 4
|
|
i32.add
|
|
local.get $1
|
|
i32.store
|
|
local.get $0
|
|
i32.const 8
|
|
i32.add
|
|
local.get $1
|
|
i32.store
|
|
local.get $0
|
|
local.get $2
|
|
i32.add
|
|
local.tee $4
|
|
i32.const 12
|
|
i32.sub
|
|
local.get $1
|
|
i32.store
|
|
local.get $4
|
|
i32.const 8
|
|
i32.sub
|
|
local.get $1
|
|
i32.store
|
|
local.get $2
|
|
i32.const 24
|
|
i32.le_u
|
|
br_if $folding-inner0
|
|
local.get $0
|
|
i32.const 12
|
|
i32.add
|
|
local.get $1
|
|
i32.store
|
|
local.get $0
|
|
i32.const 16
|
|
i32.add
|
|
local.get $1
|
|
i32.store
|
|
local.get $0
|
|
i32.const 20
|
|
i32.add
|
|
local.get $1
|
|
i32.store
|
|
local.get $0
|
|
i32.const 24
|
|
i32.add
|
|
local.get $1
|
|
i32.store
|
|
local.get $0
|
|
local.get $2
|
|
i32.add
|
|
local.tee $4
|
|
i32.const 28
|
|
i32.sub
|
|
local.get $1
|
|
i32.store
|
|
local.get $4
|
|
i32.const 24
|
|
i32.sub
|
|
local.get $1
|
|
i32.store
|
|
local.get $4
|
|
i32.const 20
|
|
i32.sub
|
|
local.get $1
|
|
i32.store
|
|
local.get $4
|
|
i32.const 16
|
|
i32.sub
|
|
local.get $1
|
|
i32.store
|
|
local.get $0
|
|
i32.const 4
|
|
i32.and
|
|
i32.const 24
|
|
i32.add
|
|
local.tee $4
|
|
local.get $0
|
|
i32.add
|
|
local.set $0
|
|
local.get $2
|
|
local.get $4
|
|
i32.sub
|
|
local.set $2
|
|
local.get $1
|
|
i64.extend_i32_u
|
|
local.tee $5
|
|
local.get $5
|
|
i64.const 32
|
|
i64.shl
|
|
i64.or
|
|
local.set $5
|
|
loop $continue|0
|
|
local.get $2
|
|
i32.const 32
|
|
i32.ge_u
|
|
if
|
|
local.get $0
|
|
local.get $5
|
|
i64.store
|
|
local.get $0
|
|
i32.const 8
|
|
i32.add
|
|
local.get $5
|
|
i64.store
|
|
local.get $0
|
|
i32.const 16
|
|
i32.add
|
|
local.get $5
|
|
i64.store
|
|
local.get $0
|
|
i32.const 24
|
|
i32.add
|
|
local.get $5
|
|
i64.store
|
|
local.get $2
|
|
i32.const 32
|
|
i32.sub
|
|
local.set $2
|
|
local.get $0
|
|
i32.const 32
|
|
i32.add
|
|
local.set $0
|
|
br $continue|0
|
|
end
|
|
end
|
|
local.get $3
|
|
return
|
|
end
|
|
local.get $3
|
|
)
|
|
(func $start:memset (; 2 ;) (type $_)
|
|
i32.const 32
|
|
global.set $memset/dest
|
|
global.get $memset/dest
|
|
i32.const 1
|
|
i32.const 16
|
|
call $memset/memset
|
|
drop
|
|
global.get $memset/dest
|
|
i32.load8_u
|
|
i32.const 1
|
|
i32.ne
|
|
if
|
|
i32.const 0
|
|
i32.const 8
|
|
i32.const 72
|
|
i32.const 0
|
|
call $~lib/env/abort
|
|
unreachable
|
|
end
|
|
global.get $memset/dest
|
|
i32.const 15
|
|
i32.add
|
|
i32.load8_u
|
|
i32.const 1
|
|
i32.ne
|
|
if
|
|
i32.const 0
|
|
i32.const 8
|
|
i32.const 73
|
|
i32.const 0
|
|
call $~lib/env/abort
|
|
unreachable
|
|
end
|
|
global.get $memset/dest
|
|
i32.const 1
|
|
i32.add
|
|
i32.const 2
|
|
i32.const 14
|
|
call $memset/memset
|
|
drop
|
|
global.get $memset/dest
|
|
i32.load8_u
|
|
i32.const 1
|
|
i32.ne
|
|
if
|
|
i32.const 0
|
|
i32.const 8
|
|
i32.const 77
|
|
i32.const 0
|
|
call $~lib/env/abort
|
|
unreachable
|
|
end
|
|
global.get $memset/dest
|
|
i32.const 1
|
|
i32.add
|
|
i32.load8_u
|
|
i32.const 2
|
|
i32.ne
|
|
if
|
|
i32.const 0
|
|
i32.const 8
|
|
i32.const 78
|
|
i32.const 0
|
|
call $~lib/env/abort
|
|
unreachable
|
|
end
|
|
global.get $memset/dest
|
|
i32.const 14
|
|
i32.add
|
|
i32.load8_u
|
|
i32.const 2
|
|
i32.ne
|
|
if
|
|
i32.const 0
|
|
i32.const 8
|
|
i32.const 79
|
|
i32.const 0
|
|
call $~lib/env/abort
|
|
unreachable
|
|
end
|
|
global.get $memset/dest
|
|
i32.const 15
|
|
i32.add
|
|
i32.load8_u
|
|
i32.const 1
|
|
i32.ne
|
|
if
|
|
i32.const 0
|
|
i32.const 8
|
|
i32.const 80
|
|
i32.const 0
|
|
call $~lib/env/abort
|
|
unreachable
|
|
end
|
|
)
|
|
(func $start (; 3 ;) (type $_)
|
|
call $start:memset
|
|
)
|
|
(func $null (; 4 ;) (type $_)
|
|
nop
|
|
)
|
|
)
|