Mercurial > hg > graal-compiler
diff src/share/vm/oops/methodDataOop.hpp @ 5114:dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
author | Christian Haeubl <christian.haeubl@oracle.com> |
---|---|
date | Mon, 19 Mar 2012 14:43:15 -0700 |
parents | 422c979ff392 |
children |
line wrap: on
line diff
--- a/src/share/vm/oops/methodDataOop.hpp Thu Mar 15 17:01:44 2012 -0700 +++ b/src/share/vm/oops/methodDataOop.hpp Mon Mar 19 14:43:15 2012 -0700 @@ -1485,17 +1485,13 @@ uint inc_trap_count(int reason) { // Count another trap, anywhere in this method. assert(reason >= 0, "must be single trap"); - if ((uint)reason < _trap_hist_limit) { - uint cnt1 = 1 + _trap_hist._array[reason]; - if ((cnt1 & _trap_hist_mask) != 0) { // if no counter overflow... - _trap_hist._array[reason] = cnt1; - return cnt1; - } else { - return _trap_hist_mask + (++_nof_overflow_traps); - } + assert((uint)reason < _trap_hist_limit, "oob"); + uint cnt1 = 1 + _trap_hist._array[reason]; + if ((cnt1 & _trap_hist_mask) != 0) { // if no counter overflow... + _trap_hist._array[reason] = cnt1; + return cnt1; } else { - // Could not represent the count in the histogram. - return (++_nof_overflow_traps); + return _trap_hist_mask + (++_nof_overflow_traps); } } @@ -1518,6 +1514,10 @@ return byte_offset_of(methodDataOopDesc, _data[0]); } + static ByteSize trap_history_offset() { + return byte_offset_of(methodDataOopDesc, _trap_hist._array); + } + static ByteSize invocation_counter_offset() { return byte_offset_of(methodDataOopDesc, _invocation_counter); }