hotspot/src/share/vm/runtime/deoptimization.cpp
changeset 33794 41ef3dc95179
parent 33611 9abd65805e19
child 33813 4f376e851453
equal deleted inserted replaced
33790:229ed95d8958 33794:41ef3dc95179
  2060 }
  2060 }
  2061 //---------------------------format_trap_state---------------------------------
  2061 //---------------------------format_trap_state---------------------------------
  2062 // This is used for debugging and diagnostics, including LogFile output.
  2062 // This is used for debugging and diagnostics, including LogFile output.
  2063 const char* Deoptimization::format_trap_state(char* buf, size_t buflen,
  2063 const char* Deoptimization::format_trap_state(char* buf, size_t buflen,
  2064                                               int trap_state) {
  2064                                               int trap_state) {
       
  2065   assert(buflen > 0, "sanity");
  2065   DeoptReason reason      = trap_state_reason(trap_state);
  2066   DeoptReason reason      = trap_state_reason(trap_state);
  2066   bool        recomp_flag = trap_state_is_recompiled(trap_state);
  2067   bool        recomp_flag = trap_state_is_recompiled(trap_state);
  2067   // Re-encode the state from its decoded components.
  2068   // Re-encode the state from its decoded components.
  2068   int decoded_state = 0;
  2069   int decoded_state = 0;
  2069   if (reason_is_recorded_per_bytecode(reason) || reason == Reason_many)
  2070   if (reason_is_recorded_per_bytecode(reason) || reason == Reason_many)
  2080   } else {
  2081   } else {
  2081     len = jio_snprintf(buf, buflen, "%s%s",
  2082     len = jio_snprintf(buf, buflen, "%s%s",
  2082                        trap_reason_name(reason),
  2083                        trap_reason_name(reason),
  2083                        recomp_flag ? " recompiled" : "");
  2084                        recomp_flag ? " recompiled" : "");
  2084   }
  2085   }
  2085   if (len >= buflen)
       
  2086     buf[buflen-1] = '\0';
       
  2087   return buf;
  2086   return buf;
  2088 }
  2087 }
  2089 
  2088 
  2090 
  2089 
  2091 //--------------------------------statics--------------------------------------
  2090 //--------------------------------statics--------------------------------------
  2176 #if INCLUDE_JVMCI
  2175 #if INCLUDE_JVMCI
  2177                        ,debug_id
  2176                        ,debug_id
  2178 #endif
  2177 #endif
  2179                        );
  2178                        );
  2180   }
  2179   }
  2181   if (len >= buflen)
       
  2182     buf[buflen-1] = '\0';
       
  2183   return buf;
  2180   return buf;
  2184 }
  2181 }
  2185 
  2182 
  2186 juint Deoptimization::_deoptimization_hist
  2183 juint Deoptimization::_deoptimization_hist
  2187         [Deoptimization::Reason_LIMIT]
  2184         [Deoptimization::Reason_LIMIT]