1452 void genCatch(JCCatch tree, |
1452 void genCatch(JCCatch tree, |
1453 Env<GenContext> env, |
1453 Env<GenContext> env, |
1454 int startpc, int endpc, |
1454 int startpc, int endpc, |
1455 List<Integer> gaps) { |
1455 List<Integer> gaps) { |
1456 if (startpc != endpc) { |
1456 if (startpc != endpc) { |
1457 int catchType = makeRef(tree.pos(), tree.param.type); |
1457 List<JCExpression> subClauses = TreeInfo.isMultiCatch(tree) ? |
1458 while (gaps.nonEmpty()) { |
1458 ((JCTypeDisjoint)tree.param.vartype).components : |
1459 int end = gaps.head.intValue(); |
1459 List.of(tree.param.vartype); |
1460 registerCatch(tree.pos(), |
1460 for (JCExpression subCatch : subClauses) { |
1461 startpc, end, code.curPc(), |
1461 int catchType = makeRef(tree.pos(), subCatch.type); |
1462 catchType); |
1462 List<Integer> lGaps = gaps; |
1463 gaps = gaps.tail; |
1463 while (lGaps.nonEmpty()) { |
1464 startpc = gaps.head.intValue(); |
1464 int end = lGaps.head.intValue(); |
1465 gaps = gaps.tail; |
1465 registerCatch(tree.pos(), |
1466 } |
1466 startpc, end, code.curPc(), |
1467 if (startpc < endpc) |
1467 catchType); |
1468 registerCatch(tree.pos(), |
1468 lGaps = lGaps.tail; |
1469 startpc, endpc, code.curPc(), |
1469 startpc = lGaps.head.intValue(); |
1470 catchType); |
1470 lGaps = lGaps.tail; |
|
1471 } |
|
1472 if (startpc < endpc) |
|
1473 registerCatch(tree.pos(), |
|
1474 startpc, endpc, code.curPc(), |
|
1475 catchType); |
|
1476 } |
1471 VarSymbol exparam = tree.param.sym; |
1477 VarSymbol exparam = tree.param.sym; |
1472 code.statBegin(tree.pos); |
1478 code.statBegin(tree.pos); |
1473 code.markStatBegin(); |
1479 code.markStatBegin(); |
1474 int limit = code.nextreg; |
1480 int limit = code.nextreg; |
1475 int exlocal = code.newLocal(exparam); |
1481 int exlocal = code.newLocal(exparam); |