当前位置: 首页>>代码示例>>C++>>正文


C++ MethodCounters类代码示例

本文整理汇总了C++中MethodCounters的典型用法代码示例。如果您正苦于以下问题:C++ MethodCounters类的具体用法?C++ MethodCounters怎么用?C++ MethodCounters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MethodCounters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: assert

void NonTieredCompPolicy::trace_frequency_counter_overflow(const methodHandle& m, int branch_bci, int bci) {
  if (TraceInvocationCounterOverflow) {
    MethodCounters* mcs = m->method_counters();
    assert(mcs != NULL, "MethodCounters cannot be NULL for profiling");
    InvocationCounter* ic = mcs->invocation_counter();
    InvocationCounter* bc = mcs->backedge_counter();
    ResourceMark rm;
    if (bci == InvocationEntryBci) {
      tty->print("comp-policy cntr ovfl @ %d in entry of ", bci);
    } else {
      tty->print("comp-policy cntr ovfl @ %d in loop of ", bci);
    }
    m->print_value();
    tty->cr();
    ic->print();
    bc->print();
    if (ProfileInterpreter) {
      if (bci != InvocationEntryBci) {
        MethodData* mdo = m->method_data();
        if (mdo != NULL) {
          int count = mdo->bci_to_data(branch_bci)->as_JumpData()->taken();
          tty->print_cr("back branch count = %d", count);
        }
      }
    }
  }
}
开发者ID:mohlerm,项目名称:hotspot_cached_profiles,代码行数:27,代码来源:compilationPolicy.cpp

示例2: disable_compilation

void NonTieredCompPolicy::disable_compilation(Method* method) {
  MethodCounters* mcs = method->method_counters();
  if (mcs != NULL) {
    mcs->invocation_counter()->set_state(InvocationCounter::wait_for_nothing);
    mcs->backedge_counter()->set_state(InvocationCounter::wait_for_nothing);
  }
}
开发者ID:mohlerm,项目名称:hotspot_cached_profiles,代码行数:7,代码来源:compilationPolicy.cpp

示例3: delay_compilation

// This method can be called by any component of the runtime to notify the policy
// that it's recommended to delay the compilation of this method.
void NonTieredCompPolicy::delay_compilation(Method* method) {
  MethodCounters* mcs = method->method_counters();
  if (mcs != NULL) {
    mcs->invocation_counter()->decay();
    mcs->backedge_counter()->decay();
  }
}
开发者ID:mohlerm,项目名称:hotspot_cached_profiles,代码行数:9,代码来源:compilationPolicy.cpp

示例4: interpreter_throwout_count

 int  interpreter_throwout_count() const        {
   MethodCounters* mcs = method_counters();
   if (mcs == NULL) {
     return 0;
   } else {
     return mcs->interpreter_throwout_count();
   }
 }
开发者ID:txazo,项目名称:hotspot,代码行数:8,代码来源:method.hpp

示例5: number_of_breakpoints

 // Tracking number of breakpoints, for fullspeed debugging.
 // Only mutated by VM thread.
 u2   number_of_breakpoints()             const {
   MethodCounters* mcs = method_counters();
   if (mcs == NULL) {
     return 0;
   } else {
     return mcs->number_of_breakpoints();
   }
 }
开发者ID:txazo,项目名称:hotspot,代码行数:10,代码来源:method.hpp

示例6: interpreter_invocation_count

 int interpreter_invocation_count() {
   if (TieredCompilation) {
     return invocation_count();
   } else {
     MethodCounters* mcs = method_counters();
     return (mcs == NULL) ? 0 : mcs->interpreter_invocation_count();
   }
 }
开发者ID:txazo,项目名称:hotspot,代码行数:8,代码来源:method.hpp

示例7: handle_counter_overflow

// Set carry flags on the counters if necessary
void SimpleThresholdPolicy::handle_counter_overflow(Method* method) {
  MethodCounters *mcs = method->method_counters();
  if (mcs != NULL) {
    set_carry_if_necessary(mcs->invocation_counter());
    set_carry_if_necessary(mcs->backedge_counter());
  }
  MethodData* mdo = method->method_data();
  if (mdo != NULL) {
    set_carry_if_necessary(mdo->invocation_counter());
    set_carry_if_necessary(mdo->backedge_counter());
  }
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例8: MAX2

// Get a measure of how much mileage the method has on it.
int MethodData::mileage_of(Method* method) {
  int mileage = 0;
  if (TieredCompilation) {
    mileage = MAX2(method->invocation_count(), method->backedge_count());
  } else {
    int iic = method->interpreter_invocation_count();
    if (mileage < iic)  mileage = iic;
    MethodCounters* mcs = method->method_counters();
    if (mcs != NULL) {
      InvocationCounter* ic = mcs->invocation_counter();
      InvocationCounter* bc = mcs->backedge_counter();
      int icval = ic->count();
      if (ic->carry()) icval += CompileThreshold;
      if (mileage < icval)  mileage = icval;
      int bcval = bc->count();
      if (bc->carry()) bcval += CompileThreshold;
      if (mileage < bcval)  mileage = bcval;
    }
  }
  return mileage;
}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例9: reprofile

void NonTieredCompPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) {
  ScopeDesc* sd = trap_scope;
  MethodCounters* mcs;
  InvocationCounter* c;
  for (; !sd->is_top(); sd = sd->sender()) {
    mcs = sd->method()->method_counters();
    if (mcs != NULL) {
      // Reset ICs of inlined methods, since they can trigger compilations also.
      mcs->invocation_counter()->reset();
    }
  }
  mcs = sd->method()->method_counters();
  if (mcs != NULL) {
    c = mcs->invocation_counter();
    if (is_osr) {
      // It was an OSR method, so bump the count higher.
      c->set(c->state(), CompileThreshold);
    } else {
      c->reset();
    }
    mcs->backedge_counter()->reset();
  }
}
开发者ID:mohlerm,项目名称:hotspot_cached_profiles,代码行数:23,代码来源:compilationPolicy.cpp

