< prev index next >

src/share/vm/runtime/jniHandles.hpp

Print this page




  69 
  70   // Initialization
  71   static void initialize();
  72 
  73   // Debugging
  74   static void print_on(outputStream* st);
  75   static void print()           { print_on(tty); }
  76   static void verify();
  77   static bool is_local_handle(Thread* thread, jobject handle);
  78   static bool is_frame_handle(JavaThread* thr, jobject obj);
  79   static bool is_global_handle(jobject handle);
  80   static bool is_weak_global_handle(jobject handle);
  81   static long global_handle_memory_usage();
  82   static long weak_global_handle_memory_usage();
  83 
  84   // Garbage collection support(global handles only, local handles are traversed from thread)
  85   // Traversal of regular global handles
  86   static void oops_do(OopClosure* f);
  87   // Traversal of weak global handles. Unreachable oops are cleared.
  88   static void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);


  89 };
  90 
  91 
  92 
  93 // JNI handle blocks holding local/global JNI handles
  94 
  95 class JNIHandleBlock : public CHeapObj<mtInternal> {
  96   friend class VMStructs;
  97   friend class CppInterpreter;
  98 
  99  private:
 100   enum SomeConstants {
 101     block_size_in_oops  = 32                    // Number of handles per handle block
 102   };
 103 
 104   oop             _handles[block_size_in_oops]; // The handles
 105   int             _top;                         // Index of next unused handle
 106   JNIHandleBlock* _next;                        // Link to next block
 107 
 108   // The following instance variables are only used by the first block in a chain.




  69 
  70   // Initialization
  71   static void initialize();
  72 
  73   // Debugging
  74   static void print_on(outputStream* st);
  75   static void print()           { print_on(tty); }
  76   static void verify();
  77   static bool is_local_handle(Thread* thread, jobject handle);
  78   static bool is_frame_handle(JavaThread* thr, jobject obj);
  79   static bool is_global_handle(jobject handle);
  80   static bool is_weak_global_handle(jobject handle);
  81   static long global_handle_memory_usage();
  82   static long weak_global_handle_memory_usage();
  83 
  84   // Garbage collection support(global handles only, local handles are traversed from thread)
  85   // Traversal of regular global handles
  86   static void oops_do(OopClosure* f);
  87   // Traversal of weak global handles. Unreachable oops are cleared.
  88   static void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f);
  89   // Traversal of weak global handles.
  90   static void weak_oops_do(OopClosure* f);
  91 };
  92 
  93 
  94 
  95 // JNI handle blocks holding local/global JNI handles
  96 
  97 class JNIHandleBlock : public CHeapObj<mtInternal> {
  98   friend class VMStructs;
  99   friend class CppInterpreter;
 100 
 101  private:
 102   enum SomeConstants {
 103     block_size_in_oops  = 32                    // Number of handles per handle block
 104   };
 105 
 106   oop             _handles[block_size_in_oops]; // The handles
 107   int             _top;                         // Index of next unused handle
 108   JNIHandleBlock* _next;                        // Link to next block
 109 
 110   // The following instance variables are only used by the first block in a chain.


< prev index next >