Skip to content
Permalink
Browse files
8261448: Preserve GC stack watermark across safepoints in StackWalk
Reviewed-by: eosterlund, stefank
  • Loading branch information
rkennke committed Feb 22, 2021
1 parent 26c1db9 commit c20fb5db9037b5e4542cf18156f05a05fb8f2931
Showing 1 changed file with 3 additions and 1 deletion.
@@ -38,6 +38,7 @@
#include "runtime/globals.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/keepStackGCProcessed.hpp"
#include "runtime/stackWatermarkSet.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/vframe.inline.hpp"
@@ -406,6 +407,7 @@ oop StackWalk::fetchFirstBatch(BaseFrameStream& stream, Handle stackStream,
int end_index = start_index;
int numFrames = 0;
if (!stream.at_end()) {
KeepStackGCProcessedMark keep_stack(THREAD->as_Java_thread());
numFrames = fill_in_frames(mode, stream, frame_count, start_index,
frames_array, end_index, CHECK_NULL);
if (numFrames < 1) {
@@ -488,7 +490,7 @@ jint StackWalk::fetchNextBatch(Handle stackStream, jlong mode, jlong magic,
// an accurate hint suggesting the depth of the stack walk, and 2) we are not just
// peeking at a few frames. Take the cost of flushing out any pending deferred GC
// processing of the stack.
StackWatermarkSet::finish_processing(jt, NULL /* context */, StackWatermarkKind::gc);
KeepStackGCProcessedMark keep_stack(jt);
stream.next(); // advance past the last frame decoded in previous batch
if (!stream.at_end()) {
int n = fill_in_frames(mode, stream, frame_count, start_index,

1 comment on commit c20fb5d

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on c20fb5d Feb 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.