499 // A collection of described stack values that can print a symbolic
500 // description of the stack memory. Interpreter frame values can be
501 // in the caller frames so all the values are collected first and then
502 // sorted before being printed.
503 class FrameValues {
504 private:
505 GrowableArray<FrameValue> _values;
506
507 static int compare(FrameValue* a, FrameValue* b) {
508 if (a->location == b->location) {
509 return a->priority - b->priority;
510 }
511 return a->location - b->location;
512 }
513
514 public:
515 // Used by frame functions to describe locations.
516 void describe(int owner, intptr_t* location, const char* description, int priority = 0);
517
518 void validate();
519 void print();
520 };
521
522 #endif
523
524 //
525 // StackFrameStream iterates through the frames of a thread starting from
526 // top most frame. It automatically takes care of updating the location of
527 // all (callee-saved) registers. Notice: If a thread is stopped at
528 // a safepoint, all registers are saved, not only the callee-saved ones.
529 //
530 // Use:
531 //
532 // for(StackFrameStream fst(thread); !fst.is_done(); fst.next()) {
533 // ...
534 // }
535 //
536 class StackFrameStream : public StackObj {
537 private:
538 frame _fr;
539 RegisterMap _reg_map;
|
499 // A collection of described stack values that can print a symbolic
500 // description of the stack memory. Interpreter frame values can be
501 // in the caller frames so all the values are collected first and then
502 // sorted before being printed.
503 class FrameValues {
504 private:
505 GrowableArray<FrameValue> _values;
506
507 static int compare(FrameValue* a, FrameValue* b) {
508 if (a->location == b->location) {
509 return a->priority - b->priority;
510 }
511 return a->location - b->location;
512 }
513
514 public:
515 // Used by frame functions to describe locations.
516 void describe(int owner, intptr_t* location, const char* description, int priority = 0);
517
518 void validate();
519 void print(JavaThread* thread);
520 };
521
522 #endif
523
524 //
525 // StackFrameStream iterates through the frames of a thread starting from
526 // top most frame. It automatically takes care of updating the location of
527 // all (callee-saved) registers. Notice: If a thread is stopped at
528 // a safepoint, all registers are saved, not only the callee-saved ones.
529 //
530 // Use:
531 //
532 // for(StackFrameStream fst(thread); !fst.is_done(); fst.next()) {
533 // ...
534 // }
535 //
536 class StackFrameStream : public StackObj {
537 private:
538 frame _fr;
539 RegisterMap _reg_map;
|