--- old/src/share/vm/opto/graphKit.cpp 2015-03-12 16:59:43.660367671 +0100 +++ new/src/share/vm/opto/graphKit.cpp 2015-03-12 16:59:43.428332516 +0100 @@ -2795,18 +2795,15 @@ */ Node* GraphKit::maybe_cast_profiled_obj(Node* obj, ciKlass* type, - bool not_null, - SafePointNode* sfpt) { + bool not_null) { // type == NULL if profiling tells us this object is always null if (type != NULL) { Deoptimization::DeoptReason class_reason = Deoptimization::Reason_speculate_class_check; Deoptimization::DeoptReason null_reason = Deoptimization::Reason_speculate_null_check; - ciMethod* trap_method = (sfpt == NULL) ? method() : sfpt->jvms()->method(); - int trap_bci = (sfpt == NULL) ? bci() : sfpt->jvms()->bci(); if (!too_many_traps(null_reason) && !too_many_recompiles(null_reason) && - !C->too_many_traps(trap_method, trap_bci, class_reason) && - !C->too_many_recompiles(trap_method, trap_bci, class_reason)) { + !too_many_traps(class_reason) && + !too_many_recompiles(class_reason)) { Node* not_null_obj = NULL; // not_null is true if we know the object is not null and // there's no need for a null check @@ -2822,12 +2819,7 @@ ciKlass* exact_kls = type; Node* slow_ctl = type_check_receiver(exact_obj, exact_kls, 1.0, &exact_obj); - if (sfpt != NULL) { - GraphKit kit(sfpt->jvms()); - PreserveJVMState pjvms(&kit); - kit.set_control(slow_ctl); - kit.uncommon_trap_exact(class_reason, Deoptimization::Action_maybe_recompile); - } else { + { PreserveJVMState pjvms(this); set_control(slow_ctl); uncommon_trap_exact(class_reason, Deoptimization::Action_maybe_recompile);