43 : _thread(thread), _vfst(thread), _anchor(0L) {} |
43 : _thread(thread), _vfst(thread), _anchor(0L) {} |
44 |
44 |
45 vframeStream& vframe_stream() { return _vfst; } |
45 vframeStream& vframe_stream() { return _vfst; } |
46 JavaThread* thread() { return _thread; } |
46 JavaThread* thread() { return _thread; } |
47 |
47 |
48 void setup_magic_on_entry(objArrayHandle classes_array); |
48 void setup_magic_on_entry(objArrayHandle frames_array); |
49 bool check_magic(objArrayHandle classes_array); |
49 bool check_magic(objArrayHandle frames_array); |
50 bool cleanup_magic_on_exit(objArrayHandle classes_array); |
50 bool cleanup_magic_on_exit(objArrayHandle frames_array); |
51 |
51 |
52 bool is_valid_in(Thread* thread, objArrayHandle classes_array) { |
52 bool is_valid_in(Thread* thread, objArrayHandle frames_array) { |
53 return (_thread == thread && check_magic(classes_array)); |
53 return (_thread == thread && check_magic(frames_array)); |
54 } |
54 } |
55 |
55 |
56 jlong address_value() { |
56 jlong address_value() { |
57 return (jlong) castable_address(this); |
57 return (jlong) castable_address(this); |
58 } |
58 } |
62 |
62 |
63 class StackWalk : public AllStatic { |
63 class StackWalk : public AllStatic { |
64 private: |
64 private: |
65 static int fill_in_frames(jlong mode, vframeStream& vfst, |
65 static int fill_in_frames(jlong mode, vframeStream& vfst, |
66 int max_nframes, int start_index, |
66 int max_nframes, int start_index, |
67 objArrayHandle classes_array, |
|
68 objArrayHandle frames_array, |
67 objArrayHandle frames_array, |
69 int& end_index, TRAPS); |
68 int& end_index, TRAPS); |
70 |
69 |
71 static void fill_stackframe(Handle stackFrame, const methodHandle& method, int bci); |
70 static void fill_stackframe(Handle stackFrame, const methodHandle& method, int bci); |
72 |
71 |
80 return (mode & JVM_STACKWALK_FILL_CLASS_REFS_ONLY) == 0; |
79 return (mode & JVM_STACKWALK_FILL_CLASS_REFS_ONLY) == 0; |
81 } |
80 } |
82 static inline bool live_frame_info(int mode) { |
81 static inline bool live_frame_info(int mode) { |
83 return (mode & JVM_STACKWALK_FILL_LIVE_STACK_FRAMES) != 0; |
82 return (mode & JVM_STACKWALK_FILL_LIVE_STACK_FRAMES) != 0; |
84 } |
83 } |
85 static inline bool fill_in_stacktrace(int mode) { |
|
86 return (mode & JVM_STACKWALK_FILTER_FILL_IN_STACK_TRACE) != 0; |
|
87 } |
|
88 |
84 |
89 public: |
85 public: |
|
86 static inline bool use_frames_array(int mode) { |
|
87 return (mode & JVM_STACKWALK_FILL_CLASS_REFS_ONLY) == 0; |
|
88 } |
90 static oop walk(Handle stackStream, jlong mode, |
89 static oop walk(Handle stackStream, jlong mode, |
91 int skip_frames, int frame_count, int start_index, |
90 int skip_frames, int frame_count, int start_index, |
92 objArrayHandle classes_array, |
|
93 objArrayHandle frames_array, |
91 objArrayHandle frames_array, |
94 TRAPS); |
92 TRAPS); |
95 |
93 |
96 static jint moreFrames(Handle stackStream, jlong mode, jlong magic, |
94 static jint moreFrames(Handle stackStream, jlong mode, jlong magic, |
97 int frame_count, int start_index, |
95 int frame_count, int start_index, |
98 objArrayHandle classes_array, |
|
99 objArrayHandle frames_array, |
96 objArrayHandle frames_array, |
100 TRAPS); |
97 TRAPS); |
101 }; |
98 }; |
102 #endif // SHARE_VM_PRIMS_STACKWALK_HPP |
99 #endif // SHARE_VM_PRIMS_STACKWALK_HPP |