-
-
Notifications
You must be signed in to change notification settings - Fork 670
/
Copy pathclass-extends.debug.wat
110 lines (110 loc) · 2.57 KB
/
class-extends.debug.wat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
(module
(type $0 (func (param i32) (result i32)))
(type $1 (func (param i32 i32)))
(type $2 (func (param i32)))
(type $3 (func (param i32 i32 i32 i32)))
(type $4 (func))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(global $~lib/memory/__data_end i32 (i32.const 8))
(global $~lib/memory/__stack_pointer (mut i32) (i32.const 32776))
(global $~lib/memory/__heap_base i32 (i32.const 32776))
(memory $0 0)
(table $0 1 1 funcref)
(elem $0 (i32.const 1))
(export "memory" (memory $0))
(export "test" (func $export:class-extends/test))
(func $class-extends/A#get:a (param $this i32) (result i32)
local.get $this
i32.load
)
(func $class-extends/B#get:b (param $this i32) (result i32)
local.get $this
i32.load16_s offset=4
)
(func $class-extends/A#set:a (param $this i32) (param $a i32)
local.get $this
local.get $a
i32.store
)
(func $class-extends/B#set:b (param $this i32) (param $b i32)
local.get $this
local.get $b
i32.store16 offset=4
)
(func $~stack_check
global.get $~lib/memory/__stack_pointer
global.get $~lib/memory/__data_end
i32.lt_s
if
i32.const 32800
i32.const 32848
i32.const 1
i32.const 1
call $~lib/builtins/abort
unreachable
end
)
(func $class-extends/test (param $b i32)
(local $1 i32)
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.sub
global.set $~lib/memory/__stack_pointer
call $~stack_check
global.get $~lib/memory/__stack_pointer
i32.const 0
i32.store
local.get $b
local.set $1
global.get $~lib/memory/__stack_pointer
local.get $1
i32.store
local.get $1
call $class-extends/A#get:a
drop
local.get $b
local.set $1
global.get $~lib/memory/__stack_pointer
local.get $1
i32.store
local.get $1
call $class-extends/B#get:b
drop
local.get $b
local.set $1
global.get $~lib/memory/__stack_pointer
local.get $1
i32.store
local.get $1
i32.const 2
call $class-extends/A#set:a
local.get $b
local.set $1
global.get $~lib/memory/__stack_pointer
local.get $1
i32.store
local.get $1
i32.const 3
call $class-extends/B#set:b
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.add
global.set $~lib/memory/__stack_pointer
)
(func $export:class-extends/test (param $0 i32)
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.sub
global.set $~lib/memory/__stack_pointer
call $~stack_check
global.get $~lib/memory/__stack_pointer
local.get $0
i32.store
local.get $0
call $class-extends/test
global.get $~lib/memory/__stack_pointer
i32.const 4
i32.add
global.set $~lib/memory/__stack_pointer
)
)