comparison src/share/vm/runtime/deoptimization.cpp @ 13216:51e97f88c771

Profile deoptimizations of OSR methods separately.
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 03 Dec 2013 11:25:40 +0100
parents 6b2d8d20ecbd
children 2b43fcc68add
comparison
equal deleted inserted replaced
13215:dca16b3416ab 13216:51e97f88c771
1616 assert(trap_mdo == get_method_data(thread, profiled_method, false), "sanity"); 1616 assert(trap_mdo == get_method_data(thread, profiled_method, false), "sanity");
1617 uint this_trap_count = 0; 1617 uint this_trap_count = 0;
1618 bool maybe_prior_trap = false; 1618 bool maybe_prior_trap = false;
1619 bool maybe_prior_recompile = false; 1619 bool maybe_prior_recompile = false;
1620 pdata = query_update_method_data(trap_mdo, trap_bci, reason, true, 1620 pdata = query_update_method_data(trap_mdo, trap_bci, reason, true,
1621 #ifdef GRAAL
1622 nm->is_compiled_by_graal() && nm->is_osr_method(),
1623 #endif
1621 //outputs: 1624 //outputs:
1622 this_trap_count, 1625 this_trap_count,
1623 maybe_prior_trap, 1626 maybe_prior_trap,
1624 maybe_prior_recompile); 1627 maybe_prior_recompile);
1625 // Because the interpreter also counts null, div0, range, and class 1628 // Because the interpreter also counts null, div0, range, and class
1750 ProfileData* 1753 ProfileData*
1751 Deoptimization::query_update_method_data(MethodData* trap_mdo, 1754 Deoptimization::query_update_method_data(MethodData* trap_mdo,
1752 int trap_bci, 1755 int trap_bci,
1753 Deoptimization::DeoptReason reason, 1756 Deoptimization::DeoptReason reason,
1754 bool update_total_trap_count, 1757 bool update_total_trap_count,
1758 #ifdef GRAAL
1759 bool is_osr,
1760 #endif
1755 //outputs: 1761 //outputs:
1756 uint& ret_this_trap_count, 1762 uint& ret_this_trap_count,
1757 bool& ret_maybe_prior_trap, 1763 bool& ret_maybe_prior_trap,
1758 bool& ret_maybe_prior_recompile) { 1764 bool& ret_maybe_prior_recompile) {
1759 bool maybe_prior_trap = false; 1765 bool maybe_prior_trap = false;
1760 bool maybe_prior_recompile = false; 1766 bool maybe_prior_recompile = false;
1761 uint this_trap_count = 0; 1767 uint this_trap_count = 0;
1762 if (update_total_trap_count) { 1768 if (update_total_trap_count) {
1763 uint prior_trap_count = trap_mdo->trap_count(reason); 1769 uint idx = reason;
1764 this_trap_count = trap_mdo->inc_trap_count(reason); 1770 #ifdef GRAAL
1771 if (is_osr) {
1772 idx += Reason_LIMIT;
1773 }
1774 #endif
1775 uint prior_trap_count = trap_mdo->trap_count(idx);
1776 this_trap_count = trap_mdo->inc_trap_count(idx);
1765 1777
1766 // If the runtime cannot find a place to store trap history, 1778 // If the runtime cannot find a place to store trap history,
1767 // it is estimated based on the general condition of the method. 1779 // it is estimated based on the general condition of the method.
1768 // If the method has ever been recompiled, or has ever incurred 1780 // If the method has ever been recompiled, or has ever incurred
1769 // a trap with the present reason , then this BCI is assumed 1781 // a trap with the present reason , then this BCI is assumed
1824 // Graal uses the total counts to determine if deoptimizations are happening too frequently -> do not adjust total counts 1836 // Graal uses the total counts to determine if deoptimizations are happening too frequently -> do not adjust total counts
1825 bool update_total_counts = GRAAL_ONLY(false) NOT_GRAAL(true); 1837 bool update_total_counts = GRAAL_ONLY(false) NOT_GRAAL(true);
1826 query_update_method_data(trap_mdo, trap_bci, 1838 query_update_method_data(trap_mdo, trap_bci,
1827 (DeoptReason)reason, 1839 (DeoptReason)reason,
1828 update_total_counts, 1840 update_total_counts,
1841 #ifdef GRAAL
1842 false,
1843 #endif
1829 ignore_this_trap_count, 1844 ignore_this_trap_count,
1830 ignore_maybe_prior_trap, 1845 ignore_maybe_prior_trap,
1831 ignore_maybe_prior_recompile); 1846 ignore_maybe_prior_recompile);
1832 } 1847 }
1833 1848