-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgetter-setter.optimized.wat
72 lines (72 loc) · 1.42 KB
/
getter-setter.optimized.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
(module
(type $i (func (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iv (func (param i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $getter-setter/Foo._bar (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 4) "\10\00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $getter-setter/Foo.get:bar (; 1 ;) (type $i) (result i32)
(get_global $getter-setter/Foo._bar)
)
(func $getter-setter/Foo.set:bar (; 2 ;) (type $iv) (param $0 i32)
(set_global $getter-setter/Foo._bar
(get_local $0)
)
)
(func $start (; 3 ;) (type $v)
(if
(call $getter-setter/Foo.get:bar)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 13)
(i32.const 0)
)
(unreachable)
)
)
(call $getter-setter/Foo.set:bar
(i32.const 1)
)
(if
(i32.ne
(call $getter-setter/Foo.get:bar)
(i32.const 1)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 15)
(i32.const 0)
)
(unreachable)
)
)
(if
(block (result i32)
(call $getter-setter/Foo.set:bar
(i32.const 2)
)
(i32.ne
(call $getter-setter/Foo.get:bar)
(i32.const 2)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 16)
(i32.const 0)
)
(unreachable)
)
)
)
)