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


C++ Method::jmethod_id方法代码示例

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


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

示例1: doit

 void doit() {
   ResourceMark rmark; // _thread != Thread::current()
   RegisterMap rm(_thread, false);
   // There can be a race condition between a VM_Operation reaching a safepoint
   // and the target thread exiting from Java execution.
   // We must recheck the last Java frame still exists.
   if (!_thread->is_exiting() && _thread->has_last_Java_frame()) {
     javaVFrame* vf = _thread->last_java_vframe(&rm);
     assert(vf != NULL, "must have last java frame");
     Method* method = vf->method();
     _method_id = method->jmethod_id();
     _bci = vf->bci();
   } else {
     // Clear current location as the target thread has no Java frames anymore.
     _method_id = (jmethodID)NULL;
     _bci = 0;
   }
 }
开发者ID:MyProgrammingStyle,项目名称:hotspot,代码行数:18,代码来源:jvmtiEnvThreadState.cpp

示例2: rm

jvmtiError
JvmtiEnvBase::get_frame_location(JavaThread *java_thread, jint depth,
                                 jmethodID* method_ptr, jlocation* location_ptr) {
#ifdef ASSERT
  uint32_t debug_bits = 0;
#endif
  assert((SafepointSynchronize::is_at_safepoint() ||
          is_thread_fully_suspended(java_thread, false, &debug_bits)),
         "at safepoint or target thread is suspended");
  Thread* current_thread = Thread::current();
  ResourceMark rm(current_thread);

  vframe *vf = vframeFor(java_thread, depth);
  if (vf == NULL) {
    return JVMTI_ERROR_NO_MORE_FRAMES;
  }

  // vframeFor should return a java frame. If it doesn't
  // it means we've got an internal error and we return the
  // error in product mode. In debug mode we will instead
  // attempt to cast the vframe to a javaVFrame and will
  // cause an assertion/crash to allow further diagnosis.
#ifdef PRODUCT
  if (!vf->is_java_frame()) {
    return JVMTI_ERROR_INTERNAL;
  }
#endif

  HandleMark hm(current_thread);
  javaVFrame *jvf = javaVFrame::cast(vf);
  Method* method = jvf->method();
  if (method->is_native()) {
    *location_ptr = -1;
  } else {
    *location_ptr = jvf->bci();
  }
  *method_ptr = method->jmethod_id();

  return JVMTI_ERROR_NONE;
}
开发者ID:shelan,项目名称:jdk9-mirror,代码行数:40,代码来源:jvmtiEnvBase.cpp


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