aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/oops/generateOopMap.cpp
diff options
context:
space:
mode:
authorjiangli <none@none>2012-07-13 20:14:27 -0400
committerjiangli <none@none>2012-07-13 20:14:27 -0400
commit1f0952904d83c0ddc6db527b32f02242cbd33f67 (patch)
tree0ee20bf3b273e443943a12258b29f73beb554592 /src/share/vm/oops/generateOopMap.cpp
parentee19b080e9911f25d733ed357962bf35ae0156f0 (diff)
parent96b276d261c2b3de763bff86bb5c94826bb033b2 (diff)
Merge
Diffstat (limited to 'src/share/vm/oops/generateOopMap.cpp')
-rw-r--r--src/share/vm/oops/generateOopMap.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/share/vm/oops/generateOopMap.cpp b/src/share/vm/oops/generateOopMap.cpp
index 58ef93152..3a818aad4 100644
--- a/src/share/vm/oops/generateOopMap.cpp
+++ b/src/share/vm/oops/generateOopMap.cpp
@@ -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));
}
}
}