--- old/src/share/vm/ci/ciMethod.cpp Thu Feb 4 09:29:52 2010 +++ new/src/share/vm/ci/ciMethod.cpp Thu Feb 4 09:29:52 2010 @@ -445,7 +445,8 @@ (morphism == ciCallProfile::MorphismLimit && count == 0)) { #ifdef ASSERT if (count > 0) { - tty->print_cr("bci: %d", bci); + this->print_short_name(tty); + tty->print_cr(" @ bci:%d", bci); this->print_codes(); assert(false, "this call site should not be polymorphic"); } --- old/src/share/vm/oops/methodDataOop.hpp Thu Feb 4 09:29:52 2010 +++ new/src/share/vm/oops/methodDataOop.hpp Thu Feb 4 09:29:52 2010 @@ -545,6 +545,10 @@ return cell_offset(counter_cell_count); } + void set_count(uint count) { + set_uint_at(count_off, count); + } + #ifndef PRODUCT void print_data_on(outputStream* st); #endif @@ -692,6 +696,10 @@ void clear_row(uint row) { assert(row < row_limit(), "oob"); + // Cleare total count - indicator of polimorphic call site. + // An additional receiver will be recorded in the cleaned row + // during next call execution. + set_count(0); set_receiver(row, NULL); set_receiver_count(row, 0); } --- old/src/share/vm/opto/doCall.cpp Thu Feb 4 09:29:53 2010 +++ new/src/share/vm/opto/doCall.cpp Thu Feb 4 09:29:52 2010 @@ -70,7 +70,7 @@ CompileLog* log = this->log(); if (log != NULL) { int rid = (receiver_count >= 0)? log->identify(profile.receiver(0)): -1; - int r2id = (profile.morphism() == 2)? log->identify(profile.receiver(1)):-1; + int r2id = (rid != -1 && profile.has_receiver(1))? log->identify(profile.receiver(1)):-1; log->begin_elem("call method='%d' count='%d' prof_factor='%g'", log->identify(call_method), site_count, prof_factor); if (call_is_virtual) log->print(" virtual='1'");