< prev index next >

src/hotspot/share/runtime/os.cpp

Print this page
rev 52360 : 8212605: Pure-Java implementation of AccessController.doPrivileged


  27 #include "classfile/classLoader.hpp"
  28 #include "classfile/javaClasses.hpp"
  29 #include "classfile/moduleEntry.hpp"
  30 #include "classfile/systemDictionary.hpp"
  31 #include "classfile/vmSymbols.hpp"
  32 #include "code/codeCache.hpp"
  33 #include "code/icBuffer.hpp"
  34 #include "code/vtableStubs.hpp"
  35 #include "gc/shared/vmGCOperations.hpp"
  36 #include "logging/log.hpp"
  37 #include "interpreter/interpreter.hpp"
  38 #include "logging/log.hpp"
  39 #include "logging/logStream.hpp"
  40 #include "memory/allocation.inline.hpp"
  41 #ifdef ASSERT
  42 #include "memory/guardedMemory.hpp"
  43 #endif
  44 #include "memory/resourceArea.hpp"
  45 #include "oops/oop.inline.hpp"
  46 #include "prims/jvm_misc.hpp"
  47 #include "prims/privilegedStack.hpp"
  48 #include "runtime/arguments.hpp"
  49 #include "runtime/atomic.hpp"
  50 #include "runtime/frame.inline.hpp"
  51 #include "runtime/interfaceSupport.inline.hpp"
  52 #include "runtime/java.hpp"
  53 #include "runtime/javaCalls.hpp"
  54 #include "runtime/mutexLocker.hpp"
  55 #include "runtime/os.inline.hpp"
  56 #include "runtime/sharedRuntime.hpp"
  57 #include "runtime/stubRoutines.hpp"
  58 #include "runtime/thread.inline.hpp"
  59 #include "runtime/threadSMR.hpp"
  60 #include "runtime/vm_version.hpp"
  61 #include "services/attachListener.hpp"
  62 #include "services/mallocTracker.hpp"
  63 #include "services/memTracker.hpp"
  64 #include "services/nmtCommon.hpp"
  65 #include "services/threadService.hpp"
  66 #include "utilities/align.hpp"
  67 #include "utilities/defaultStream.hpp"


