hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
changeset 13286 b8b0898d5f3a
parent 13201 69f157caabcc
parent 13282 9872915dd78d
child 13728 882756847a04
equal deleted inserted replaced
13206:e51c1cecb49c 13286:b8b0898d5f3a
  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