--- a/hotspot/src/share/vm/runtime/deoptimization.cpp Tue May 12 14:26:31 2015 +0200
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp Thu Jun 11 14:19:40 2015 +0300
@@ -1460,7 +1460,11 @@
//
// The other actions cause immediate removal of the present code.
- bool update_trap_state = (reason != Reason_tenured);
+ // Traps caused by injected profile shouldn't pollute trap counts.
+ bool injected_profile_trap = trap_method->has_injected_profile() &&
+ (reason == Reason_intrinsic || reason == Reason_unreached);
+
+ bool update_trap_state = (reason != Reason_tenured) && !injected_profile_trap;
bool make_not_entrant = false;
bool make_not_compilable = false;
bool reprofile = false;