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

src/share/vm/opto/doCall.cpp

Print this page
rev 6139 : 8031755: Type speculation should be used to optimize explicit null checks
Summary: feed profiling data about reference nullness to type speculation.
Reviewed-by:

*** 247,258 **** } } } CallGenerator* miss_cg; Deoptimization::DeoptReason reason = morphism == 2 ? ! Deoptimization::Reason_bimorphic : ! (speculative_receiver_type == NULL ? Deoptimization::Reason_class_check : Deoptimization::Reason_speculate_class_check); if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && !too_many_traps(jvms->method(), jvms->bci(), reason) ) { // Generate uncommon trap for class check failure path // in case of monomorphic or bimorphic virtual call site. --- 247,257 ---- } } } CallGenerator* miss_cg; Deoptimization::DeoptReason reason = morphism == 2 ? ! Deoptimization::Reason_bimorphic : Deoptimization::reason_class_check(speculative_receiver_type != NULL); if ((morphism == 1 || (morphism == 2 && next_hit_cg != NULL)) && !too_many_traps(jvms->method(), jvms->bci(), reason) ) { // Generate uncommon trap for class check failure path // in case of monomorphic or bimorphic virtual call site.
*** 629,645 **** null_assert(peek()); set_bci(iter().cur_bci()); // put it back } BasicType ct = ctype->basic_type(); if (ct == T_OBJECT || ct == T_ARRAY) { ! ciKlass* better_type = method()->return_profiled_type(bci()); ! if (UseTypeSpeculation && better_type != NULL) { ! // If profiling reports a single type for the return value, ! // feed it to the type system so it can propagate it as a ! // speculative type ! record_profile_for_speculation(stack(sp()-1), better_type); ! } } } // Restart record of parsing work after possible inlining of call #ifndef PRODUCT --- 628,638 ---- null_assert(peek()); set_bci(iter().cur_bci()); // put it back } BasicType ct = ctype->basic_type(); if (ct == T_OBJECT || ct == T_ARRAY) { ! record_profiled_return_for_speculation(); } } // Restart record of parsing work after possible inlining of call #ifndef PRODUCT
src/share/vm/opto/doCall.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File