< prev index next >

src/hotspot/share/services/threadService.hpp

Print this page




 273 
 274   void            add_stack_frame(javaVFrame* jvf);
 275   void            dump_stack_at_safepoint(int max_depth);
 276   Handle          allocate_fill_stack_trace_element_array(TRAPS);
 277   void            oops_do(OopClosure* f);
 278   void            metadata_do(void f(Metadata*));
 279   GrowableArray<oop>* jni_locked_monitors() { return _jni_locked_monitors; }
 280   int             num_jni_locked_monitors() { return (_jni_locked_monitors != NULL ? _jni_locked_monitors->length() : 0); }
 281 
 282   bool            is_owned_monitor_on_stack(oop object);
 283   void            add_jni_locked_monitor(oop object) { _jni_locked_monitors->append(object); }
 284 };
 285 
 286 // StackFrameInfo for keeping Method* and bci during
 287 // stack walking for later construction of StackTraceElement[]
 288 // Java instances
 289 class StackFrameInfo : public CHeapObj<mtInternal> {
 290  private:
 291   Method*             _method;
 292   int                 _bci;

 293   GrowableArray<oop>* _locked_monitors; // list of object monitors locked by this frame
 294   // We need to save the mirrors in the backtrace to keep the class
 295   // from being unloaded while we still have this stack trace.
 296   oop                 _class_holder;
 297 
 298  public:
 299 
 300   StackFrameInfo(javaVFrame* jvf, bool with_locked_monitors);
 301   ~StackFrameInfo() {
 302     if (_locked_monitors != NULL) {
 303       delete _locked_monitors;
 304     }
 305   };
 306   Method*   method() const       { return _method; }
 307   int       bci()    const       { return _bci; }

 308   void      oops_do(OopClosure* f);
 309   void      metadata_do(void f(Metadata*));
 310 
 311   int       num_locked_monitors()       { return (_locked_monitors != NULL ? _locked_monitors->length() : 0); }
 312   GrowableArray<oop>* locked_monitors() { return _locked_monitors; }
 313 
 314   void      print_on(outputStream* st) const;
 315 };
 316 
 317 class ThreadConcurrentLocks : public CHeapObj<mtInternal> {
 318 private:
 319   GrowableArray<instanceOop>* _owned_locks;
 320   ThreadConcurrentLocks*      _next;
 321   // This JavaThread* is protected in one of two different ways
 322   // depending on the usage of the ThreadConcurrentLocks object:
 323   // 1) by being stored in objects that are only allocated and used at a
 324   // safepoint (ConcurrentLocksDump), or 2) by being stored in objects
 325   // that are protected by a ThreadsListSetter (ThreadSnapshot inside
 326   // ThreadDumpResult).
 327   JavaThread*                 _thread;




 273 
 274   void            add_stack_frame(javaVFrame* jvf);
 275   void            dump_stack_at_safepoint(int max_depth);
 276   Handle          allocate_fill_stack_trace_element_array(TRAPS);
 277   void            oops_do(OopClosure* f);
 278   void            metadata_do(void f(Metadata*));
 279   GrowableArray<oop>* jni_locked_monitors() { return _jni_locked_monitors; }
 280   int             num_jni_locked_monitors() { return (_jni_locked_monitors != NULL ? _jni_locked_monitors->length() : 0); }
 281 
 282   bool            is_owned_monitor_on_stack(oop object);
 283   void            add_jni_locked_monitor(oop object) { _jni_locked_monitors->append(object); }
 284 };
 285 
 286 // StackFrameInfo for keeping Method* and bci during
 287 // stack walking for later construction of StackTraceElement[]
 288 // Java instances
 289 class StackFrameInfo : public CHeapObj<mtInternal> {
 290  private:
 291   Method*             _method;
 292   int                 _bci;
 293   oop                 _cont_scope_name;
 294   GrowableArray<oop>* _locked_monitors; // list of object monitors locked by this frame
 295   // We need to save the mirrors in the backtrace to keep the class
 296   // from being unloaded while we still have this stack trace.
 297   oop                 _class_holder;
 298 
 299  public:
 300 
 301   StackFrameInfo(javaVFrame* jvf, bool with_locked_monitors);
 302   ~StackFrameInfo() {
 303     if (_locked_monitors != NULL) {
 304       delete _locked_monitors;
 305     }
 306   };
 307   Method*   method() const          { return _method; }
 308   int       bci()    const          { return _bci; }
 309   oop       cont_scope_name() const { return _cont_scope_name; }
 310   void      oops_do(OopClosure* f);
 311   void      metadata_do(void f(Metadata*));
 312 
 313   int       num_locked_monitors()       { return (_locked_monitors != NULL ? _locked_monitors->length() : 0); }
 314   GrowableArray<oop>* locked_monitors() { return _locked_monitors; }
 315 
 316   void      print_on(outputStream* st) const;
 317 };
 318 
 319 class ThreadConcurrentLocks : public CHeapObj<mtInternal> {
 320 private:
 321   GrowableArray<instanceOop>* _owned_locks;
 322   ThreadConcurrentLocks*      _next;
 323   // This JavaThread* is protected in one of two different ways
 324   // depending on the usage of the ThreadConcurrentLocks object:
 325   // 1) by being stored in objects that are only allocated and used at a
 326   // safepoint (ConcurrentLocksDump), or 2) by being stored in objects
 327   // that are protected by a ThreadsListSetter (ThreadSnapshot inside
 328   // ThreadDumpResult).
 329   JavaThread*                 _thread;


< prev index next >