comparison src/share/vm/runtime/deoptimization.cpp @ 22709:6832e10a0b97

Fix missing comma and add STATIC_ASSERT to check size of trap name talbe
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 28 Oct 2015 14:02:20 -0700
parents ea58bbafd5b9
children 3c1edc9c60d8
comparison
equal deleted inserted replaced
22708:8017f84cce74 22709:6832e10a0b97
2117 2117
2118 2118
2119 //--------------------------------statics-------------------------------------- 2119 //--------------------------------statics--------------------------------------
2120 Deoptimization::DeoptAction Deoptimization::_unloaded_action 2120 Deoptimization::DeoptAction Deoptimization::_unloaded_action
2121 = Deoptimization::Action_reinterpret; 2121 = Deoptimization::Action_reinterpret;
2122 const char* Deoptimization::_trap_reason_name[Reason_LIMIT] = { 2122 const char* Deoptimization::_trap_reason_name[] = {
2123 // Note: Keep this in sync. with enum DeoptReason. 2123 // Note: Keep this in sync. with enum DeoptReason.
2124 "none", 2124 "none",
2125 "null_check", 2125 "null_check",
2126 "null_assert" JVMCI_ONLY("_or_unreached0"), 2126 "null_assert" JVMCI_ONLY("_or_unreached0"),
2127 "range_check", 2127 "range_check",
2138 "age", 2138 "age",
2139 "predicate", 2139 "predicate",
2140 "loop_limit_check", 2140 "loop_limit_check",
2141 "speculate_class_check", 2141 "speculate_class_check",
2142 "rtm_state_change", 2142 "rtm_state_change",
2143 "unstable_if" 2143 "unstable_if",
2144 #if INCLUDE_JVMCI 2144 #if INCLUDE_JVMCI
2145 "aliasing", 2145 "aliasing",
2146 "transfer_to_interpreter", 2146 "transfer_to_interpreter",
2147 "not_compiled_exception_handler", 2147 "not_compiled_exception_handler",
2148 "unresolved", 2148 "unresolved",
2149 "jsr_mismatch" 2149 "jsr_mismatch"
2150 #endif 2150 #endif
2151 }; 2151 };
2152 const char* Deoptimization::_trap_action_name[Action_LIMIT] = { 2152 const char* Deoptimization::_trap_action_name[] = {
2153 // Note: Keep this in sync. with enum DeoptAction. 2153 // Note: Keep this in sync. with enum DeoptAction.
2154 "none", 2154 "none",
2155 "maybe_recompile", 2155 "maybe_recompile",
2156 "reinterpret", 2156 "reinterpret",
2157 "make_not_entrant", 2157 "make_not_entrant",
2158 "make_not_compilable" 2158 "make_not_compilable"
2159 }; 2159 };
2160 2160
2161 const char* Deoptimization::trap_reason_name(int reason) { 2161 const char* Deoptimization::trap_reason_name(int reason) {
2162 // Check that every reason has a name
2163 STATIC_ASSERT(sizeof(_trap_reason_name)/sizeof(const char*) == Reason_LIMIT);
2164
2162 if (reason == Reason_many) return "many"; 2165 if (reason == Reason_many) return "many";
2163 if ((uint)reason < Reason_LIMIT) 2166 if ((uint)reason < Reason_LIMIT)
2164 return _trap_reason_name[reason]; 2167 return _trap_reason_name[reason];
2165 static char buf[20]; 2168 static char buf[20];
2166 sprintf(buf, "reason%d", reason); 2169 sprintf(buf, "reason%d", reason);
2167 return buf; 2170 return buf;
2168 } 2171 }
2169 const char* Deoptimization::trap_action_name(int action) { 2172 const char* Deoptimization::trap_action_name(int action) {
2173 // Check that every action has a name
2174 STATIC_ASSERT(sizeof(_trap_action_name)/sizeof(const char*) == Action_LIMIT);
2175
2170 if ((uint)action < Action_LIMIT) 2176 if ((uint)action < Action_LIMIT)
2171 return _trap_action_name[action]; 2177 return _trap_action_name[action];
2172 static char buf[20]; 2178 static char buf[20];
2173 sprintf(buf, "action%d", action); 2179 sprintf(buf, "action%d", action);
2174 return buf; 2180 return buf;