1074   if (align_down((intptr_t)addr, sizeof(intptr_t)) != 0 && accessible) {
1075     if (JNIHandles::is_global_handle((jobject) addr)) {
1076       st->print_cr(INTPTR_FORMAT " is a global jni handle", p2i(addr));
1077       return;
1078     }
1079     if (JNIHandles::is_weak_global_handle((jobject) addr)) {
1080       st->print_cr(INTPTR_FORMAT " is a weak global jni handle", p2i(addr));
1081       return;
1082     }
1083 #ifndef PRODUCT
1084     // we don't keep the block list in product mode
1085     if (JNIHandles::is_local_handle((jobject) addr)) {
1086       st->print_cr(INTPTR_FORMAT " is a local jni handle", p2i(addr));
1087       return;
1088     }
1089 #endif
1090   }
1091 
1092   // Check if addr belongs to a Java thread.
1093   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
1094     // Check for privilege stack
1095     if (thread->privileged_stack_top() != NULL &&
1096         thread->privileged_stack_top()->contains(addr)) {
1097       st->print_cr(INTPTR_FORMAT " is pointing into the privilege stack "
1098                    "for thread: " INTPTR_FORMAT, p2i(addr), p2i(thread));
1099       if (verbose) thread->print_on(st);
1100       return;
1101     }
1102     // If the addr is a java thread print information about that.
1103     if (addr == (address)thread) {
1104       if (verbose) {
1105         thread->print_on(st);
1106       } else {
1107         st->print_cr(INTPTR_FORMAT " is a thread", p2i(addr));
1108       }
1109       return;
1110     }
1111     // If the addr is in the stack region for this thread then report that
1112     // and print thread info
1113     if (thread->on_local_stack(addr)) {
1114       st->print_cr(INTPTR_FORMAT " is pointing into the stack for thread: "
1115                    INTPTR_FORMAT, p2i(addr), p2i(thread));
1116       if (verbose) thread->print_on(st);
1117       return;
1118     }
1119   }
1120 
1121   // Check if in metaspace and print types that have vptrs




  27 #include "classfile/classLoader.hpp"
  28 #include "classfile/javaClasses.hpp"
  29 #include "classfile/moduleEntry.hpp"
  30 #include "classfile/systemDictionary.hpp"
  31 #include "classfile/vmSymbols.hpp"
  32 #include "code/codeCache.hpp"
  33 #include "code/icBuffer.hpp"
  34 #include "code/vtableStubs.hpp"
  35 #include "gc/shared/vmGCOperations.hpp"
  36 #include "logging/log.hpp"
  37 #include "interpreter/interpreter.hpp"
  38 #include "logging/log.hpp"
  39 #include "logging/logStream.hpp"
  40 #include "memory/allocation.inline.hpp"
  41 #ifdef ASSERT
  42 #include "memory/guardedMemory.hpp"
  43 #endif
  44 #include "memory/resourceArea.hpp"
  45 #include "oops/oop.inline.hpp"
  46 #include "prims/jvm_misc.hpp"

  47 #include "runtime/arguments.hpp"
  48 #include "runtime/atomic.hpp"
  49 #include "runtime/frame.inline.hpp"
  50 #include "runtime/interfaceSupport.inline.hpp"
  51 #include "runtime/java.hpp"
  52 #include "runtime/javaCalls.hpp"
  53 #include "runtime/mutexLocker.hpp"
  54 #include "runtime/os.inline.hpp"
  55 #include "runtime/sharedRuntime.hpp"
  56 #include "runtime/stubRoutines.hpp"
  57 #include "runtime/thread.inline.hpp"
  58 #include "runtime/threadSMR.hpp"
  59 #include "runtime/vm_version.hpp"
  60 #include "services/attachListener.hpp"
  61 #include "services/mallocTracker.hpp"
  62 #include "services/memTracker.hpp"
  63 #include "services/nmtCommon.hpp"
  64 #include "services/threadService.hpp"
  65 #include "utilities/align.hpp"
  66 #include "utilities/defaultStream.hpp"


1073   if (align_down((intptr_t)addr, sizeof(intptr_t)) != 0 && accessible) {
1074     if (JNIHandles::is_global_handle((jobject) addr)) {
1075       st->print_cr(INTPTR_FORMAT " is a global jni handle", p2i(addr));
1076       return;
1077     }
1078     if (JNIHandles::is_weak_global_handle((jobject) addr)) {
1079       st->print_cr(INTPTR_FORMAT " is a weak global jni handle", p2i(addr));
1080       return;
1081     }
1082 #ifndef PRODUCT
1083     // we don't keep the block list in product mode
1084     if (JNIHandles::is_local_handle((jobject) addr)) {
1085       st->print_cr(INTPTR_FORMAT " is a local jni handle", p2i(addr));
1086       return;
1087     }
1088 #endif
1089   }
1090 
1091   // Check if addr belongs to a Java thread.
1092   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {








1093     // If the addr is a java thread print information about that.
1094     if (addr == (address)thread) {
1095       if (verbose) {
1096         thread->print_on(st);
1097       } else {
1098         st->print_cr(INTPTR_FORMAT " is a thread", p2i(addr));
1099       }
1100       return;
1101     }
1102     // If the addr is in the stack region for this thread then report that
1103     // and print thread info
1104     if (thread->on_local_stack(addr)) {
1105       st->print_cr(INTPTR_FORMAT " is pointing into the stack for thread: "
1106                    INTPTR_FORMAT, p2i(addr), p2i(thread));
1107       if (verbose) thread->print_on(st);
1108       return;
1109     }
1110   }
1111 
1112   // Check if in metaspace and print types that have vptrs


< prev index next >