1.1 --- a/src/share/vm/oops/methodDataOop.hpp Fri Feb 05 11:07:40 2010 -0800 1.2 +++ b/src/share/vm/oops/methodDataOop.hpp Sun Feb 07 12:15:06 2010 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -545,6 +545,10 @@ 1.11 return cell_offset(counter_cell_count); 1.12 } 1.13 1.14 + void set_count(uint count) { 1.15 + set_uint_at(count_off, count); 1.16 + } 1.17 + 1.18 #ifndef PRODUCT 1.19 void print_data_on(outputStream* st); 1.20 #endif 1.21 @@ -692,6 +696,23 @@ 1.22 1.23 void clear_row(uint row) { 1.24 assert(row < row_limit(), "oob"); 1.25 + // Clear total count - indicator of polymorphic call site. 1.26 + // The site may look like as monomorphic after that but 1.27 + // it allow to have more accurate profiling information because 1.28 + // there was execution phase change since klasses were unloaded. 1.29 + // If the site is still polymorphic then MDO will be updated 1.30 + // to reflect it. But it could be the case that the site becomes 1.31 + // only bimorphic. Then keeping total count not 0 will be wrong. 1.32 + // Even if we use monomorphic (when it is not) for compilation 1.33 + // we will only have trap, deoptimization and recompile again 1.34 + // with updated MDO after executing method in Interpreter. 1.35 + // An additional receiver will be recorded in the cleaned row 1.36 + // during next call execution. 1.37 + // 1.38 + // Note: our profiling logic works with empty rows in any slot. 1.39 + // We do sorting a profiling info (ciCallProfile) for compilation. 1.40 + // 1.41 + set_count(0); 1.42 set_receiver(row, NULL); 1.43 set_receiver_count(row, 0); 1.44 }