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
113 lines
2.2 KiB
Plaintext
113 lines
2.2 KiB
Plaintext
(module
|
|
(type $iii (func (param i32 i32) (result i32)))
|
|
(type $fff (func (param f32 f32) (result f32)))
|
|
(type $ii (func (param i32) (result i32)))
|
|
(type $iiii (func (param i32 i32 i32) (result i32)))
|
|
(type $ifff (func (param i32 f32 f32) (result f32)))
|
|
(type $v (func))
|
|
(global $class/Animal.ONE (mut i32) (i32.const 1))
|
|
(memory $0 1)
|
|
(data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s")
|
|
(export "memory" (memory $0))
|
|
(export "test" (func $class/test))
|
|
(start $start)
|
|
(func $class/Animal.add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
|
(i32.add
|
|
(i32.add
|
|
(get_local $0)
|
|
(get_local $1)
|
|
)
|
|
(get_global $class/Animal.ONE)
|
|
)
|
|
)
|
|
(func $class/Animal.sub<f32> (; 1 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32)
|
|
(f32.add
|
|
(f32.sub
|
|
(get_local $0)
|
|
(get_local $1)
|
|
)
|
|
(f32.convert_s/i32
|
|
(get_global $class/Animal.ONE)
|
|
)
|
|
)
|
|
)
|
|
(func $class/Animal<f64>#instanceAdd (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
|
(i32.add
|
|
(i32.add
|
|
(get_local $1)
|
|
(get_local $2)
|
|
)
|
|
(get_global $class/Animal.ONE)
|
|
)
|
|
)
|
|
(func $class/Animal<f64>#instanceSub<f32> (; 3 ;) (type $ifff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32)
|
|
(f32.add
|
|
(f32.sub
|
|
(get_local $1)
|
|
(get_local $2)
|
|
)
|
|
(f32.convert_s/i32
|
|
(get_global $class/Animal.ONE)
|
|
)
|
|
)
|
|
)
|
|
(func $class/test (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
|
(drop
|
|
(call $class/Animal<f64>#instanceAdd
|
|
(get_local $0)
|
|
(i32.const 1)
|
|
(i32.const 2)
|
|
)
|
|
)
|
|
(drop
|
|
(call $class/Animal<f64>#instanceSub<f32>
|
|
(get_local $0)
|
|
(f32.const 1)
|
|
(f32.const 2)
|
|
)
|
|
)
|
|
(drop
|
|
(i32.load
|
|
(get_local $0)
|
|
)
|
|
)
|
|
(drop
|
|
(i32.load16_s offset=4
|
|
(get_local $0)
|
|
)
|
|
)
|
|
(drop
|
|
(i32.load8_s offset=6
|
|
(get_local $0)
|
|
)
|
|
)
|
|
(i32.store
|
|
(get_local $0)
|
|
(i32.const 1)
|
|
)
|
|
(i32.store16 offset=4
|
|
(get_local $0)
|
|
(i32.const 2)
|
|
)
|
|
(i32.store8 offset=6
|
|
(get_local $0)
|
|
(i32.const 3)
|
|
)
|
|
(get_local $0)
|
|
)
|
|
(func $start (; 5 ;) (type $v)
|
|
(drop
|
|
(call $class/Animal.add
|
|
(i32.const 1)
|
|
(i32.const 2)
|
|
)
|
|
)
|
|
(drop
|
|
(call $class/Animal.sub<f32>
|
|
(f32.const 1)
|
|
(f32.const 2)
|
|
)
|
|
)
|
|
)
|
|
)
|