< prev index next >
src/share/vm/oops/generateOopMap.cpp
Print this page
rev 4134 : 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
*** 398,411 ****
initialize_bb();
bool fellThrough = false; // False to get first BB marked.
// First mark all exception handlers as start of a basic-block
! typeArrayOop excps = method()->exception_table();
! for(int i = 0; i < excps->length(); i += 4) {
! int handler_pc_idx = i+2;
! bb_mark_fct(this, excps->int_at(handler_pc_idx), NULL);
}
// Then iterate through the code
BytecodeStream bcs(_method);
Bytecodes::Code bytecode;
--- 398,410 ----
initialize_bb();
bool fellThrough = false; // False to get first BB marked.
// First mark all exception handlers as start of a basic-block
! ExceptionTable excps(method());
! for(int i = 0; i < excps.length(); i ++) {
! bb_mark_fct(this, excps.handler_pc(i), NULL);
}
// Then iterate through the code
BytecodeStream bcs(_method);
Bytecodes::Code bytecode;
*** 448,461 ****
void GenerateOopMap::mark_reachable_code() {
int change = 1; // int to get function pointers to work
// Mark entry basic block as alive and all exception handlers
_basic_blocks[0].mark_as_alive();
! typeArrayOop excps = method()->exception_table();
! for(int i = 0; i < excps->length(); i += 4) {
! int handler_pc_idx = i+2;
! BasicBlock *bb = get_basic_block_at(excps->int_at(handler_pc_idx));
// If block is not already alive (due to multiple exception handlers to same bb), then
// make it alive
if (bb->is_dead()) bb->mark_as_alive();
}
--- 447,459 ----
void GenerateOopMap::mark_reachable_code() {
int change = 1; // int to get function pointers to work
// Mark entry basic block as alive and all exception handlers
_basic_blocks[0].mark_as_alive();
! ExceptionTable excps(method());
! for(int i = 0; i < excps.length(); i++) {
! BasicBlock *bb = get_basic_block_at(excps.handler_pc(i));
// If block is not already alive (due to multiple exception handlers to same bb), then
// make it alive
if (bb->is_dead()) bb->mark_as_alive();
}
*** 1188,1203 ****
break;
}
if (_has_exceptions) {
int bci = itr->bci();
! typeArrayOop exct = method()->exception_table();
! for(int i = 0; i< exct->length(); i+=4) {
! int start_pc = exct->int_at(i);
! int end_pc = exct->int_at(i+1);
! int handler_pc = exct->int_at(i+2);
! int catch_type = exct->int_at(i+3);
if (start_pc <= bci && bci < end_pc) {
BasicBlock *excBB = get_basic_block_at(handler_pc);
CellTypeState *excStk = excBB->stack();
CellTypeState *cOpStck = stack();
--- 1186,1201 ----
break;
}
if (_has_exceptions) {
int bci = itr->bci();
! ExceptionTable exct(method());
! for(int i = 0; i< exct.length(); i++) {
! int start_pc = exct.start_pc(i);
! int end_pc = exct.end_pc(i);
! int handler_pc = exct.handler_pc(i);
! int catch_type = exct.catch_type_index(i);
if (start_pc <= bci && bci < end_pc) {
BasicBlock *excBB = get_basic_block_at(handler_pc);
CellTypeState *excStk = excBB->stack();
CellTypeState *cOpStck = stack();
*** 2062,2072 ****
// Initialize values
_got_error = false;
_conflict = false;
_max_locals = method()->max_locals();
_max_stack = method()->max_stack();
! _has_exceptions = (method()->exception_table()->length() > 0);
_nof_refval_conflicts = 0;
_init_vars = new GrowableArray<intptr_t>(5); // There are seldom more than 5 init_vars
_report_result = false;
_report_result_for_send = false;
_new_var_map = NULL;
--- 2060,2070 ----
// Initialize values
_got_error = false;
_conflict = false;
_max_locals = method()->max_locals();
_max_stack = method()->max_stack();
! _has_exceptions = (method()->has_exception_handler());
_nof_refval_conflicts = 0;
_init_vars = new GrowableArray<intptr_t>(5); // There are seldom more than 5 init_vars
_report_result = false;
_report_result_for_send = false;
_new_var_map = NULL;
*** 2077,2089 ****
if (TraceNewOopMapGeneration) {
tty->print("Method name: %s\n", method()->name()->as_C_string());
if (Verbose) {
_method->print_codes();
tty->print_cr("Exception table:");
! typeArrayOop excps = method()->exception_table();
! for(int i = 0; i < excps->length(); i += 4) {
! tty->print_cr("[%d - %d] -> %d", excps->int_at(i + 0), excps->int_at(i + 1), excps->int_at(i + 2));
}
}
}
// if no code - do nothing
--- 2075,2088 ----
if (TraceNewOopMapGeneration) {
tty->print("Method name: %s\n", method()->name()->as_C_string());
if (Verbose) {
_method->print_codes();
tty->print_cr("Exception table:");
! ExceptionTable excps(method());
! for(int i = 0; i < excps.length(); i ++) {
! tty->print_cr("[%d - %d] -> %d",
! excps.start_pc(i), excps.end_pc(i), excps.handler_pc(i));
}
}
}
// if no code - do nothing
< prev index next >