Mercurial > hg > truffle
diff src/share/vm/prims/jvmtiClassFileReconstituter.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 |
line wrap: on
line diff
--- a/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Mon Jun 25 15:34:06 2012 -0400 +++ b/src/share/vm/prims/jvmtiClassFileReconstituter.cpp Tue Jun 26 19:08:44 2012 -0400 @@ -191,15 +191,14 @@ } } - typeArrayHandle exception_table(thread(), const_method->exception_table()); - int exception_table_length = exception_table->length(); - int exception_table_entries = exception_table_length / 4; + ExceptionTable exception_table(method()); + int exception_table_length = exception_table.length(); int code_size = const_method->code_size(); int size = 2+2+4 + // max_stack, max_locals, code_length code_size + // code 2 + // exception_table_length - (2+2+2+2) * exception_table_entries + // exception_table + (2+2+2+2) * exception_table_length + // exception_table 2 + // attributes_count attr_size; // attributes @@ -209,12 +208,12 @@ write_u2(method->max_locals()); write_u4(code_size); copy_bytecodes(method, (unsigned char*)writeable_address(code_size)); - write_u2(exception_table_entries); - for (int index = 0; index < exception_table_length; ) { - write_u2(exception_table->int_at(index++)); - write_u2(exception_table->int_at(index++)); - write_u2(exception_table->int_at(index++)); - write_u2(exception_table->int_at(index++)); + write_u2(exception_table_length); + for (int index = 0; index < exception_table_length; index++) { + write_u2(exception_table.start_pc(index)); + write_u2(exception_table.end_pc(index)); + write_u2(exception_table.handler_pc(index)); + write_u2(exception_table.catch_type_index(index)); } write_u2(attr_count); if (line_num_cnt != 0) {