mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-31 06:02:11 +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,9 +7,9 @@
|
||||
(data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s\00")
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $null $call-optional/opt|trampoline)
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $call-optional/optIndirect (mut i32) (i32.const 1))
|
||||
(global $HEAP_BASE i32 (i32.const 44))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 44))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@@ -25,7 +25,7 @@
|
||||
block $1of2
|
||||
block $0of2
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
i32.const 1
|
||||
i32.sub
|
||||
br_table $0of2 $1of2 $2of2 $outOfRange
|
||||
@@ -43,10 +43,10 @@
|
||||
local.get $2
|
||||
call $call-optional/opt
|
||||
)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
(func $start:call-optional (; 3 ;) (type $_)
|
||||
block (result i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 0
|
||||
i32.const 0
|
||||
@@ -65,7 +65,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 4
|
||||
i32.const 0
|
||||
@@ -99,7 +99,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 0
|
||||
i32.const 0
|
||||
@@ -119,7 +119,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 4
|
||||
i32.const 0
|
||||
@@ -139,7 +139,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 3
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 4
|
||||
i32.const 5
|
||||
@@ -158,6 +158,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
call $start:call-optional
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user