Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/doCall.cpp @ 6793:9d89c76b0505
7198499: TraceTypeProfile as diagnostic option
Reviewed-by: kvn
Contributed-by: Aleksey Shipilev <aleksey.shipilev@oracle.com>
author | twisti |
---|---|
date | Wed, 19 Sep 2012 10:38:12 -0700 |
parents | da91efe96a93 |
children | e626685e9f6c |
comparison
equal
deleted
inserted
replaced
6792:137868b7aa6f | 6793:9d89c76b0505 |
---|---|
38 #include "opto/runtime.hpp" | 38 #include "opto/runtime.hpp" |
39 #include "opto/subnode.hpp" | 39 #include "opto/subnode.hpp" |
40 #include "prims/nativeLookup.hpp" | 40 #include "prims/nativeLookup.hpp" |
41 #include "runtime/sharedRuntime.hpp" | 41 #include "runtime/sharedRuntime.hpp" |
42 | 42 |
43 #ifndef PRODUCT | |
44 void trace_type_profile(ciMethod *method, int depth, int bci, ciMethod *prof_method, ciKlass *prof_klass, int site_count, int receiver_count) { | 43 void trace_type_profile(ciMethod *method, int depth, int bci, ciMethod *prof_method, ciKlass *prof_klass, int site_count, int receiver_count) { |
45 if (TraceTypeProfile || PrintInlining || PrintOptoInlining) { | 44 if (TraceTypeProfile || PrintInlining NOT_PRODUCT(|| PrintOptoInlining)) { |
46 if (!PrintInlining) { | 45 if (!PrintInlining) { |
47 if (!PrintOpto && !PrintCompilation) { | 46 if (NOT_PRODUCT(!PrintOpto &&) !PrintCompilation) { |
48 method->print_short_name(); | 47 method->print_short_name(); |
49 tty->cr(); | 48 tty->cr(); |
50 } | 49 } |
51 CompileTask::print_inlining(prof_method, depth, bci); | 50 CompileTask::print_inlining(prof_method, depth, bci); |
52 } | 51 } |
54 tty->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count); | 53 tty->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count); |
55 prof_klass->name()->print_symbol(); | 54 prof_klass->name()->print_symbol(); |
56 tty->cr(); | 55 tty->cr(); |
57 } | 56 } |
58 } | 57 } |
59 #endif | |
60 | 58 |
61 CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool call_is_virtual, | 59 CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool call_is_virtual, |
62 JVMState* jvms, bool allow_inline, | 60 JVMState* jvms, bool allow_inline, |
63 float prof_factor, bool allow_intrinsics) { | 61 float prof_factor, bool allow_intrinsics) { |
64 ciMethod* caller = jvms->method(); | 62 ciMethod* caller = jvms->method(); |
223 // in case of polymorphic virtual call site. | 221 // in case of polymorphic virtual call site. |
224 miss_cg = CallGenerator::for_virtual_call(callee, vtable_index); | 222 miss_cg = CallGenerator::for_virtual_call(callee, vtable_index); |
225 } | 223 } |
226 if (miss_cg != NULL) { | 224 if (miss_cg != NULL) { |
227 if (next_hit_cg != NULL) { | 225 if (next_hit_cg != NULL) { |
228 NOT_PRODUCT(trace_type_profile(jvms->method(), jvms->depth() - 1, jvms->bci(), next_receiver_method, profile.receiver(1), site_count, profile.receiver_count(1))); | 226 trace_type_profile(jvms->method(), jvms->depth() - 1, jvms->bci(), next_receiver_method, profile.receiver(1), site_count, profile.receiver_count(1)); |
229 // We don't need to record dependency on a receiver here and below. | 227 // We don't need to record dependency on a receiver here and below. |
230 // Whenever we inline, the dependency is added by Parse::Parse(). | 228 // Whenever we inline, the dependency is added by Parse::Parse(). |
231 miss_cg = CallGenerator::for_predicted_call(profile.receiver(1), miss_cg, next_hit_cg, PROB_MAX); | 229 miss_cg = CallGenerator::for_predicted_call(profile.receiver(1), miss_cg, next_hit_cg, PROB_MAX); |
232 } | 230 } |
233 if (miss_cg != NULL) { | 231 if (miss_cg != NULL) { |
234 NOT_PRODUCT(trace_type_profile(jvms->method(), jvms->depth() - 1, jvms->bci(), receiver_method, profile.receiver(0), site_count, receiver_count)); | 232 trace_type_profile(jvms->method(), jvms->depth() - 1, jvms->bci(), receiver_method, profile.receiver(0), site_count, receiver_count); |
235 CallGenerator* cg = CallGenerator::for_predicted_call(profile.receiver(0), miss_cg, hit_cg, profile.receiver_prob(0)); | 233 CallGenerator* cg = CallGenerator::for_predicted_call(profile.receiver(0), miss_cg, hit_cg, profile.receiver_prob(0)); |
236 if (cg != NULL) return cg; | 234 if (cg != NULL) return cg; |
237 } | 235 } |
238 } | 236 } |
239 } | 237 } |