< prev index next >

src/share/vm/prims/jniCheck.cpp

Print this page




  35 #include "runtime/fieldDescriptor.hpp"
  36 #include "runtime/handles.hpp"
  37 #include "runtime/interfaceSupport.hpp"
  38 #include "runtime/jfieldIDWorkaround.hpp"
  39 #include "runtime/thread.inline.hpp"
  40 #ifdef TARGET_ARCH_x86
  41 # include "jniTypes_x86.hpp"
  42 #endif
  43 #ifdef TARGET_ARCH_sparc
  44 # include "jniTypes_sparc.hpp"
  45 #endif
  46 #ifdef TARGET_ARCH_zero
  47 # include "jniTypes_zero.hpp"
  48 #endif
  49 #ifdef TARGET_ARCH_arm
  50 # include "jniTypes_arm.hpp"
  51 #endif
  52 #ifdef TARGET_ARCH_ppc
  53 # include "jniTypes_ppc.hpp"
  54 #endif



  55 
  56 // Complain every extra number of unplanned local refs
  57 #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32
  58 
  59 // Heap objects are allowed to be directly referenced only in VM code,
  60 // not in native code.
  61 
  62 #define ASSERT_OOPS_ALLOWED                                          \
  63     assert(JavaThread::current()->thread_state() == _thread_in_vm,   \
  64            "jniCheck examining oops in bad state.")
  65 
  66 
  67 // Execute the given block of source code with the thread in VM state.
  68 // To do this, transition from the NATIVE state to the VM state, execute
  69 // the code, and transtition back.  The ThreadInVMfromNative constructor
  70 // performs the transition to VM state, its destructor restores the
  71 // NATIVE state.
  72 
  73 #define IN_VM(source_code)   {                                         \
  74     {                                                                  \




  35 #include "runtime/fieldDescriptor.hpp"
  36 #include "runtime/handles.hpp"
  37 #include "runtime/interfaceSupport.hpp"
  38 #include "runtime/jfieldIDWorkaround.hpp"
  39 #include "runtime/thread.inline.hpp"
  40 #ifdef TARGET_ARCH_x86
  41 # include "jniTypes_x86.hpp"
  42 #endif
  43 #ifdef TARGET_ARCH_sparc
  44 # include "jniTypes_sparc.hpp"
  45 #endif
  46 #ifdef TARGET_ARCH_zero
  47 # include "jniTypes_zero.hpp"
  48 #endif
  49 #ifdef TARGET_ARCH_arm
  50 # include "jniTypes_arm.hpp"
  51 #endif
  52 #ifdef TARGET_ARCH_ppc
  53 # include "jniTypes_ppc.hpp"
  54 #endif
  55 #ifdef TARGET_ARCH_aarch32
  56 # include "jniTypes_aarch32.hpp"
  57 #endif
  58 
  59 // Complain every extra number of unplanned local refs
  60 #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32
  61 
  62 // Heap objects are allowed to be directly referenced only in VM code,
  63 // not in native code.
  64 
  65 #define ASSERT_OOPS_ALLOWED                                          \
  66     assert(JavaThread::current()->thread_state() == _thread_in_vm,   \
  67            "jniCheck examining oops in bad state.")
  68 
  69 
  70 // Execute the given block of source code with the thread in VM state.
  71 // To do this, transition from the NATIVE state to the VM state, execute
  72 // the code, and transtition back.  The ThreadInVMfromNative constructor
  73 // performs the transition to VM state, its destructor restores the
  74 // NATIVE state.
  75 
  76 #define IN_VM(source_code)   {                                         \
  77     {                                                                  \


< prev index next >