mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
7178145: Change constMethodOop::_exception_table to optionally inlined u2 table
Change constMethodOop::_exception_table to optionally inlined u2 table. Reviewed-by: bdelsart, coleenp, kamg
This commit is contained in:
parent
97cc5e6c44
commit
56df3bd48d
28 changed files with 568 additions and 317 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -400,10 +400,9 @@ void GenerateOopMap::mark_bbheaders_and_count_gc_points() {
|
|||
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);
|
||||
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
|
||||
|
@ -450,10 +449,9 @@ void GenerateOopMap::mark_reachable_code() {
|
|||
|
||||
// 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));
|
||||
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();
|
||||
|
@ -1181,12 +1179,12 @@ void GenerateOopMap::do_exception_edge(BytecodeStream* itr) {
|
|||
|
||||
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);
|
||||
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);
|
||||
|
@ -2055,7 +2053,7 @@ void GenerateOopMap::compute_map(TRAPS) {
|
|||
_conflict = false;
|
||||
_max_locals = method()->max_locals();
|
||||
_max_stack = method()->max_stack();
|
||||
_has_exceptions = (method()->exception_table()->length() > 0);
|
||||
_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;
|
||||
|
@ -2070,9 +2068,10 @@ void GenerateOopMap::compute_map(TRAPS) {
|
|||
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));
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue