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:
Daniel Wirtz
2019-02-21 00:11:22 +01:00
committed by GitHub
parent e623786b42
commit 0c64f21250
234 changed files with 16949 additions and 37871 deletions

View File

@ -6,18 +6,18 @@
(memory $0 1)
(data (i32.const 8) "\15\00\00\00s\00t\00d\00/\00g\00c\00-\00i\00n\00t\00e\00g\00r\00a\00t\00i\00o\00n\00.\00t\00s\00")
(table $0 2 funcref)
(elem (i32.const 0) $null $start~anonymous|1)
(elem (i32.const 0) $null $start:std/gc-integration~anonymous|1)
(global $std/gc-integration/B.c i32 (i32.const 8))
(global $std/gc-integration/B.d (mut i32) (i32.const 16))
(global $std/gc-integration/no_ref (mut i32) (i32.const 64))
(global $std/gc-integration/a_ref (mut i32) (i32.const 24))
(global $std/gc-integration/b_ref (mut i32) (i32.const 32))
(global $std/gc-integration/i (mut i32) (i32.const 0))
(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 $i_) (param $0 i32)
(func $start:std/gc-integration~anonymous|1 (; 1 ;) (type $i_) (param $0 i32)
local.get $0
block (result i32)
global.get $std/gc-integration/i
@ -39,7 +39,7 @@
unreachable
end
)
(func $start (; 2 ;) (type $_)
(func $start:std/gc-integration (; 2 ;) (type $_)
global.get $std/gc-integration/B.c
drop
global.get $std/gc-integration/B.d
@ -59,9 +59,12 @@
unreachable
end
)
(func $null (; 3 ;) (type $_)
(func $start (; 3 ;) (type $_)
call $start:std/gc-integration
)
(func $~iterateRoots (; 4 ;) (type $i_) (param $0 i32)
(func $null (; 4 ;) (type $_)
)
(func $~iterateRoots (; 5 ;) (type $i_) (param $0 i32)
global.get $std/gc-integration/B.c
local.get $0
call_indirect (type $i_)