hotspot/src/share/vm/runtime/thread.cpp
changeset 10517 f92c9ff3a15f
parent 10508 233d2e7c462d
child 10546 e79347eebbc5
equal deleted inserted replaced
10516:2797e487c09f 10517:f92c9ff3a15f
  2857     fst.current()->print_value_on(tty,this);
  2857     fst.current()->print_value_on(tty,this);
  2858     tty->cr();
  2858     tty->cr();
  2859   }
  2859   }
  2860 }
  2860 }
  2861 
  2861 
       
  2862 class PrintAndVerifyOopClosure: public OopClosure {
       
  2863  protected:
       
  2864   template <class T> inline void do_oop_work(T* p) {
       
  2865     oop obj = oopDesc::load_decode_heap_oop(p);
       
  2866     if (obj == NULL) return;
       
  2867     tty->print(INTPTR_FORMAT ": ", p);
       
  2868     if (obj->is_oop_or_null()) {
       
  2869       if (obj->is_objArray()) {
       
  2870         tty->print_cr("valid objArray: " INTPTR_FORMAT, (oopDesc*) obj);
       
  2871       } else {
       
  2872         obj->print();
       
  2873       }
       
  2874     } else {
       
  2875       tty->print_cr("invalid oop: " INTPTR_FORMAT, (oopDesc*) obj);
       
  2876     }
       
  2877     tty->cr();
       
  2878   }
       
  2879  public:
       
  2880   virtual void do_oop(oop* p) { do_oop_work(p); }
       
  2881   virtual void do_oop(narrowOop* p)  { do_oop_work(p); }
       
  2882 };
       
  2883 
       
  2884 
       
  2885 static void oops_print(frame* f, const RegisterMap *map) {
       
  2886   PrintAndVerifyOopClosure print;
       
  2887   f->print_value();
       
  2888   f->oops_do(&print, NULL, (RegisterMap*)map);
       
  2889 }
       
  2890 
       
  2891 // Print our all the locations that contain oops and whether they are
       
  2892 // valid or not.  This useful when trying to find the oldest frame
       
  2893 // where an oop has gone bad since the frame walk is from youngest to
       
  2894 // oldest.
       
  2895 void JavaThread::trace_oops() {
       
  2896   tty->print_cr("[Trace oops]");
       
  2897   frames_do(oops_print);
       
  2898 }
       
  2899 
  2862 
  2900 
  2863 #ifdef ASSERT
  2901 #ifdef ASSERT
  2864 // Print or validate the layout of stack frames
  2902 // Print or validate the layout of stack frames
  2865 void JavaThread::print_frame_layout(int depth, bool validate_only) {
  2903 void JavaThread::print_frame_layout(int depth, bool validate_only) {
  2866   ResourceMark rm;
  2904   ResourceMark rm;