8315413: Remove special filtering of Continuation.yield0 in StackWalker

Reviewed-by: alanb
This commit is contained in:
Mandy Chung 2023-08-31 16:11:03 +00:00
parent ea5aa61c8c
commit c8acab1d91
4 changed files with 9 additions and 33 deletions

View file

@ -543,12 +543,6 @@ final class StackStreamFactory {
final Class<?> at(int index) {
return stackFrames[index].declaringClass();
}
@Override
final boolean filter(int index) {
return stackFrames[index].declaringClass() == Continuation.class
&& "yield0".equals(stackFrames[index].getMethodName());
}
}
final Function<? super Stream<StackFrame>, ? extends T> function; // callback
@ -685,10 +679,6 @@ final class StackStreamFactory {
@Override
final Class<?> at(int index) { return classes[index];}
@Override
final boolean filter(int index) { return false; }
// ------ subclass may override the following methods -------
/**
* Resizes the buffers for VM to fill in the next batch of stack frames.
@ -820,12 +810,6 @@ final class StackStreamFactory {
final Class<?> at(int index) {
return stackFrames[index].declaringClass();
}
@Override
final boolean filter(int index) {
return stackFrames[index].declaringClass() == Continuation.class
&& "yield0".equals(stackFrames[index].getMethodName());
}
}
LiveStackInfoTraverser(StackWalker walker,
@ -895,13 +879,6 @@ final class StackStreamFactory {
*/
abstract Class<?> at(int index);
/**
* Filter out frames at the top of a batch
* @param index the position of the frame.
* @return true if the frame should be skipped
*/
abstract boolean filter(int index);
// ------ subclass may override the following methods -------
/*
@ -1007,8 +984,7 @@ final class StackStreamFactory {
this.fence = endIndex;
for (int i = START_POS; i < fence; i++) {
if (isDebug) System.err.format(" frame %d: %s%n", i, at(i));
if ((depth == 0 && filterStackWalkImpl(at(i))) // filter the frames due to the stack stream implementation
|| filter(i)) {
if (depth == 0 && filterStackWalkImpl(at(i))) { // filter the frames due to the stack stream implementation
origin++;
} else {
break;