mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-21 18:51:43 +00:00
Rework resolver (#489)
* 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
This commit is contained in:
@ -7,32 +7,32 @@
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\16\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s\00")
|
||||
(table $0 5 funcref)
|
||||
(elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~someName|3 $start~anonymous|4)
|
||||
(elem (i32.const 0) $null $start:function-expression~anonymous|1 $start:function-expression~anonymous|2 $start:function-expression~someName|3 $start:function-expression~anonymous|4)
|
||||
(global $function-expression/f1 (mut i32) (i32.const 1))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $function-expression/f2 (mut i32) (i32.const 2))
|
||||
(global $function-expression/f3 (mut i32) (i32.const 3))
|
||||
(global $function-expression/f4 (mut i32) (i32.const 4))
|
||||
(global $HEAP_BASE i32 (i32.const 56))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 56))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:function-expression~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
)
|
||||
(func $start~anonymous|2 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:function-expression~anonymous|2 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
)
|
||||
(func $start~someName|3 (; 3 ;) (type $_)
|
||||
(func $start:function-expression~someName|3 (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start~anonymous|4 (; 4 ;) (type $i) (result i32)
|
||||
(func $start:function-expression~anonymous|4 (; 4 ;) (type $i) (result i32)
|
||||
i32.const 1
|
||||
)
|
||||
(func $start (; 5 ;) (type $_)
|
||||
(func $start:function-expression (; 5 ;) (type $_)
|
||||
block (result i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 1
|
||||
global.get $function-expression/f1
|
||||
call_indirect (type $ii)
|
||||
@ -50,7 +50,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 2
|
||||
global.get $function-expression/f2
|
||||
call_indirect (type $ii)
|
||||
@ -68,13 +68,13 @@
|
||||
end
|
||||
block
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
global.get $function-expression/f3
|
||||
call_indirect (type $_)
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
global.get $function-expression/f4
|
||||
call_indirect (type $i)
|
||||
end
|
||||
@ -90,6 +90,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 6 ;) (type $_)
|
||||
(func $start (; 6 ;) (type $_)
|
||||
call $start:function-expression
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user