equal
deleted
inserted
replaced
207 bool have_major_receiver = profile.has_receiver(0) && (100.*profile.receiver_prob(0) >= (float)TypeProfileMajorReceiverPercent); |
207 bool have_major_receiver = profile.has_receiver(0) && (100.*profile.receiver_prob(0) >= (float)TypeProfileMajorReceiverPercent); |
208 ciMethod* receiver_method = NULL; |
208 ciMethod* receiver_method = NULL; |
209 |
209 |
210 int morphism = profile.morphism(); |
210 int morphism = profile.morphism(); |
211 if (speculative_receiver_type != NULL) { |
211 if (speculative_receiver_type != NULL) { |
212 if (!too_many_traps(caller, bci, Deoptimization::Reason_speculate_class_check)) { |
212 if (!too_many_traps_or_recompiles(caller, bci, Deoptimization::Reason_speculate_class_check)) { |
213 // We have a speculative type, we should be able to resolve |
213 // We have a speculative type, we should be able to resolve |
214 // the call. We do that before looking at the profiling at |
214 // the call. We do that before looking at the profiling at |
215 // this invoke because it may lead to bimorphic inlining which |
215 // this invoke because it may lead to bimorphic inlining which |
216 // a speculative type should help us avoid. |
216 // a speculative type should help us avoid. |
217 receiver_method = callee->resolve_invoke(jvms->method()->holder(), |
217 receiver_method = callee->resolve_invoke(jvms->method()->holder(), |
260 CallGenerator* miss_cg; |
260 CallGenerator* miss_cg; |
261 Deoptimization::DeoptReason reason = (morphism == 2 |
261 Deoptimization::DeoptReason reason = (morphism == 2 |
262 ? Deoptimization::Reason_bimorphic |
262 ? Deoptimization::Reason_bimorphic |
263 : Deoptimization::reason_class_check(speculative_receiver_type != NULL)); |
263 : Deoptimization::reason_class_check(speculative_receiver_type != NULL)); |
264 if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && |
264 if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && |
265 !too_many_traps(caller, bci, reason) |
265 !too_many_traps_or_recompiles(caller, bci, reason) |
266 ) { |
266 ) { |
267 // Generate uncommon trap for class check failure path |
267 // Generate uncommon trap for class check failure path |
268 // in case of monomorphic or bimorphic virtual call site. |
268 // in case of monomorphic or bimorphic virtual call site. |
269 miss_cg = CallGenerator::for_uncommon_trap(callee, reason, |
269 miss_cg = CallGenerator::for_uncommon_trap(callee, reason, |
270 Deoptimization::Action_maybe_recompile); |
270 Deoptimization::Action_maybe_recompile); |