mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-05-01 09:52:19 +00:00
* Rename memory instructions as proposed by the bulk-memory-operations spec. * Rename memory manager functions to memory.* as well * Remove automatic inlining of constant globals (Binaryen does this now) * Improve 'const' enum compatibility * Improve module-level export generation * Enable the inline decorator for constant variables * Add ERROR, WARNING and INFO macros that emit a user-defined diagnostic * Reintroduce builtin decorator so these can appear anywhere in stdlib again * Inline isNaN and isFinite by default * Make an interface around gc.* similar to memory.* * Emit an error when trying to inline a mutable variable * Slim down CI stages * Add a more convenient tracing utility for debugging * Implement some prequesites for an eventual bundled GC
97 lines
2.2 KiB
Plaintext
97 lines
2.2 KiB
Plaintext
(module
|
|
(type $iv (func (param i32)))
|
|
(type $iiiiv (func (param i32 i32 i32 i32)))
|
|
(type $v (func))
|
|
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
|
(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))
|
|
(table 1 1 anyfunc)
|
|
(elem (i32.const 0) $start~anonymous|0)
|
|
(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")
|
|
(export "memory" (memory $0))
|
|
(export "table" (table $0))
|
|
(start $start)
|
|
(func $start~anonymous|0 (; 1 ;) (type $iv) (param $0 i32)
|
|
(if
|
|
(i32.eqz
|
|
(i32.eq
|
|
(get_local $0)
|
|
(i32.shl
|
|
(block (result i32)
|
|
(set_global $std/gc-integration/i
|
|
(i32.add
|
|
(get_global $std/gc-integration/i)
|
|
(i32.const 1)
|
|
)
|
|
)
|
|
(get_global $std/gc-integration/i)
|
|
)
|
|
(i32.const 3)
|
|
)
|
|
)
|
|
)
|
|
(block
|
|
(call $~lib/env/abort
|
|
(i32.const 0)
|
|
(i32.const 8)
|
|
(i32.const 14)
|
|
(i32.const 37)
|
|
)
|
|
(unreachable)
|
|
)
|
|
)
|
|
)
|
|
(func $start (; 2 ;) (type $v)
|
|
(drop
|
|
(get_global $std/gc-integration/B.c)
|
|
)
|
|
(drop
|
|
(get_global $std/gc-integration/B.d)
|
|
)
|
|
(call $~iterateRoots
|
|
(i32.const 0)
|
|
)
|
|
(if
|
|
(i32.eqz
|
|
(i32.eq
|
|
(get_global $std/gc-integration/i)
|
|
(i32.const 4)
|
|
)
|
|
)
|
|
(block
|
|
(call $~lib/env/abort
|
|
(i32.const 0)
|
|
(i32.const 8)
|
|
(i32.const 15)
|
|
(i32.const 0)
|
|
)
|
|
(unreachable)
|
|
)
|
|
)
|
|
)
|
|
(func $~iterateRoots (; 3 ;) (type $iv) (param $0 i32)
|
|
(call_indirect (type $iv)
|
|
(get_global $std/gc-integration/B.c)
|
|
(get_local $0)
|
|
)
|
|
(call_indirect (type $iv)
|
|
(get_global $std/gc-integration/B.d)
|
|
(get_local $0)
|
|
)
|
|
(call_indirect (type $iv)
|
|
(get_global $std/gc-integration/a_ref)
|
|
(get_local $0)
|
|
)
|
|
(call_indirect (type $iv)
|
|
(get_global $std/gc-integration/b_ref)
|
|
(get_local $0)
|
|
)
|
|
)
|
|
)
|