1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
390 } |
390 } |
391 |
391 |
392 // The width of instruction at "pc" is changing by "delta". Adjust the |
392 // The width of instruction at "pc" is changing by "delta". Adjust the |
393 // exception table, if any, of "rc->mb". |
393 // exception table, if any, of "rc->mb". |
394 void Relocator::adjust_exception_table(int bci, int delta) { |
394 void Relocator::adjust_exception_table(int bci, int delta) { |
395 typeArrayOop table = method()->exception_table(); |
395 ExceptionTable table(_method()); |
396 for (int index = 0; index < table->length(); index +=4) { |
396 for (int index = 0; index < table.length(); index ++) { |
397 if (table->int_at(index) > bci) { |
397 if (table.start_pc(index) > bci) { |
398 table->int_at_put(index+0, table->int_at(index+0) + delta); |
398 table.set_start_pc(index, table.start_pc(index) + delta); |
399 table->int_at_put(index+1, table->int_at(index+1) + delta); |
399 table.set_end_pc(index, table.end_pc(index) + delta); |
400 } else if (bci < table->int_at(index+1)) { |
400 } else if (bci < table.end_pc(index)) { |
401 table->int_at_put(index+1, table->int_at(index+1) + delta); |
401 table.set_end_pc(index, table.end_pc(index) + delta); |
402 } |
402 } |
403 if (table->int_at(index+2) > bci) |
403 if (table.handler_pc(index) > bci) |
404 table->int_at_put(index+2, table->int_at(index+2) + delta); |
404 table.set_handler_pc(index, table.handler_pc(index) + delta); |
405 } |
405 } |
406 } |
406 } |
407 |
407 |
408 |
408 |
409 // The width of instruction at "bci" is changing by "delta". Adjust the line number table. |
409 // The width of instruction at "bci" is changing by "delta". Adjust the line number table. |