2054 NULL,
2055 ignore_this_trap_count,
2056 ignore_maybe_prior_trap,
2057 ignore_maybe_prior_recompile);
2058 }
2059
2060 Deoptimization::UnrollBlock* Deoptimization::uncommon_trap(JavaThread* thread, jint trap_request, jint exec_mode) {
2061 if (TraceDeoptimization) {
2062 tty->print("Uncommon trap ");
2063 }
2064 // Still in Java no safepoints
2065 {
2066 // This enters VM and may safepoint
2067 uncommon_trap_inner(thread, trap_request);
2068 }
2069 return fetch_unroll_info_helper(thread, exec_mode);
2070 }
2071
2072 // Local derived constants.
2073 // Further breakdown of DataLayout::trap_state, as promised by DataLayout.
2074 const int DS_REASON_MASK = DataLayout::trap_mask >> 1;
2075 const int DS_RECOMPILE_BIT = DataLayout::trap_mask - DS_REASON_MASK;
2076
2077 //---------------------------trap_state_reason---------------------------------
2078 Deoptimization::DeoptReason
2079 Deoptimization::trap_state_reason(int trap_state) {
2080 // This assert provides the link between the width of DataLayout::trap_bits
2081 // and the encoding of "recorded" reasons. It ensures there are enough
2082 // bits to store all needed reasons in the per-BCI MDO profile.
2083 assert(DS_REASON_MASK >= Reason_RECORDED_LIMIT, "enough bits");
2084 int recompile_bit = (trap_state & DS_RECOMPILE_BIT);
2085 trap_state -= recompile_bit;
2086 if (trap_state == DS_REASON_MASK) {
2087 return Reason_many;
2088 } else {
2089 assert((int)Reason_none == 0, "state=0 => Reason_none");
2090 return (DeoptReason)trap_state;
2091 }
2092 }
2093 //-------------------------trap_state_has_reason-------------------------------
2094 int Deoptimization::trap_state_has_reason(int trap_state, int reason) {
2153 } else {
2154 len = jio_snprintf(buf, buflen, "%s%s",
2155 trap_reason_name(reason),
2156 recomp_flag ? " recompiled" : "");
2157 }
2158 return buf;
2159 }
2160
2161
2162 //--------------------------------statics--------------------------------------
2163 const char* Deoptimization::_trap_reason_name[] = {
2164 // Note: Keep this in sync. with enum DeoptReason.
2165 "none",
2166 "null_check",
2167 "null_assert" JVMCI_ONLY("_or_unreached0"),
2168 "range_check",
2169 "class_check",
2170 "array_check",
2171 "intrinsic" JVMCI_ONLY("_or_type_checked_inlining"),
2172 "bimorphic" JVMCI_ONLY("_or_optimized_type_check"),
2173 "unloaded",
2174 "uninitialized",
2175 "unreached",
2176 "unhandled",
2177 "constraint",
2178 "div0_check",
2179 "age",
2180 "predicate",
2181 "loop_limit_check",
2182 "speculate_class_check",
2183 "speculate_null_check",
2184 "speculate_null_assert",
2185 "rtm_state_change",
2186 "unstable_if",
2187 "unstable_fused_if",
2188 #if INCLUDE_JVMCI
2189 "aliasing",
2190 "transfer_to_interpreter",
2191 "not_compiled_exception_handler",
2192 "unresolved",
|
2054 NULL,
2055 ignore_this_trap_count,
2056 ignore_maybe_prior_trap,
2057 ignore_maybe_prior_recompile);
2058 }
2059
2060 Deoptimization::UnrollBlock* Deoptimization::uncommon_trap(JavaThread* thread, jint trap_request, jint exec_mode) {
2061 if (TraceDeoptimization) {
2062 tty->print("Uncommon trap ");
2063 }
2064 // Still in Java no safepoints
2065 {
2066 // This enters VM and may safepoint
2067 uncommon_trap_inner(thread, trap_request);
2068 }
2069 return fetch_unroll_info_helper(thread, exec_mode);
2070 }
2071
2072 // Local derived constants.
2073 // Further breakdown of DataLayout::trap_state, as promised by DataLayout.
2074 const int DS_REASON_MASK = ((uint)DataLayout::trap_mask) >> 1;
2075 const int DS_RECOMPILE_BIT = DataLayout::trap_mask - DS_REASON_MASK;
2076
2077 //---------------------------trap_state_reason---------------------------------
2078 Deoptimization::DeoptReason
2079 Deoptimization::trap_state_reason(int trap_state) {
2080 // This assert provides the link between the width of DataLayout::trap_bits
2081 // and the encoding of "recorded" reasons. It ensures there are enough
2082 // bits to store all needed reasons in the per-BCI MDO profile.
2083 assert(DS_REASON_MASK >= Reason_RECORDED_LIMIT, "enough bits");
2084 int recompile_bit = (trap_state & DS_RECOMPILE_BIT);
2085 trap_state -= recompile_bit;
2086 if (trap_state == DS_REASON_MASK) {
2087 return Reason_many;
2088 } else {
2089 assert((int)Reason_none == 0, "state=0 => Reason_none");
2090 return (DeoptReason)trap_state;
2091 }
2092 }
2093 //-------------------------trap_state_has_reason-------------------------------
2094 int Deoptimization::trap_state_has_reason(int trap_state, int reason) {
2153 } else {
2154 len = jio_snprintf(buf, buflen, "%s%s",
2155 trap_reason_name(reason),
2156 recomp_flag ? " recompiled" : "");
2157 }
2158 return buf;
2159 }
2160
2161
2162 //--------------------------------statics--------------------------------------
2163 const char* Deoptimization::_trap_reason_name[] = {
2164 // Note: Keep this in sync. with enum DeoptReason.
2165 "none",
2166 "null_check",
2167 "null_assert" JVMCI_ONLY("_or_unreached0"),
2168 "range_check",
2169 "class_check",
2170 "array_check",
2171 "intrinsic" JVMCI_ONLY("_or_type_checked_inlining"),
2172 "bimorphic" JVMCI_ONLY("_or_optimized_type_check"),
2173 "profile_predicate",
2174 "unloaded",
2175 "uninitialized",
2176 "unreached",
2177 "unhandled",
2178 "constraint",
2179 "div0_check",
2180 "age",
2181 "predicate",
2182 "loop_limit_check",
2183 "speculate_class_check",
2184 "speculate_null_check",
2185 "speculate_null_assert",
2186 "rtm_state_change",
2187 "unstable_if",
2188 "unstable_fused_if",
2189 #if INCLUDE_JVMCI
2190 "aliasing",
2191 "transfer_to_interpreter",
2192 "not_compiled_exception_handler",
2193 "unresolved",
|