8043180: SIGSEGV in Events::log_deopt_message

Added missing deopt reason name Reason_tenured

Reviewed-by: kvn, twisti
This commit is contained in:
Igor Veresov 2014-05-15 10:37:52 -07:00
parent 7ef690b2c7
commit a2eea4770a
2 changed files with 13 additions and 6 deletions

View file

@ -1340,7 +1340,7 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra
if (xtty != NULL) if (xtty != NULL)
xtty->name(class_name); xtty->name(class_name);
} }
if (xtty != NULL && trap_mdo != NULL) { if (xtty != NULL && trap_mdo != NULL && (int)reason < (int)MethodData::_trap_hist_limit) {
// Dump the relevant MDO state. // Dump the relevant MDO state.
// This is the deopt count for the current reason, any previous // This is the deopt count for the current reason, any previous
// reasons or recompiles seen at this point. // reasons or recompiles seen at this point.
@ -1818,7 +1818,7 @@ const char* Deoptimization::format_trap_state(char* buf, size_t buflen,
//--------------------------------statics-------------------------------------- //--------------------------------statics--------------------------------------
const char* Deoptimization::_trap_reason_name[Reason_LIMIT] = { const char* Deoptimization::_trap_reason_name[] = {
// Note: Keep this in sync. with enum DeoptReason. // Note: Keep this in sync. with enum DeoptReason.
"none", "none",
"null_check", "null_check",
@ -1839,9 +1839,10 @@ const char* Deoptimization::_trap_reason_name[Reason_LIMIT] = {
"loop_limit_check", "loop_limit_check",
"speculate_class_check", "speculate_class_check",
"speculate_null_check", "speculate_null_check",
"rtm_state_change" "rtm_state_change",
"tenured"
}; };
const char* Deoptimization::_trap_action_name[Action_LIMIT] = { const char* Deoptimization::_trap_action_name[] = {
// Note: Keep this in sync. with enum DeoptAction. // Note: Keep this in sync. with enum DeoptAction.
"none", "none",
"maybe_recompile", "maybe_recompile",
@ -1851,6 +1852,9 @@ const char* Deoptimization::_trap_action_name[Action_LIMIT] = {
}; };
const char* Deoptimization::trap_reason_name(int reason) { const char* Deoptimization::trap_reason_name(int reason) {
// Check that every reason has a name
STATIC_ASSERT(sizeof(_trap_reason_name)/sizeof(const char*) == Reason_LIMIT);
if (reason == Reason_many) return "many"; if (reason == Reason_many) return "many";
if ((uint)reason < Reason_LIMIT) if ((uint)reason < Reason_LIMIT)
return _trap_reason_name[reason]; return _trap_reason_name[reason];
@ -1859,6 +1863,9 @@ const char* Deoptimization::trap_reason_name(int reason) {
return buf; return buf;
} }
const char* Deoptimization::trap_action_name(int action) { const char* Deoptimization::trap_action_name(int action) {
// Check that every action has a name
STATIC_ASSERT(sizeof(_trap_action_name)/sizeof(const char*) == Action_LIMIT);
if ((uint)action < Action_LIMIT) if ((uint)action < Action_LIMIT)
return _trap_action_name[action]; return _trap_action_name[action];
static char buf[20]; static char buf[20];

View file

@ -376,8 +376,8 @@ class Deoptimization : AllStatic {
static UnrollBlock* fetch_unroll_info_helper(JavaThread* thread); static UnrollBlock* fetch_unroll_info_helper(JavaThread* thread);
static DeoptAction _unloaded_action; // == Action_reinterpret; static DeoptAction _unloaded_action; // == Action_reinterpret;
static const char* _trap_reason_name[Reason_LIMIT]; static const char* _trap_reason_name[];
static const char* _trap_action_name[Action_LIMIT]; static const char* _trap_action_name[];
static juint _deoptimization_hist[Reason_LIMIT][1+Action_LIMIT][BC_CASE_LIMIT]; static juint _deoptimization_hist[Reason_LIMIT][1+Action_LIMIT][BC_CASE_LIMIT];
// Note: Histogram array size is 1-2 Kb. // Note: Histogram array size is 1-2 Kb.