2017-12-15 02:50:55 +01:00
|
|
|
(module
|
2018-02-04 07:51:40 +01:00
|
|
|
(type $iiiiv (func (param i32 i32 i32 i32)))
|
2017-12-15 02:50:55 +01:00
|
|
|
(type $iii (func (param i32 i32) (result i32)))
|
|
|
|
(type $fff (func (param f32 f32) (result f32)))
|
2018-03-12 14:06:39 +01:00
|
|
|
(type $ii (func (param i32) (result i32)))
|
2018-01-01 20:27:21 +01:00
|
|
|
(type $iiii (func (param i32 i32 i32) (result i32)))
|
|
|
|
(type $ifff (func (param i32 f32 f32) (result f32)))
|
2017-12-15 02:50:55 +01:00
|
|
|
(type $v (func))
|
2018-05-21 18:48:29 +02:00
|
|
|
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
2018-01-01 20:27:21 +01:00
|
|
|
(global $class/Animal.ONE (mut i32) (i32.const 1))
|
2018-05-14 16:55:55 +02:00
|
|
|
(global $HEAP_BASE i32 (i32.const 28))
|
2017-12-15 02:50:55 +01:00
|
|
|
(memory $0 1)
|
2018-05-14 16:55:55 +02:00
|
|
|
(data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s\00")
|
2018-01-01 20:27:21 +01:00
|
|
|
(export "test" (func $class/test))
|
2017-12-15 02:50:55 +01:00
|
|
|
(export "memory" (memory $0))
|
|
|
|
(start $start)
|
2018-02-04 07:51:40 +01:00
|
|
|
(func $class/Animal.add (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
2018-06-22 15:26:59 +02:00
|
|
|
(i32.add
|
2017-12-15 02:50:55 +01:00
|
|
|
(i32.add
|
2018-06-22 15:26:59 +02:00
|
|
|
(get_local $0)
|
|
|
|
(get_local $1)
|
2017-12-15 02:50:55 +01:00
|
|
|
)
|
2018-06-22 15:26:59 +02:00
|
|
|
(get_global $class/Animal.ONE)
|
2017-12-15 02:50:55 +01:00
|
|
|
)
|
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(func $class/Animal.sub<f32> (; 2 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32)
|
2018-06-22 15:26:59 +02:00
|
|
|
(f32.add
|
|
|
|
(f32.sub
|
|
|
|
(get_local $0)
|
|
|
|
(get_local $1)
|
|
|
|
)
|
|
|
|
(f32.convert_s/i32
|
|
|
|
(get_global $class/Animal.ONE)
|
2018-01-01 20:27:21 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2018-03-20 23:41:37 +01:00
|
|
|
(func $class/Animal<f64>#instanceAdd (; 3 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
2018-06-22 15:26:59 +02:00
|
|
|
(i32.add
|
2018-01-01 20:27:21 +01:00
|
|
|
(i32.add
|
2018-06-22 15:26:59 +02:00
|
|
|
(get_local $1)
|
|
|
|
(get_local $2)
|
2018-01-01 20:27:21 +01:00
|
|
|
)
|
2018-06-22 15:26:59 +02:00
|
|
|
(get_global $class/Animal.ONE)
|
2018-01-01 20:27:21 +01:00
|
|
|
)
|
|
|
|
)
|
2018-03-20 23:41:37 +01:00
|
|
|
(func $class/Animal<f64>#instanceSub<f32> (; 4 ;) (type $ifff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32)
|
2018-06-22 15:26:59 +02:00
|
|
|
(f32.add
|
|
|
|
(f32.sub
|
|
|
|
(get_local $1)
|
|
|
|
(get_local $2)
|
|
|
|
)
|
|
|
|
(f32.convert_s/i32
|
|
|
|
(get_global $class/Animal.ONE)
|
2018-01-01 20:27:21 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(func $class/test (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
2018-01-02 05:02:05 +01:00
|
|
|
(local $1 i32)
|
|
|
|
(local $2 i32)
|
2018-01-01 20:27:21 +01:00
|
|
|
(drop
|
2018-03-20 23:41:37 +01:00
|
|
|
(call $class/Animal<f64>#instanceAdd
|
2018-01-01 20:27:21 +01:00
|
|
|
(get_local $0)
|
|
|
|
(i32.const 1)
|
|
|
|
(i32.const 2)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(drop
|
2018-03-20 23:41:37 +01:00
|
|
|
(call $class/Animal<f64>#instanceSub<f32>
|
2017-12-15 02:50:55 +01:00
|
|
|
(get_local $0)
|
2018-01-01 20:27:21 +01:00
|
|
|
(f32.const 1)
|
|
|
|
(f32.const 2)
|
2017-12-15 02:50:55 +01:00
|
|
|
)
|
|
|
|
)
|
2018-01-03 18:33:27 +01:00
|
|
|
(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.add
|
|
|
|
(i32.const 0)
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(i32.store16 offset=4
|
|
|
|
(get_local $0)
|
2018-05-06 00:00:54 +02:00
|
|
|
(i32.add
|
|
|
|
(i32.const 1)
|
|
|
|
(i32.const 1)
|
2018-01-03 18:33:27 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(i32.store8 offset=6
|
|
|
|
(get_local $0)
|
2018-05-06 00:00:54 +02:00
|
|
|
(i32.add
|
|
|
|
(i32.add
|
|
|
|
(i32.const 1)
|
|
|
|
(i32.const 1)
|
2018-01-03 18:33:27 +01:00
|
|
|
)
|
2018-05-06 00:00:54 +02:00
|
|
|
(i32.const 1)
|
2018-01-03 18:33:27 +01:00
|
|
|
)
|
|
|
|
)
|
2018-01-18 23:34:12 +01:00
|
|
|
(set_local $1
|
|
|
|
(get_local $0)
|
2018-01-02 05:02:05 +01:00
|
|
|
)
|
2018-01-18 23:34:12 +01:00
|
|
|
(set_local $2
|
|
|
|
(get_local $1)
|
2018-01-02 05:02:05 +01:00
|
|
|
)
|
2018-06-22 15:26:59 +02:00
|
|
|
(get_local $2)
|
2017-12-15 02:50:55 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(func $start (; 6 ;) (type $v)
|
2018-01-01 20:27:21 +01:00
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
2018-01-13 23:38:07 +01:00
|
|
|
(i32.const 4)
|
|
|
|
(i32.const 4)
|
2018-01-01 20:27:21 +01:00
|
|
|
)
|
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
2018-05-21 18:48:29 +02:00
|
|
|
(call $~lib/env/abort
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 0)
|
2018-05-14 16:55:55 +02:00
|
|
|
(i32.const 8)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 13)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2018-01-01 20:27:21 +01:00
|
|
|
)
|
2017-12-15 02:50:55 +01:00
|
|
|
(drop
|
2018-01-01 20:27:21 +01:00
|
|
|
(get_global $class/Animal.ONE)
|
2017-12-15 02:50:55 +01:00
|
|
|
)
|
|
|
|
(drop
|
|
|
|
(call $class/Animal.add
|
|
|
|
(i32.const 1)
|
|
|
|
(i32.const 2)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(drop
|
|
|
|
(call $class/Animal.sub<f32>
|
|
|
|
(f32.const 1)
|
|
|
|
(f32.const 2)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|