|
38 | 38 | #include "runtime/globals.hpp" |
39 | 39 | #include "runtime/handles.inline.hpp" |
40 | 40 | #include "runtime/javaCalls.hpp" |
| 41 | +#include "runtime/keepStackGCProcessed.hpp" |
41 | 42 | #include "runtime/stackWatermarkSet.hpp" |
42 | 43 | #include "runtime/thread.inline.hpp" |
43 | 44 | #include "runtime/vframe.inline.hpp" |
@@ -406,6 +407,7 @@ oop StackWalk::fetchFirstBatch(BaseFrameStream& stream, Handle stackStream, |
406 | 407 | int end_index = start_index; |
407 | 408 | int numFrames = 0; |
408 | 409 | if (!stream.at_end()) { |
| 410 | + KeepStackGCProcessedMark keep_stack(THREAD->as_Java_thread()); |
409 | 411 | numFrames = fill_in_frames(mode, stream, frame_count, start_index, |
410 | 412 | frames_array, end_index, CHECK_NULL); |
411 | 413 | if (numFrames < 1) { |
@@ -488,7 +490,7 @@ jint StackWalk::fetchNextBatch(Handle stackStream, jlong mode, jlong magic, |
488 | 490 | // an accurate hint suggesting the depth of the stack walk, and 2) we are not just |
489 | 491 | // peeking at a few frames. Take the cost of flushing out any pending deferred GC |
490 | 492 | // processing of the stack. |
491 | | - StackWatermarkSet::finish_processing(jt, NULL /* context */, StackWatermarkKind::gc); |
| 493 | + KeepStackGCProcessedMark keep_stack(jt); |
492 | 494 | stream.next(); // advance past the last frame decoded in previous batch |
493 | 495 | if (!stream.at_end()) { |
494 | 496 | int n = fill_in_frames(mode, stream, frame_count, start_index, |
|
0 commit comments