3170 }
3171
3172 #ifndef PRODUCT
3173
3174 void JavaThread::trace_frames() {
3175 tty->print_cr("[Describe stack]");
3176 int frame_no = 1;
3177 for (StackFrameStream fst(this); !fst.is_done(); fst.next()) {
3178 tty->print(" %d. ", frame_no++);
3179 fst.current()->print_value_on(tty, this);
3180 tty->cr();
3181 }
3182 }
3183
3184 class PrintAndVerifyOopClosure: public OopClosure {
3185 protected:
3186 template <class T> inline void do_oop_work(T* p) {
3187 oop obj = oopDesc::load_decode_heap_oop(p);
3188 if (obj == NULL) return;
3189 tty->print(INTPTR_FORMAT ": ", p2i(p));
3190 if (obj->is_oop_or_null()) {
3191 if (obj->is_objArray()) {
3192 tty->print_cr("valid objArray: " INTPTR_FORMAT, p2i(obj));
3193 } else {
3194 obj->print();
3195 }
3196 } else {
3197 tty->print_cr("invalid oop: " INTPTR_FORMAT, p2i(obj));
3198 }
3199 tty->cr();
3200 }
3201 public:
3202 virtual void do_oop(oop* p) { do_oop_work(p); }
3203 virtual void do_oop(narrowOop* p) { do_oop_work(p); }
3204 };
3205
3206
3207 static void oops_print(frame* f, const RegisterMap *map) {
3208 PrintAndVerifyOopClosure print;
3209 f->print_value();
3210 f->oops_do(&print, NULL, (RegisterMap*)map);
|
3170 }
3171
3172 #ifndef PRODUCT
3173
3174 void JavaThread::trace_frames() {
3175 tty->print_cr("[Describe stack]");
3176 int frame_no = 1;
3177 for (StackFrameStream fst(this); !fst.is_done(); fst.next()) {
3178 tty->print(" %d. ", frame_no++);
3179 fst.current()->print_value_on(tty, this);
3180 tty->cr();
3181 }
3182 }
3183
3184 class PrintAndVerifyOopClosure: public OopClosure {
3185 protected:
3186 template <class T> inline void do_oop_work(T* p) {
3187 oop obj = oopDesc::load_decode_heap_oop(p);
3188 if (obj == NULL) return;
3189 tty->print(INTPTR_FORMAT ": ", p2i(p));
3190 if (oopDesc::is_oop_or_null(obj)) {
3191 if (obj->is_objArray()) {
3192 tty->print_cr("valid objArray: " INTPTR_FORMAT, p2i(obj));
3193 } else {
3194 obj->print();
3195 }
3196 } else {
3197 tty->print_cr("invalid oop: " INTPTR_FORMAT, p2i(obj));
3198 }
3199 tty->cr();
3200 }
3201 public:
3202 virtual void do_oop(oop* p) { do_oop_work(p); }
3203 virtual void do_oop(narrowOop* p) { do_oop_work(p); }
3204 };
3205
3206
3207 static void oops_print(frame* f, const RegisterMap *map) {
3208 PrintAndVerifyOopClosure print;
3209 f->print_value();
3210 f->oops_do(&print, NULL, (RegisterMap*)map);
|