mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-14 07:21:30 +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:
@ -1,8 +1,8 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $i_ (func (param i32)))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $ii_ (func (param i32 i32)))
|
||||
(type $_ (func))
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $iii_ (func (param i32 i32 i32)))
|
||||
(type $iiii_ (func (param i32 i32 i32 i32)))
|
||||
@ -24,8 +24,8 @@
|
||||
(global $~lib/collector/itcm/toSpace (mut i32) (i32.const 0))
|
||||
(global $~lib/collector/itcm/iter (mut i32) (i32.const 0))
|
||||
(global $std/gc-array/arr (mut i32) (i32.const 48))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~started (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $~lib/started (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "main" (func $std/gc-array/main))
|
||||
@ -292,7 +292,7 @@
|
||||
i32.or
|
||||
i32.store
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
i32.const 16
|
||||
i32.add
|
||||
@ -1913,23 +1913,11 @@
|
||||
local.get $2
|
||||
call $~lib/collector/itcm/__gc_link
|
||||
)
|
||||
(func $std/gc-array/main (; 18 ;) (type $i) (result i32)
|
||||
global.get $~started
|
||||
i32.eqz
|
||||
if
|
||||
call $start
|
||||
i32.const 1
|
||||
global.set $~started
|
||||
end
|
||||
i32.const 0
|
||||
)
|
||||
(func $start (; 19 ;) (type $_)
|
||||
(func $start:std/gc-array (; 18 ;) (type $_)
|
||||
i32.const 184
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
i32.const 0
|
||||
global.set $~lib/collector/itcm/state
|
||||
call $~lib/collector/itcm/__gc_collect
|
||||
global.get $std/gc-array/arr
|
||||
i32.const 0
|
||||
@ -1953,6 +1941,16 @@
|
||||
call $~lib/array/Array<Foo>#__set
|
||||
call $~lib/collector/itcm/__gc_collect
|
||||
)
|
||||
(func $std/gc-array/main (; 19 ;) (type $i) (result i32)
|
||||
global.get $~lib/started
|
||||
i32.eqz
|
||||
if
|
||||
call $start:std/gc-array
|
||||
i32.const 1
|
||||
global.set $~lib/started
|
||||
end
|
||||
i32.const 0
|
||||
)
|
||||
(func $null (; 20 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
|
Reference in New Issue
Block a user