Lines 1268-1274
Link Here
|
1268 |
this.contents[codeAttributeOffset + 13] = (byte) code_length; |
1268 |
this.contents[codeAttributeOffset + 13] = (byte) code_length; |
1269 |
|
1269 |
|
1270 |
// write the exception table |
1270 |
// write the exception table |
1271 |
int exceptionHandlersNumber = codeStream.exceptionHandlersNumber; |
1271 |
int exceptionHandlersNumber = codeStream.exceptionHandlersCounter; |
1272 |
ExceptionLabel[] exceptionHandlers = codeStream.exceptionHandlers; |
1272 |
ExceptionLabel[] exceptionHandlers = codeStream.exceptionHandlers; |
1273 |
int exSize = exceptionHandlersNumber * 8 + 2; |
1273 |
int exSize = exceptionHandlersNumber * 8 + 2; |
1274 |
if (exSize + localContentsOffset >= this.contents.length) { |
1274 |
if (exSize + localContentsOffset >= this.contents.length) { |
Lines 1278-1308
Link Here
|
1278 |
// on the attribute generation |
1278 |
// on the attribute generation |
1279 |
this.contents[localContentsOffset++] = (byte) (exceptionHandlersNumber >> 8); |
1279 |
this.contents[localContentsOffset++] = (byte) (exceptionHandlersNumber >> 8); |
1280 |
this.contents[localContentsOffset++] = (byte) exceptionHandlersNumber; |
1280 |
this.contents[localContentsOffset++] = (byte) exceptionHandlersNumber; |
1281 |
for (int i = 0; i < exceptionHandlersNumber; i++) { |
1281 |
for (int i = 0, max = codeStream.exceptionHandlersIndex; i < max; i++) { |
1282 |
ExceptionLabel exceptionHandler = exceptionHandlers[i]; |
1282 |
ExceptionLabel exceptionHandler = exceptionHandlers[i]; |
1283 |
int start = exceptionHandler.start; |
1283 |
if (exceptionHandler != null) { |
1284 |
this.contents[localContentsOffset++] = (byte) (start >> 8); |
1284 |
int start = exceptionHandler.start; |
1285 |
this.contents[localContentsOffset++] = (byte) start; |
1285 |
this.contents[localContentsOffset++] = (byte) (start >> 8); |
1286 |
int end = exceptionHandler.end; |
1286 |
this.contents[localContentsOffset++] = (byte) start; |
1287 |
this.contents[localContentsOffset++] = (byte) (end >> 8); |
1287 |
int end = exceptionHandler.end; |
1288 |
this.contents[localContentsOffset++] = (byte) end; |
1288 |
this.contents[localContentsOffset++] = (byte) (end >> 8); |
1289 |
int handlerPC = exceptionHandler.position; |
1289 |
this.contents[localContentsOffset++] = (byte) end; |
1290 |
this.contents[localContentsOffset++] = (byte) (handlerPC >> 8); |
1290 |
int handlerPC = exceptionHandler.position; |
1291 |
this.contents[localContentsOffset++] = (byte) handlerPC; |
1291 |
this.contents[localContentsOffset++] = (byte) (handlerPC >> 8); |
1292 |
if (exceptionHandler.exceptionType == null) { |
1292 |
this.contents[localContentsOffset++] = (byte) handlerPC; |
1293 |
// any exception handler |
1293 |
if (exceptionHandler.exceptionType == null) { |
1294 |
this.contents[localContentsOffset++] = 0; |
1294 |
// any exception handler |
1295 |
this.contents[localContentsOffset++] = 0; |
1295 |
this.contents[localContentsOffset++] = 0; |
1296 |
} else { |
1296 |
this.contents[localContentsOffset++] = 0; |
1297 |
int nameIndex; |
|
|
1298 |
if (exceptionHandler.exceptionType == BaseTypes.NullBinding) { |
1299 |
/* represents ClassNotFoundException, see class literal access*/ |
1300 |
nameIndex = constantPool.literalIndexForJavaLangClassNotFoundException(); |
1301 |
} else { |
1297 |
} else { |
1302 |
nameIndex = constantPool.literalIndex(exceptionHandler.exceptionType); |
1298 |
int nameIndex; |
|
|
1299 |
if (exceptionHandler.exceptionType == BaseTypes.NullBinding) { |
1300 |
/* represents ClassNotFoundException, see class literal access*/ |
1301 |
nameIndex = constantPool.literalIndexForJavaLangClassNotFoundException(); |
1302 |
} else { |
1303 |
nameIndex = constantPool.literalIndex(exceptionHandler.exceptionType); |
1304 |
} |
1305 |
this.contents[localContentsOffset++] = (byte) (nameIndex >> 8); |
1306 |
this.contents[localContentsOffset++] = (byte) nameIndex; |
1303 |
} |
1307 |
} |
1304 |
this.contents[localContentsOffset++] = (byte) (nameIndex >> 8); |
|
|
1305 |
this.contents[localContentsOffset++] = (byte) nameIndex; |
1306 |
} |
1308 |
} |
1307 |
} |
1309 |
} |
1308 |
// debug attributes |
1310 |
// debug attributes |
Lines 1578-1584
Link Here
|
1578 |
this.contents[codeAttributeOffset + 13] = (byte) code_length; |
1580 |
this.contents[codeAttributeOffset + 13] = (byte) code_length; |
1579 |
|
1581 |
|
1580 |
// write the exception table |
1582 |
// write the exception table |
1581 |
int exceptionHandlersNumber = codeStream.exceptionHandlersNumber; |
1583 |
int exceptionHandlersNumber = codeStream.exceptionHandlersCounter; |
1582 |
ExceptionLabel[] exceptionHandlers = codeStream.exceptionHandlers; |
1584 |
ExceptionLabel[] exceptionHandlers = codeStream.exceptionHandlers; |
1583 |
int exSize = exceptionHandlersNumber * 8 + 2; |
1585 |
int exSize = exceptionHandlersNumber * 8 + 2; |
1584 |
if (exSize + localContentsOffset >= this.contents.length) { |
1586 |
if (exSize + localContentsOffset >= this.contents.length) { |
Lines 1588-1618
Link Here
|
1588 |
// on the attribute generation |
1590 |
// on the attribute generation |
1589 |
this.contents[localContentsOffset++] = (byte) (exceptionHandlersNumber >> 8); |
1591 |
this.contents[localContentsOffset++] = (byte) (exceptionHandlersNumber >> 8); |
1590 |
this.contents[localContentsOffset++] = (byte) exceptionHandlersNumber; |
1592 |
this.contents[localContentsOffset++] = (byte) exceptionHandlersNumber; |
1591 |
for (int i = 0; i < exceptionHandlersNumber; i++) { |
1593 |
for (int i = 0, max = codeStream.exceptionHandlersIndex; i < max; i++) { |
1592 |
ExceptionLabel exceptionHandler = exceptionHandlers[i]; |
1594 |
ExceptionLabel exceptionHandler = exceptionHandlers[i]; |
1593 |
int start = exceptionHandler.start; |
1595 |
if (exceptionHandler != null) { |
1594 |
this.contents[localContentsOffset++] = (byte) (start >> 8); |
1596 |
int start = exceptionHandler.start; |
1595 |
this.contents[localContentsOffset++] = (byte) start; |
1597 |
this.contents[localContentsOffset++] = (byte) (start >> 8); |
1596 |
int end = exceptionHandler.end; |
1598 |
this.contents[localContentsOffset++] = (byte) start; |
1597 |
this.contents[localContentsOffset++] = (byte) (end >> 8); |
1599 |
int end = exceptionHandler.end; |
1598 |
this.contents[localContentsOffset++] = (byte) end; |
1600 |
this.contents[localContentsOffset++] = (byte) (end >> 8); |
1599 |
int handlerPC = exceptionHandler.position; |
1601 |
this.contents[localContentsOffset++] = (byte) end; |
1600 |
this.contents[localContentsOffset++] = (byte) (handlerPC >> 8); |
1602 |
int handlerPC = exceptionHandler.position; |
1601 |
this.contents[localContentsOffset++] = (byte) handlerPC; |
1603 |
this.contents[localContentsOffset++] = (byte) (handlerPC >> 8); |
1602 |
if (exceptionHandler.exceptionType == null) { |
1604 |
this.contents[localContentsOffset++] = (byte) handlerPC; |
1603 |
// any exception handler |
1605 |
if (exceptionHandler.exceptionType == null) { |
1604 |
this.contents[localContentsOffset++] = 0; |
1606 |
// any exception handler |
1605 |
this.contents[localContentsOffset++] = 0; |
1607 |
this.contents[localContentsOffset++] = 0; |
1606 |
} else { |
1608 |
this.contents[localContentsOffset++] = 0; |
1607 |
int nameIndex; |
|
|
1608 |
if (exceptionHandler.exceptionType == BaseTypes.NullBinding) { |
1609 |
/* represents denote ClassNotFoundException, see class literal access*/ |
1610 |
nameIndex = constantPool.literalIndexForJavaLangClassNotFoundException(); |
1611 |
} else { |
1609 |
} else { |
1612 |
nameIndex = constantPool.literalIndex(exceptionHandler.exceptionType); |
1610 |
int nameIndex; |
|
|
1611 |
if (exceptionHandler.exceptionType == BaseTypes.NullBinding) { |
1612 |
/* represents denote ClassNotFoundException, see class literal access*/ |
1613 |
nameIndex = constantPool.literalIndexForJavaLangClassNotFoundException(); |
1614 |
} else { |
1615 |
nameIndex = constantPool.literalIndex(exceptionHandler.exceptionType); |
1616 |
} |
1617 |
this.contents[localContentsOffset++] = (byte) (nameIndex >> 8); |
1618 |
this.contents[localContentsOffset++] = (byte) nameIndex; |
1613 |
} |
1619 |
} |
1614 |
this.contents[localContentsOffset++] = (byte) (nameIndex >> 8); |
|
|
1615 |
this.contents[localContentsOffset++] = (byte) nameIndex; |
1616 |
} |
1620 |
} |
1617 |
} |
1621 |
} |
1618 |
// debug attributes |
1622 |
// debug attributes |