< prev index next >

src/hotspot/share/runtime/stackFrameStream.hpp

Print this page

39 // onto exposed frames, such that all oops are valid iff the process_frames
40 // flag is set.
41 //
42 // Notice: If a thread is stopped at a safepoint, all registers are saved,
43 // not only the callee-saved ones.
44 //
45 // Use:
46 //
47 //   for(StackFrameStream fst(thread, true /* update */, true /* process_frames */);
48 //       !fst.is_done();
49 //       fst.next()) {
50 //     ...
51 //   }
52 //
53 class StackFrameStream : public StackObj {
54  private:
55   frame       _fr;
56   RegisterMap _reg_map;
57   bool        _is_done;
58  public:
59   StackFrameStream(JavaThread *thread, bool update, bool process_frames);
60 
61   // Iteration
62   inline bool is_done();
63   void next()                     { if (!_is_done) _fr = _fr.sender(&_reg_map); }
64 
65   // Query
66   frame *current()                { return &_fr; }
67   RegisterMap* register_map()     { return &_reg_map; }
68 };
69 
70 #endif // SHARE_RUNTIME_STACKFRAMESTREAM_HPP
71 
72 

39 // onto exposed frames, such that all oops are valid iff the process_frames
40 // flag is set.
41 //
42 // Notice: If a thread is stopped at a safepoint, all registers are saved,
43 // not only the callee-saved ones.
44 //
45 // Use:
46 //
47 //   for(StackFrameStream fst(thread, true /* update */, true /* process_frames */);
48 //       !fst.is_done();
49 //       fst.next()) {
50 //     ...
51 //   }
52 //
53 class StackFrameStream : public StackObj {
54  private:
55   frame       _fr;
56   RegisterMap _reg_map;
57   bool        _is_done;
58  public:
59   StackFrameStream(JavaThread *thread, bool update, bool process_frames, bool allow_missing_reg = false);
60 
61   // Iteration
62   inline bool is_done();
63   void next()                     { if (!_is_done) _fr = _fr.sender(&_reg_map); }
64 
65   // Query
66   frame *current()                { return &_fr; }
67   RegisterMap* register_map()     { return &_reg_map; }
68 };
69 
70 #endif // SHARE_RUNTIME_STACKFRAMESTREAM_HPP
71 
72 
< prev index next >