1. A processing device comprising: a plurality of registers; a processing core to: execute a managed runtime environment (MRE) that generates an optimized version of code; execute the optimized version of code; and send notification of occurrence of a misprediction during the execution of the optimized version of the code, the notice sent to the MRE; wherein the MRE is to: determine whether a local misprediction counter (LMC) associated with a code region of the optimized code causing the misprediction exceeds a local misprediction threshold (LMT) value; in response to the LMC exceeds the LMT value, compile native code of the optimized code to generate a new version of the optimized code, wherein the code region in the new version of the optimized code is not optimized; increase a global misprediction counter (GMC) associated with the optimized code in response to the notice of misprediction being received; and if the GMC exceeds a global misprediction threshold (GMT) value: increase the LMC; determine whether the LMC exceeds the LMT value; and reset the GMC if the LMC is increased.