|
7 | 7 | end |
8 | 8 | end |
9 | 9 | #--------------------- |
10 | | -1 (newvar slot₁) |
11 | | -2 (= slot₂ (call core.Box)) |
| 10 | +1 (= slot₂ (call core.Box)) |
| 11 | +2 (newvar slot₁) |
12 | 12 | 3 --- thunk |
13 | | - 1 (global TestMod.##closure#277) |
| 13 | + 1 (global TestMod.#f##0) |
14 | 14 | 2 (call core.svec) |
15 | 15 | 3 (call core.svec :x) |
16 | 16 | 4 (call core.svec) |
17 | | - 5 (call core._structtype TestMod :##closure#277 %₂ %₃ %₄ false 1) |
| 17 | + 5 (call core._structtype TestMod :#f##0 %₂ %₃ %₄ false 1) |
18 | 18 | 6 (call core._setsuper! %₅ core.Function) |
19 | | - 7 (const TestMod.##closure#277) |
20 | | - 8 (= TestMod.##closure#277 %₅) |
| 19 | + 7 (const TestMod.#f##0) |
| 20 | + 8 (= TestMod.#f##0 %₅) |
21 | 21 | 9 (call core.svec core.Box) |
22 | 22 | 10 (call core._typebody! %₅ %₉) |
23 | 23 | 11 (return core.nothing) |
24 | | -4 TestMod.##closure#277 |
| 24 | +4 TestMod.#f##0 |
25 | 25 | 5 (call core.svec %₄ core.Any) |
26 | 26 | 6 (call core.svec) |
27 | 27 | 7 (call core.svec %₅ %₆ :($(QuoteNode(:(#= line 3 =#))))) |
|
39 | 39 | 9 1 |
40 | 40 | 10 slot₂/x |
41 | 41 | 11 (call core.setfield! %₁₀ :contents %₉) |
42 | | -12 TestMod.##closure#277 |
| 42 | +12 TestMod.#f##0 |
43 | 43 | 13 slot₂/f |
44 | 44 | 14 (= slot₁/f (new %₁₂ %₁₃)) |
45 | 45 | 15 slot₁/f |
|
55 | 55 | end |
56 | 56 | end |
57 | 57 | #--------------------- |
58 | | -1 (newvar slot₁) |
59 | | -2 (= slot₂ (call core.Box)) |
| 58 | +1 (= slot₂ (call core.Box)) |
| 59 | +2 (newvar slot₁) |
60 | 60 | 3 --- thunk |
61 | | - 1 (global TestMod.##closure#278) |
| 61 | + 1 (global TestMod.#f##1) |
62 | 62 | 2 (call core.svec) |
63 | 63 | 3 (call core.svec :x) |
64 | 64 | 4 (call core.svec) |
65 | | - 5 (call core._structtype TestMod :##closure#278 %₂ %₃ %₄ false 1) |
| 65 | + 5 (call core._structtype TestMod :#f##1 %₂ %₃ %₄ false 1) |
66 | 66 | 6 (call core._setsuper! %₅ core.Function) |
67 | | - 7 (const TestMod.##closure#278) |
68 | | - 8 (= TestMod.##closure#278 %₅) |
| 67 | + 7 (const TestMod.#f##1) |
| 68 | + 8 (= TestMod.#f##1 %₅) |
69 | 69 | 9 (call core.svec core.Box) |
70 | 70 | 10 (call core._typebody! %₅ %₉) |
71 | 71 | 11 (return core.nothing) |
72 | | -4 TestMod.##closure#278 |
| 72 | +4 TestMod.#f##1 |
73 | 73 | 5 (call core.svec %₄ core.Any) |
74 | 74 | 6 (call core.svec) |
75 | 75 | 7 (call core.svec %₅ %₆ :($(QuoteNode(:(#= line 3 =#))))) |
|
81 | 81 | 9 1 |
82 | 82 | 10 slot₂/x |
83 | 83 | 11 (call core.setfield! %₁₀ :contents %₉) |
84 | | -12 TestMod.##closure#278 |
| 84 | +12 TestMod.#f##1 |
85 | 85 | 13 slot₂/f |
86 | 86 | 14 (= slot₁/f (new %₁₂ %₁₃)) |
87 | 87 | 15 slot₁/f |
88 | 88 | 16 slot₁/f |
89 | 89 | 17 (return %₁₆) |
| 90 | + |
| 91 | +######################################## |
| 92 | +# Function where arguments are captured into a closure |
| 93 | +function f(x) |
| 94 | + function g() |
| 95 | + x = 10 |
| 96 | + end |
| 97 | + g() |
| 98 | + x |
| 99 | +end |
| 100 | +#--------------------- |
| 101 | +1 (method TestMod.f) |
| 102 | +2 --- thunk |
| 103 | + 1 (global TestMod.#f#g##0) |
| 104 | + 2 (call core.svec) |
| 105 | + 3 (call core.svec :x) |
| 106 | + 4 (call core.svec) |
| 107 | + 5 (call core._structtype TestMod :#f#g##0 %₂ %₃ %₄ false 1) |
| 108 | + 6 (call core._setsuper! %₅ core.Function) |
| 109 | + 7 (const TestMod.#f#g##0) |
| 110 | + 8 (= TestMod.#f#g##0 %₅) |
| 111 | + 9 (call core.svec core.Box) |
| 112 | + 10 (call core._typebody! %₅ %₉) |
| 113 | + 11 (return core.nothing) |
| 114 | +3 TestMod.#f#g##0 |
| 115 | +4 (call core.svec %₃) |
| 116 | +5 (call core.svec) |
| 117 | +6 (call core.svec %₄ %₅ :($(QuoteNode(:(#= line 2 =#))))) |
| 118 | +7 --- method core.nothing %₆ |
| 119 | + 1 10 |
| 120 | + 2 (call core.getfield slot₁/x :x) |
| 121 | + 3 (call core.setfield! %₂ :contents %₁) |
| 122 | + 4 (return %₁) |
| 123 | +8 TestMod.f |
| 124 | +9 (call core.Typeof %₈) |
| 125 | +10 (call core.svec %₉ core.Any) |
| 126 | +11 (call core.svec) |
| 127 | +12 (call core.svec %₁₀ %₁₁ :($(QuoteNode(:(#= line 1 =#))))) |
| 128 | +13 --- method core.nothing %₁₂ |
| 129 | + 1 (= slot₂/x (call core.Box slot₂/x)) |
| 130 | + 2 slot₂/x |
| 131 | + 3 (call core.isdefined %₂ :contents) |
| 132 | + 4 (gotoifnot %₃ label₆) |
| 133 | + 5 (goto label₈) |
| 134 | + 6 (newvar slot₅/x) |
| 135 | + 7 slot₅/x |
| 136 | + 8 (call core.getfield %₂ :contents) |
| 137 | + 9 (call core.Box %₈) |
| 138 | + 10 (call core.setfield! slot₂/x :contents %₉) |
| 139 | + 11 (newvar slot₃) |
| 140 | + 12 TestMod.#f#g##0 |
| 141 | + 13 slot₂/g |
| 142 | + 14 (call core.isdefined %₁₃ :contents) |
| 143 | + 15 (gotoifnot %₁₄ label₁₇) |
| 144 | + 16 (goto label₁₉) |
| 145 | + 17 (newvar slot₆/x) |
| 146 | + 18 slot₆/x |
| 147 | + 19 (call core.getfield %₁₃ :contents) |
| 148 | + 20 (= slot₃/g (new %₁₂ %₁₉)) |
| 149 | + 21 slot₃/g |
| 150 | + 22 slot₃/g |
| 151 | + 23 slot₃/g |
| 152 | + 24 (call %₂₃) |
| 153 | + 25 slot₂/x |
| 154 | + 26 (call core.isdefined %₂₅ :contents) |
| 155 | + 27 (gotoifnot %₂₆ label₂₉) |
| 156 | + 28 (goto label₃₁) |
| 157 | + 29 (newvar slot₇/x) |
| 158 | + 30 slot₇/x |
| 159 | + 31 (call core.getfield %₂₅ :contents) |
| 160 | + 32 (call core.isdefined %₃₁ :contents) |
| 161 | + 33 (gotoifnot %₃₂ label₃₅) |
| 162 | + 34 (goto label₃₇) |
| 163 | + 35 (newvar slot₄/x) |
| 164 | + 36 slot₄/x |
| 165 | + 37 (call core.getfield %₃₁ :contents) |
| 166 | + 38 (return %₃₇) |
| 167 | +14 (return %₁₂) |
| 168 | + |
0 commit comments