src/share/vm/prims/jvmtiClassFileReconstituter.cpp

changeset 3921
e74da3c2b827
parent 3906
04ade88d9712
parent 3917
8150fa46d2ed
child 4037
da91efe96a93
     1.1 --- a/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Thu Jul 12 14:19:15 2012 -0700
     1.2 +++ b/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Fri Jul 13 20:14:27 2012 -0400
     1.3 @@ -191,15 +191,14 @@
     1.4      }
     1.5    }
     1.6  
     1.7 -  typeArrayHandle exception_table(thread(), const_method->exception_table());
     1.8 -  int exception_table_length = exception_table->length();
     1.9 -  int exception_table_entries = exception_table_length / 4;
    1.10 +  ExceptionTable exception_table(method());
    1.11 +  int exception_table_length = exception_table.length();
    1.12    int code_size = const_method->code_size();
    1.13    int size =
    1.14      2+2+4 +                                // max_stack, max_locals, code_length
    1.15      code_size +                            // code
    1.16      2 +                                    // exception_table_length
    1.17 -    (2+2+2+2) * exception_table_entries +  // exception_table
    1.18 +    (2+2+2+2) * exception_table_length +   // exception_table
    1.19      2 +                                    // attributes_count
    1.20      attr_size;                             // attributes
    1.21  
    1.22 @@ -209,12 +208,12 @@
    1.23    write_u2(method->max_locals());
    1.24    write_u4(code_size);
    1.25    copy_bytecodes(method, (unsigned char*)writeable_address(code_size));
    1.26 -  write_u2(exception_table_entries);
    1.27 -  for (int index = 0; index < exception_table_length; ) {
    1.28 -    write_u2(exception_table->int_at(index++));
    1.29 -    write_u2(exception_table->int_at(index++));
    1.30 -    write_u2(exception_table->int_at(index++));
    1.31 -    write_u2(exception_table->int_at(index++));
    1.32 +  write_u2(exception_table_length);
    1.33 +  for (int index = 0; index < exception_table_length; index++) {
    1.34 +    write_u2(exception_table.start_pc(index));
    1.35 +    write_u2(exception_table.end_pc(index));
    1.36 +    write_u2(exception_table.handler_pc(index));
    1.37 +    write_u2(exception_table.catch_type_index(index));
    1.38    }
    1.39    write_u2(attr_count);
    1.40    if (line_num_cnt != 0) {

mercurial