25 |
25 |
26 package com.sun.tools.javac.jvm; |
26 package com.sun.tools.javac.jvm; |
27 |
27 |
28 import java.util.*; |
28 import java.util.*; |
29 |
29 |
|
30 import com.sun.tools.javac.tree.TreeInfo.PosKind; |
30 import com.sun.tools.javac.util.*; |
31 import com.sun.tools.javac.util.*; |
31 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; |
32 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; |
32 import com.sun.tools.javac.util.List; |
33 import com.sun.tools.javac.util.List; |
33 import com.sun.tools.javac.code.*; |
34 import com.sun.tools.javac.code.*; |
34 import com.sun.tools.javac.code.Attribute.TypeCompound; |
35 import com.sun.tools.javac.code.Attribute.TypeCompound; |
1529 int endseg = env.info.gaps.next().intValue(); |
1530 int endseg = env.info.gaps.next().intValue(); |
1530 registerCatch(body.pos(), startseg, endseg, |
1531 registerCatch(body.pos(), startseg, endseg, |
1531 catchallpc, 0); |
1532 catchallpc, 0); |
1532 startseg = env.info.gaps.next().intValue(); |
1533 startseg = env.info.gaps.next().intValue(); |
1533 } |
1534 } |
1534 code.statBegin(TreeInfo.finalizerPos(env.tree)); |
1535 code.statBegin(TreeInfo.finalizerPos(env.tree, PosKind.FIRST_STAT_POS)); |
1535 code.markStatBegin(); |
1536 code.markStatBegin(); |
1536 |
1537 |
1537 Item excVar = makeTemp(syms.throwableType); |
1538 Item excVar = makeTemp(syms.throwableType); |
1538 excVar.store(); |
1539 excVar.store(); |
1539 genFinalizer(env); |
1540 genFinalizer(env); |
|
1541 code.resolvePending(); |
|
1542 code.statBegin(TreeInfo.finalizerPos(env.tree, PosKind.END_POS)); |
|
1543 code.markStatBegin(); |
|
1544 |
1540 excVar.load(); |
1545 excVar.load(); |
1541 registerCatch(body.pos(), startseg, |
1546 registerCatch(body.pos(), startseg, |
1542 env.info.gaps.next().intValue(), |
1547 env.info.gaps.next().intValue(), |
1543 catchallpc, 0); |
1548 catchallpc, 0); |
1544 code.emitop0(athrow); |
1549 code.emitop0(athrow); |
1548 if (env.info.cont != null) { |
1553 if (env.info.cont != null) { |
1549 // Resolve all jsr's. |
1554 // Resolve all jsr's. |
1550 code.resolve(env.info.cont); |
1555 code.resolve(env.info.cont); |
1551 |
1556 |
1552 // Mark statement line number |
1557 // Mark statement line number |
1553 code.statBegin(TreeInfo.finalizerPos(env.tree)); |
1558 code.statBegin(TreeInfo.finalizerPos(env.tree, PosKind.FIRST_STAT_POS)); |
1554 code.markStatBegin(); |
1559 code.markStatBegin(); |
1555 |
1560 |
1556 // Save return address. |
1561 // Save return address. |
1557 LocalItem retVar = makeTemp(syms.throwableType); |
1562 LocalItem retVar = makeTemp(syms.throwableType); |
1558 retVar.store(); |
1563 retVar.store(); |