< prev index next >

src/hotspot/share/services/threadService.cpp

Print this page
*** 1480,11 ***
  
    // StackTrace
    InstanceKlass* ste_klass = vmClasses::StackTraceElement_klass();
    assert(ste_klass != nullptr, "must be loaded");
  
!   objArrayHandle trace = oopFactory::new_objArray_handle(ste_klass, cl._frame_count, CHECK_NULL);
  
    for (int i = 0; i < cl._frame_count; i++) {
      methodHandle method(THREAD, cl._methods->at(i));
      oop element = java_lang_StackTraceElement::create(method, cl._bcis->at(i), CHECK_NULL);
      trace->obj_at_put(i, element);
--- 1480,11 ---
  
    // StackTrace
    InstanceKlass* ste_klass = vmClasses::StackTraceElement_klass();
    assert(ste_klass != nullptr, "must be loaded");
  
!   refArrayHandle trace = oopFactory::new_refArray_handle(ste_klass, cl._frame_count, CHECK_NULL);
  
    for (int i = 0; i < cl._frame_count; i++) {
      methodHandle method(THREAD, cl._methods->at(i));
      oop element = java_lang_StackTraceElement::create(method, cl._bcis->at(i), CHECK_NULL);
      trace->obj_at_put(i, element);

*** 1493,13 ***
    // Locks
    Symbol* lock_sym = vmSymbols::jdk_internal_vm_ThreadLock();
    Klass* lock_k = SystemDictionary::resolve_or_fail(lock_sym, true, CHECK_NULL);
    InstanceKlass* lock_klass = InstanceKlass::cast(lock_k);
  
!   objArrayHandle locks;
    if (cl._locks != nullptr && cl._locks->length() > 0) {
!     locks = oopFactory::new_objArray_handle(lock_klass, cl._locks->length(), CHECK_NULL);
      for (int n = 0; n < cl._locks->length(); n++) {
        GetThreadSnapshotHandshakeClosure::OwnedLock* lock_info = cl._locks->adr_at(n);
  
        Handle lock = jdk_internal_vm_ThreadLock::create(lock_klass,
          lock_info->_frame_depth, lock_info->_type, lock_info->_obj, CHECK_NULL);
--- 1493,13 ---
    // Locks
    Symbol* lock_sym = vmSymbols::jdk_internal_vm_ThreadLock();
    Klass* lock_k = SystemDictionary::resolve_or_fail(lock_sym, true, CHECK_NULL);
    InstanceKlass* lock_klass = InstanceKlass::cast(lock_k);
  
!   refArrayHandle locks;
    if (cl._locks != nullptr && cl._locks->length() > 0) {
!     locks = oopFactory::new_refArray_handle(lock_klass, cl._locks->length(), CHECK_NULL);
      for (int n = 0; n < cl._locks->length(); n++) {
        GetThreadSnapshotHandshakeClosure::OwnedLock* lock_info = cl._locks->adr_at(n);
  
        Handle lock = jdk_internal_vm_ThreadLock::create(lock_klass,
          lock_info->_frame_depth, lock_info->_type, lock_info->_obj, CHECK_NULL);
< prev index next >