957 // Clean up |
957 // Clean up |
958 if(stackMap == StackMapFormat.JSR202) { |
958 if(stackMap == StackMapFormat.JSR202) { |
959 code.lastFrame = null; |
959 code.lastFrame = null; |
960 code.frameBeforeLast = null; |
960 code.frameBeforeLast = null; |
961 } |
961 } |
|
962 |
|
963 //compress exception table |
|
964 code.compressCatchTable(); |
962 } |
965 } |
963 } |
966 } |
964 |
967 |
965 private int initCode(JCMethodDecl tree, Env<GenContext> env, boolean fatcode) { |
968 private int initCode(JCMethodDecl tree, Env<GenContext> env, boolean fatcode) { |
966 MethodSymbol meth = tree.sym; |
969 MethodSymbol meth = tree.sym; |
1494 /** Register a catch clause in the "Exceptions" code-attribute. |
1496 /** Register a catch clause in the "Exceptions" code-attribute. |
1495 */ |
1497 */ |
1496 void registerCatch(DiagnosticPosition pos, |
1498 void registerCatch(DiagnosticPosition pos, |
1497 int startpc, int endpc, |
1499 int startpc, int endpc, |
1498 int handler_pc, int catch_type) { |
1500 int handler_pc, int catch_type) { |
1499 if (startpc != endpc) { |
1501 char startpc1 = (char)startpc; |
1500 char startpc1 = (char)startpc; |
1502 char endpc1 = (char)endpc; |
1501 char endpc1 = (char)endpc; |
1503 char handler_pc1 = (char)handler_pc; |
1502 char handler_pc1 = (char)handler_pc; |
1504 if (startpc1 == startpc && |
1503 if (startpc1 == startpc && |
1505 endpc1 == endpc && |
1504 endpc1 == endpc && |
1506 handler_pc1 == handler_pc) { |
1505 handler_pc1 == handler_pc) { |
1507 code.addCatch(startpc1, endpc1, handler_pc1, |
1506 code.addCatch(startpc1, endpc1, handler_pc1, |
1508 (char)catch_type); |
1507 (char)catch_type); |
1509 } else { |
|
1510 if (!useJsrLocally && !target.generateStackMapTable()) { |
|
1511 useJsrLocally = true; |
|
1512 throw new CodeSizeOverflow(); |
1508 } else { |
1513 } else { |
1509 if (!useJsrLocally && !target.generateStackMapTable()) { |
1514 log.error(pos, "limit.code.too.large.for.try.stmt"); |
1510 useJsrLocally = true; |
1515 nerrs++; |
1511 throw new CodeSizeOverflow(); |
|
1512 } else { |
|
1513 log.error(pos, "limit.code.too.large.for.try.stmt"); |
|
1514 nerrs++; |
|
1515 } |
|
1516 } |
1516 } |
1517 } |
1517 } |
1518 } |
1518 } |
1519 |
1519 |
1520 /** Very roughly estimate the number of instructions needed for |
1520 /** Very roughly estimate the number of instructions needed for |