示例10: interpreter_throwout_increment

 // Count of times method was exited via exception while interpreting
 void interpreter_throwout_increment(TRAPS) {
   MethodCounters* mcs = get_method_counters(CHECK);
   if (mcs != NULL) {
     mcs->interpreter_throwout_increment();
   }
 }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例11: decr_number_of_breakpoints

 void decr_number_of_breakpoints(TRAPS)         {
   MethodCounters* mcs = get_method_counters(CHECK);
   if (mcs != NULL) {
     mcs->decr_number_of_breakpoints();
   }
 }
开发者ID:,项目名称:,代码行数:6,代码来源:

示例12: rate

 float rate() const                             {
   MethodCounters* mcs = method_counters();
   return mcs == NULL ? 0 : mcs->rate();
 }
开发者ID:txazo,项目名称:hotspot,代码行数:4,代码来源:method.hpp

示例13: assert

int CppInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
  // Make sure method is native and not abstract
  assert(method->is_native() && !method->is_abstract(), "should be");

  JavaThread *thread = (JavaThread *) THREAD;
  ZeroStack *stack = thread->zero_stack();

  // Allocate and initialize our frame
  InterpreterFrame *frame = InterpreterFrame::build(method, CHECK_0);
  thread->push_zero_frame(frame);
  interpreterState istate = frame->interpreter_state();
  intptr_t *locals = istate->locals();

  // Update the invocation counter
  if ((UseCompiler || CountCompiledCalls) && !method->is_synchronized()) {
    MethodCounters* mcs = method->method_counters();
    if (mcs == NULL) {
      CALL_VM_NOCHECK(mcs = InterpreterRuntime::build_method_counters(thread, method));
      if (HAS_PENDING_EXCEPTION)
        goto unwind_and_return;
    }
    InvocationCounter *counter = mcs->invocation_counter();
    counter->increment();
    if (counter->reached_InvocationLimit(mcs->backedge_counter())) {
      CALL_VM_NOCHECK(
        InterpreterRuntime::frequency_counter_overflow(thread, NULL));
      if (HAS_PENDING_EXCEPTION)
        goto unwind_and_return;
    }
  }

  // Lock if necessary
  BasicObjectLock *monitor;
  monitor = NULL;
  if (method->is_synchronized()) {
    monitor = (BasicObjectLock*) istate->stack_base();
    oop lockee = monitor->obj();
    markOop disp = lockee->mark()->set_unlocked();

    monitor->lock()->set_displaced_header(disp);
    if (Atomic::cmpxchg_ptr(monitor, lockee->mark_addr(), disp) != disp) {
      if (thread->is_lock_owned((address) disp->clear_lock_bits())) {
        monitor->lock()->set_displaced_header(NULL);
      }
      else {
        CALL_VM_NOCHECK(InterpreterRuntime::monitorenter(thread, monitor));
        if (HAS_PENDING_EXCEPTION)
          goto unwind_and_return;
      }
    }
  }

  // Get the signature handler
  InterpreterRuntime::SignatureHandler *handler; {
    address handlerAddr = method->signature_handler();
    if (handlerAddr == NULL) {
      CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method));
      if (HAS_PENDING_EXCEPTION)
        goto unlock_unwind_and_return;

      handlerAddr = method->signature_handler();
      assert(handlerAddr != NULL, "eh?");
    }
    if (handlerAddr == (address) InterpreterRuntime::slow_signature_handler) {
      CALL_VM_NOCHECK(handlerAddr =
        InterpreterRuntime::slow_signature_handler(thread, method, NULL,NULL));
      if (HAS_PENDING_EXCEPTION)
        goto unlock_unwind_and_return;
    }
    handler = \
      InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr);
  }

  // Get the native function entry point
  address function;
  function = method->native_function();
  assert(function != NULL, "should be set if signature handler is");

  // Build the argument list
  stack->overflow_check(handler->argument_count() * 2, THREAD);
  if (HAS_PENDING_EXCEPTION)
    goto unlock_unwind_and_return;

  void **arguments;
  void *mirror; {
    arguments =
      (void **) stack->alloc(handler->argument_count() * sizeof(void **));
    void **dst = arguments;

    void *env = thread->jni_environment();
    *(dst++) = &env;

    if (method->is_static()) {
      istate->set_oop_temp(
        method->constants()->pool_holder()->java_mirror());
      mirror = istate->oop_temp_addr();
      *(dst++) = &mirror;
    }

    intptr_t *src = locals;
//.........这里部分代码省略.........
开发者ID:MyProgrammingStyle,项目名称:hotspot,代码行数:101,代码来源:cppInterpreter_zero.cpp

示例14: set_rate

 void set_rate(float rate, TRAPS) {
   MethodCounters* mcs = get_method_counters(CHECK);
   if (mcs != NULL) {
     mcs->set_rate(rate);
   }
 }
开发者ID:,项目名称:,代码行数:6,代码来源:

示例15: do_method

 static void do_method(Method* m) {
   MethodCounters* mcs = m->method_counters();
   if (mcs != NULL) {
     mcs->invocation_counter()->decay();
   }
 }
开发者ID:mohlerm,项目名称:hotspot_cached_profiles,代码行数:6,代码来源:compilationPolicy.cpp


注:本文中的MethodCounters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。