13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "compiler/compileBroker.hpp" 27 #include "memory/resourceArea.hpp" 28 #include "runtime/arguments.hpp" 29 #include "runtime/simpleThresholdPolicy.hpp" 30 #include "runtime/simpleThresholdPolicy.inline.hpp" 31 #include "code/scopeDesc.hpp" 32 33 // Print an event. 34 void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodHandle imh, 35 int bci, CompLevel level) { 36 bool inlinee_event = mh() != imh(); 37 38 ttyLocker tty_lock; 39 tty->print("%lf: [", os::elapsedTime()); 40 41 int invocation_count = mh->invocation_count(); 42 int backedge_count = mh->backedge_count(); 43 switch(type) { 44 case CALL: 45 tty->print("call"); 46 break; 47 case LOOP: 48 tty->print("loop"); 49 break; 50 case COMPILE: 51 tty->print("compile"); 52 break; 53 case REMOVE_FROM_QUEUE: 54 tty->print("remove-from-queue"); 55 break; 56 case UPDATE_IN_QUEUE: 57 tty->print("update-in-queue"); 58 break; 59 case REPROFILE: 60 tty->print("reprofile"); 61 break; 62 case MAKE_NOT_ENTRANT: 65 default: 66 tty->print("unknown"); 67 } 68 69 tty->print(" level: %d ", level); 70 71 ResourceMark rm; 72 char *method_name = mh->name_and_sig_as_C_string(); 73 tty->print("[%s", method_name); 74 if (inlinee_event) { 75 char *inlinee_name = imh->name_and_sig_as_C_string(); 76 tty->print(" [%s]] ", inlinee_name); 77 } 78 else tty->print("] "); 79 tty->print("@%d queues: %d,%d", bci, CompileBroker::queue_size(CompLevel_full_profile), 80 CompileBroker::queue_size(CompLevel_full_optimization)); 81 82 print_specific(type, mh, imh, bci, level); 83 84 if (type != COMPILE) { 85 methodDataHandle mdh = mh->method_data(); 86 int mdo_invocations = 0, mdo_backedges = 0; 87 int mdo_invocations_start = 0, mdo_backedges_start = 0; 88 if (mdh() != NULL) { 89 mdo_invocations = mdh->invocation_count(); 90 mdo_backedges = mdh->backedge_count(); 91 mdo_invocations_start = mdh->invocation_count_start(); 92 mdo_backedges_start = mdh->backedge_count_start(); 93 } 94 tty->print(" total: %d,%d mdo: %d(%d),%d(%d)", 95 invocation_count, backedge_count, 96 mdo_invocations, mdo_invocations_start, 97 mdo_backedges, mdo_backedges_start); 98 tty->print(" max levels: %d,%d", 99 mh->highest_comp_level(), mh->highest_osr_comp_level()); 100 if (inlinee_event) { 101 tty->print(" inlinee max levels: %d,%d", imh->highest_comp_level(), imh->highest_osr_comp_level()); 102 } 103 tty->print(" compilable: "); 104 bool need_comma = false; 105 if (!mh->is_not_compilable(CompLevel_full_profile)) { 106 tty->print("c1"); 107 need_comma = true; 108 } 109 if (!mh->is_not_compilable(CompLevel_full_optimization)) { 110 if (need_comma) tty->print(", "); 111 tty->print("c2"); 112 need_comma = true; 113 } 114 if (!mh->is_not_osr_compilable()) { 115 if (need_comma) tty->print(", "); 116 tty->print("osr"); 117 } 118 tty->print(" status:"); 119 if (mh->queued_for_compilation()) { 120 tty->print(" in queue"); 121 } else tty->print(" idle"); | 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "compiler/compileBroker.hpp" 27 #include "memory/resourceArea.hpp" 28 #include "runtime/arguments.hpp" 29 #include "runtime/simpleThresholdPolicy.hpp" 30 #include "runtime/simpleThresholdPolicy.inline.hpp" 31 #include "code/scopeDesc.hpp" 32 33 34 void SimpleThresholdPolicy::print_counters(const char* prefix, methodHandle mh) { 35 int invocation_count = mh->invocation_count(); 36 int backedge_count = mh->backedge_count(); 37 methodDataHandle mdh = mh->method_data(); 38 int mdo_invocations = 0, mdo_backedges = 0; 39 int mdo_invocations_start = 0, mdo_backedges_start = 0; 40 if (mdh() != NULL) { 41 mdo_invocations = mdh->invocation_count(); 42 mdo_backedges = mdh->backedge_count(); 43 mdo_invocations_start = mdh->invocation_count_start(); 44 mdo_backedges_start = mdh->backedge_count_start(); 45 } 46 tty->print(" %stotal: %d,%d %smdo: %d(%d),%d(%d)", prefix, 47 invocation_count, backedge_count, prefix, 48 mdo_invocations, mdo_invocations_start, 49 mdo_backedges, mdo_backedges_start); 50 tty->print(" %smax levels: %d,%d", prefix, 51 mh->highest_comp_level(), mh->highest_osr_comp_level()); 52 } 53 54 // Print an event. 55 void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodHandle imh, 56 int bci, CompLevel level) { 57 bool inlinee_event = mh() != imh(); 58 59 ttyLocker tty_lock; 60 tty->print("%lf: [", os::elapsedTime()); 61 62 switch(type) { 63 case CALL: 64 tty->print("call"); 65 break; 66 case LOOP: 67 tty->print("loop"); 68 break; 69 case COMPILE: 70 tty->print("compile"); 71 break; 72 case REMOVE_FROM_QUEUE: 73 tty->print("remove-from-queue"); 74 break; 75 case UPDATE_IN_QUEUE: 76 tty->print("update-in-queue"); 77 break; 78 case REPROFILE: 79 tty->print("reprofile"); 80 break; 81 case MAKE_NOT_ENTRANT: 84 default: 85 tty->print("unknown"); 86 } 87 88 tty->print(" level: %d ", level); 89 90 ResourceMark rm; 91 char *method_name = mh->name_and_sig_as_C_string(); 92 tty->print("[%s", method_name); 93 if (inlinee_event) { 94 char *inlinee_name = imh->name_and_sig_as_C_string(); 95 tty->print(" [%s]] ", inlinee_name); 96 } 97 else tty->print("] "); 98 tty->print("@%d queues: %d,%d", bci, CompileBroker::queue_size(CompLevel_full_profile), 99 CompileBroker::queue_size(CompLevel_full_optimization)); 100 101 print_specific(type, mh, imh, bci, level); 102 103 if (type != COMPILE) { 104 print_counters("", mh); 105 if (inlinee_event) { 106 print_counters("inlinee ", imh); 107 } 108 tty->print(" compilable: "); 109 bool need_comma = false; 110 if (!mh->is_not_compilable(CompLevel_full_profile)) { 111 tty->print("c1"); 112 need_comma = true; 113 } 114 if (!mh->is_not_compilable(CompLevel_full_optimization)) { 115 if (need_comma) tty->print(", "); 116 tty->print("c2"); 117 need_comma = true; 118 } 119 if (!mh->is_not_osr_compilable()) { 120 if (need_comma) tty->print(", "); 121 tty->print("osr"); 122 } 123 tty->print(" status:"); 124 if (mh->queued_for_compilation()) { 125 tty->print(" in queue"); 126 } else tty->print(" idle"); |