@@ -72,7 +72,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
72
72
List (
73
73
Label (0 ),
74
74
LineNumber (6 , Label (0 )), // Position of the method start
75
- LineNumber (7 , Label (0 )), // Position of the call to `track`
75
+ LineNumber (3 , Label (0 )), // Position of the call to `track`
76
76
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
77
77
Ldc (LDC , " tracking" ),
78
78
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" , " (Ljava/lang/Object;)V" , false ),
@@ -82,7 +82,7 @@ class InlineBytecodeTests extends DottyBytecodeTest {
82
82
Ldc (LDC , " abc" ),
83
83
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" ," (Ljava/lang/Object;)V" , false ),
84
84
Label (11 ),
85
- LineNumber (9 , Label (11 )), // Position of the call to `track`
85
+ LineNumber (3 , Label (11 )), // Position of the call to `track`
86
86
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
87
87
Ldc (LDC , " tracking" ),
88
88
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" ," (Ljava/lang/Object;)V" , false ),
@@ -132,21 +132,23 @@ class InlineBytecodeTests extends DottyBytecodeTest {
132
132
val expected =
133
133
List (
134
134
Label (0 ),
135
- LineNumber (12 , Label (0 )), // Position of the method start
136
- LineNumber (13 , Label (0 )), // Position of the call to `track`
135
+ LineNumber (12 , Label (0 )),
136
+ LineNumber (7 , Label (0 )),
137
137
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
138
138
Ldc (LDC , " tracking" ),
139
139
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" , " (Ljava/lang/Object;)V" , false ),
140
+ Label (6 ),
141
+ LineNumber (3 , Label (6 )),
140
142
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
141
143
Ldc (LDC , " tracking2" ),
142
144
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" ," (Ljava/lang/Object;)V" , false ),
143
- Label (9 ),
144
- LineNumber (14 , Label (9 )), // Actual position
145
+ Label (11 ),
146
+ LineNumber (14 , Label (11 )),
145
147
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
146
148
Ldc (LDC , " abc" ),
147
149
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" ," (Ljava/lang/Object;)V" , false ),
148
150
Op (RETURN ),
149
- Label (15 )
151
+ Label (17 )
150
152
)
151
153
assert(instructions == expected,
152
154
" `track` was not properly inlined in `main`\n " + diffInstructions(instructions, expected))
@@ -186,21 +188,23 @@ class InlineBytecodeTests extends DottyBytecodeTest {
186
188
val expected =
187
189
List (
188
190
Label (0 ),
189
- LineNumber (12 , Label (0 )), // Position of the method start
190
- LineNumber (13 , Label (0 )), // Position of the call to `track`
191
+ LineNumber (12 , Label (0 )),
192
+ LineNumber (3 , Label (0 )),
191
193
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
192
194
Ldc (LDC , " tracking2" ),
193
195
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" , " (Ljava/lang/Object;)V" , false ),
196
+ Label (6 ),
197
+ LineNumber (8 , Label (6 )),
194
198
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
195
199
Ldc (LDC , " fgh" ),
196
200
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" ," (Ljava/lang/Object;)V" , false ),
197
- Label (9 ),
198
- LineNumber (14 , Label (9 )), // Actual position
201
+ Label (11 ),
202
+ LineNumber (14 , Label (11 )),
199
203
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
200
204
Ldc (LDC , " abc" ),
201
205
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" ," (Ljava/lang/Object;)V" , false ),
202
206
Op (RETURN ),
203
- Label (15 )
207
+ Label (17 )
204
208
)
205
209
assert(instructions == expected,
206
210
" `track` was not properly inlined in `main`\n " + diffInstructions(instructions, expected))
@@ -241,21 +245,23 @@ class InlineBytecodeTests extends DottyBytecodeTest {
241
245
val expected =
242
246
List (
243
247
Label (0 ),
244
- LineNumber (13 , Label (0 )), // Position of the method start
245
- LineNumber (14 , Label (0 )), // Position of the call to `track`
248
+ LineNumber (13 , Label (0 )),
249
+ LineNumber (3 , Label (0 )),
246
250
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
247
251
Ldc (LDC , " tracking2" ),
248
252
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" , " (Ljava/lang/Object;)V" , false ),
253
+ Label (6 ),
254
+ LineNumber (3 , Label (6 )),
249
255
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
250
256
Ldc (LDC , " tracking2" ),
251
257
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" , " (Ljava/lang/Object;)V" , false ),
252
- Label (9 ),
253
- LineNumber (15 , Label (9 )), // Actual position
258
+ Label (11 ),
259
+ LineNumber (15 , Label (11 )),
254
260
Field (GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
255
261
Ldc (LDC , " abc" ),
256
262
Invoke (INVOKEVIRTUAL , " scala/Predef$" , " println" ," (Ljava/lang/Object;)V" , false ),
257
263
Op (RETURN ),
258
- Label (15 )
264
+ Label (17 )
259
265
)
260
266
assert(instructions == expected,
261
267
" `track` was not properly inlined in `main`\n " + diffInstructions(instructions, expected))
0 commit comments