@@ -1249,8 +1249,8 @@ private void emitFragment(int fno, int begin, int end) {
1249
1249
for (int i = 0 ; i < exitPts .length ; i ++)
1250
1250
exitTrampolineLabels .put (exitPts [i ], new Label ());
1251
1251
1252
- Label [] insnLabels = new Label [end - begin ];
1253
- for (int i = 0 ; i < end - begin ; i ++)
1252
+ Label [] insnLabels = new Label [end - begin + 1 ];
1253
+ for (int i = 0 ; i < end - begin + 1 ; i ++)
1254
1254
insnLabels [i ] = new Label ();
1255
1255
1256
1256
// common entry code
@@ -1268,6 +1268,18 @@ private void emitFragment(int fno, int begin, int end) {
1268
1268
int stash = nlocal ;
1269
1269
int scratch = nlocal +1 ;
1270
1270
1271
+ // emit salient tryblocks
1272
+ for (TryCatchBlockNode tcbn : (List <TryCatchBlockNode >) tryCatchBlocks ) {
1273
+ int nstart = Math .max (begin , insnMap .get (tcbn .start ));
1274
+ int nend = Math .min (end , insnMap .get (tcbn .end ));
1275
+ int nhndlr = insnMap .get (tcbn .handler );
1276
+ if (nstart >= nend ) continue ;
1277
+
1278
+ v .visitTryCatchBlock (insnLabels [nstart - begin ], insnLabels [nend - begin ],
1279
+ exitTrampolineLabels .containsKey (nhndlr ) ? exitTrampolineLabels .get (nhndlr ) : insnLabels [nhndlr - begin ],
1280
+ tcbn .type );
1281
+ }
1282
+
1271
1283
// uncommon entry code
1272
1284
for (int ept : entryPts ) {
1273
1285
v .visitLabel (entryTrampolineLabels [jumpNoMap [ept ]-firstj ]);
@@ -1288,10 +1300,19 @@ private void emitFragment(int fno, int begin, int end) {
1288
1300
for (int iix = begin ; iix < end ; iix ++) {
1289
1301
emitFragmentInsn (v , iix , begin , insnLabels , exitTrampolineLabels , spilledUTypes );
1290
1302
}
1303
+ v .visitLabel (insnLabels [end - begin ]);
1291
1304
1292
1305
if (exitTrampolineLabels .containsKey (end ))
1293
1306
v .visitJumpInsn (Opcodes .GOTO , exitTrampolineLabels .get (end ));
1294
1307
1308
+ int lineno = -1 ;
1309
+ for (int i = begin ; i < end ; i ++) {
1310
+ if (lineNumbers [i ] != lineno ) {
1311
+ lineno = lineNumbers [i ];
1312
+ v .visitLineNumber (lineno , insnLabels [i -begin ]);
1313
+ }
1314
+ }
1315
+
1295
1316
Label commonExitLabel = new Label ();
1296
1317
1297
1318
// uncommon exit code
0 commit comments