src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/graphKit.cpp	Mon Jan 20 11:14:23 2014
--- new/src/share/vm/opto/graphKit.cpp	Mon Jan 20 11:14:22 2014

*** 609,621 **** --- 609,622 ---- // create the stack trace. // Usual case: Bail to interpreter. // Reserve the right to recompile if we haven't seen anything yet. + assert(!Deoptimization::reason_is_speculate(reason), "unsupported"); Deoptimization::DeoptAction action = Deoptimization::Action_maybe_recompile; if (treat_throw_as_hot ! && (method()->method_data()->trap_recompiled_at(bci(), NULL) || C->too_many_traps(reason))) { // We cannot afford to take more traps here. Suffer in the interpreter. if (C->log() != NULL) C->log()->elem("hot_throw preallocated='0' reason='%s' mcount='%d'", Deoptimization::trap_reason_name(reason),
*** 2736,2747 **** --- 2737,2750 ---- ciKlass* require_klass, ciKlass* spec_klass, bool safe_for_replace) { if (!UseTypeProfile || !TypeProfileCasts) return NULL; + Deoptimization::DeoptReason reason = spec_klass == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check; + // Make sure we haven't already deoptimized from this tactic. ! if (too_many_traps(Deoptimization::Reason_class_check)) ! if (too_many_traps(reason)) return NULL; // (No, this isn't a call, but it's enough like a virtual call // to use the same ciMethod accessor to get the profile info...) // If we have a speculative type use it instead of profiling (which
*** 2759,2769 **** --- 2762,2772 ---- Node* exact_obj = not_null_obj; // will get updated in place... Node* slow_ctl = type_check_receiver(exact_obj, exact_kls, 1.0, &exact_obj); { PreserveJVMState pjvms(this); set_control(slow_ctl); ! uncommon_trap(Deoptimization::Reason_class_check, ! uncommon_trap(reason, Deoptimization::Action_maybe_recompile); } if (safe_for_replace) { replace_in_map(not_null_obj, exact_obj); }
*** 2786,2797 **** --- 2789,2802 ---- Node* GraphKit::maybe_cast_profiled_obj(Node* obj, ciKlass* type, bool not_null) { // type == NULL if profiling tells us this object is always null if (type != NULL) { if (!too_many_traps(Deoptimization::Reason_null_check) && !too_many_traps(Deoptimization::Reason_class_check)) { + Deoptimization::DeoptReason class_reason = Deoptimization::Reason_speculate_class_check; + Deoptimization::DeoptReason null_reason = Deoptimization::Reason_null_check; + if (!too_many_traps(null_reason) && + !too_many_traps(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 if (!not_null) { Node* null_ctl = top();
*** 2806,2816 **** --- 2811,2821 ---- Node* slow_ctl = type_check_receiver(exact_obj, exact_kls, 1.0, &exact_obj); { PreserveJVMState pjvms(this); set_control(slow_ctl); ! uncommon_trap(Deoptimization::Reason_class_check, ! uncommon_trap(class_reason, Deoptimization::Action_maybe_recompile); } replace_in_map(not_null_obj, exact_obj); obj = exact_obj; }
*** 2875,2885 **** --- 2880,2890 ---- known_statically = (static_res == SSC_always_true || static_res == SSC_always_false); } } if (known_statically && UseTypeSpeculation) { ! // If we know the type check always succeeds then we don't use the // profiling data at this bytecode. Don't lose it, feed it to the // type system as a speculative type. not_null_obj = record_profiled_receiver_for_speculation(not_null_obj); } else { const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr();

src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File