< prev index next >

src/share/vm/runtime/simpleThresholdPolicy.cpp

Print this page




  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 #if INCLUDE_JVMCI
  33 #include "jvmci/jvmciRuntime.hpp"
  34 #endif
  35 
  36 #ifdef TIERED
  37 
  38 void SimpleThresholdPolicy::print_counters(const char* prefix, methodHandle mh) {
  39   int invocation_count = mh->invocation_count();
  40   int backedge_count = mh->backedge_count();
  41   MethodData* mdh = mh->method_data();
  42   int mdo_invocations = 0, mdo_backedges = 0;
  43   int mdo_invocations_start = 0, mdo_backedges_start = 0;
  44   if (mdh != NULL) {
  45     mdo_invocations = mdh->invocation_count();
  46     mdo_backedges = mdh->backedge_count();
  47     mdo_invocations_start = mdh->invocation_count_start();
  48     mdo_backedges_start = mdh->backedge_count_start();
  49   }
  50   tty->print(" %stotal=%d,%d %smdo=%d(%d),%d(%d)", prefix,
  51       invocation_count, backedge_count, prefix,
  52       mdo_invocations, mdo_invocations_start,
  53       mdo_backedges, mdo_backedges_start);
  54   tty->print(" %smax levels=%d,%d", prefix,
  55       mh->highest_comp_level(), mh->highest_osr_comp_level());
  56 }
  57 
  58 // Print an event.
  59 void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodHandle imh,
  60                                         int bci, CompLevel level) {
  61   bool inlinee_event = mh() != imh();
  62 
  63   ttyLocker tty_lock;
  64   tty->print("%lf: [", os::elapsedTime());
  65 
  66   switch(type) {
  67   case CALL:
  68     tty->print("call");
  69     break;
  70   case LOOP:
  71     tty->print("loop");
  72     break;
  73   case COMPILE:
  74     tty->print("compile");
  75     break;
  76   case REMOVE_FROM_QUEUE:
  77     tty->print("remove-from-queue");
  78     break;
  79   case UPDATE_IN_QUEUE:




  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 #if INCLUDE_JVMCI
  33 #include "jvmci/jvmciRuntime.hpp"
  34 #endif
  35 
  36 #ifdef TIERED
  37 
  38 void SimpleThresholdPolicy::print_counters(const char* prefix, const methodHandle& mh) {
  39   int invocation_count = mh->invocation_count();
  40   int backedge_count = mh->backedge_count();
  41   MethodData* mdh = mh->method_data();
  42   int mdo_invocations = 0, mdo_backedges = 0;
  43   int mdo_invocations_start = 0, mdo_backedges_start = 0;
  44   if (mdh != NULL) {
  45     mdo_invocations = mdh->invocation_count();
  46     mdo_backedges = mdh->backedge_count();
  47     mdo_invocations_start = mdh->invocation_count_start();
  48     mdo_backedges_start = mdh->backedge_count_start();
  49   }
  50   tty->print(" %stotal=%d,%d %smdo=%d(%d),%d(%d)", prefix,
  51       invocation_count, backedge_count, prefix,
  52       mdo_invocations, mdo_invocations_start,
  53       mdo_backedges, mdo_backedges_start);
  54   tty->print(" %smax levels=%d,%d", prefix,
  55       mh->highest_comp_level(), mh->highest_osr_comp_level());
  56 }
  57 
  58 // Print an event.
  59 void SimpleThresholdPolicy::print_event(EventType type, const methodHandle& mh, const methodHandle& imh,
  60                                         int bci, CompLevel level) {
  61   bool inlinee_event = mh() != imh();
  62 
  63   ttyLocker tty_lock;
  64   tty->print("%lf: [", os::elapsedTime());
  65 
  66   switch(type) {
  67   case CALL:
  68     tty->print("call");
  69     break;
  70   case LOOP:
  71     tty->print("loop");
  72     break;
  73   case COMPILE:
  74     tty->print("compile");
  75     break;
  76   case REMOVE_FROM_QUEUE:
  77     tty->print("remove-from-queue");
  78     break;
  79   case UPDATE_IN_QUEUE:


< prev index next >