comparison src/share/vm/prims/jvmtiRedefineClasses.cpp @ 6213:8150fa46d2ed

7178145: Change constMethodOop::_exception_table to optionally inlined u2 table. Summary: Change constMethodOop::_exception_table to optionally inlined u2 table. Reviewed-by: bdelsart, coleenp, kamg
author jiangli
date Tue, 26 Jun 2012 19:08:44 -0400
parents f7c4174b33ba
children e74da3c2b827
comparison
equal deleted inserted replaced
6177:06320b1578cb 6213:8150fa46d2ed
1 /* 1 /*
2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2003, 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.
2476 2476
2477 // Update each catch type index in the method's exception table 2477 // Update each catch type index in the method's exception table
2478 // to use new constant pool indices as needed. The exception table 2478 // to use new constant pool indices as needed. The exception table
2479 // holds quadruple entries of the form: 2479 // holds quadruple entries of the form:
2480 // (beg_bci, end_bci, handler_bci, klass_index) 2480 // (beg_bci, end_bci, handler_bci, klass_index)
2481 const int beg_bci_offset = 0; 2481
2482 const int end_bci_offset = 1; 2482 ExceptionTable ex_table(method());
2483 const int handler_bci_offset = 2; 2483 int ext_length = ex_table.length();
2484 const int klass_index_offset = 3; 2484
2485 const int entry_size = 4; 2485 for (int j = 0; j < ext_length; j ++) {
2486 2486 int cur_index = ex_table.catch_type_index(j);
2487 typeArrayHandle ex_table (THREAD, method->exception_table());
2488 int ext_length = ex_table->length();
2489 assert(ext_length % entry_size == 0, "exception table format has changed");
2490
2491 for (int j = 0; j < ext_length; j += entry_size) {
2492 int cur_index = ex_table->int_at(j + klass_index_offset);
2493 int new_index = find_new_index(cur_index); 2487 int new_index = find_new_index(cur_index);
2494 if (new_index != 0) { 2488 if (new_index != 0) {
2495 RC_TRACE_WITH_THREAD(0x00080000, THREAD, 2489 RC_TRACE_WITH_THREAD(0x00080000, THREAD,
2496 ("ext-klass_index change: %d to %d", cur_index, new_index)); 2490 ("ext-klass_index change: %d to %d", cur_index, new_index));
2497 ex_table->int_at_put(j + klass_index_offset, new_index); 2491 ex_table.set_catch_type_index(j, new_index);
2498 } 2492 }
2499 } // end for each exception table entry 2493 } // end for each exception table entry
2500 2494
2501 // Update constant pool indices in the method's local variable 2495 // Update constant pool indices in the method's local variable
2502 // table to use new constant indices as needed. The local variable 2496 // table to use new constant indices as needed. The local variable