25 import jdk.vm.ci.meta.ResolvedJavaMethod; |
25 import jdk.vm.ci.meta.ResolvedJavaMethod; |
26 |
26 |
27 public interface StackIntrospection { |
27 public interface StackIntrospection { |
28 |
28 |
29 /** |
29 /** |
30 * Accesses the current stack, providing {@link InspectedFrame}s to the visitor that can be used |
30 * Walks the current stack, providing {@link InspectedFrame}s to the visitor that can be used to |
31 * to inspect the stack frames' contents. Iteration continues as long as |
31 * inspect the stack frame's contents. Iteration continues as long as |
32 * {@link InspectedFrameVisitor#visitFrame}, which is invoked for every {@link InspectedFrame}, |
32 * {@link InspectedFrameVisitor#visitFrame}, which is invoked for every {@link InspectedFrame}, |
33 * returns null. Any non-null result of the visitor indicates that frame iteration should stop. |
33 * returns {@code null}. A non-null return value from {@link InspectedFrameVisitor#visitFrame} |
|
34 * indicates that frame iteration should stop. |
34 * |
35 * |
35 * @param initialMethods if this is non-{@code null}, then the stack trace will start at these |
36 * @param initialMethods if this is non-{@code null}, then the stack walk will start at the |
36 * methods |
37 * first frame whose method is one of these methods. |
37 * @param matchingMethods if this is non-{@code null}, then only matching stack frames are |
38 * @param matchingMethods if this is non-{@code null}, then only frames whose methods are in |
38 * returned |
39 * this array are visited |
39 * @param initialSkip the number of matching methods to skip (including the initial method) |
40 * @param initialSkip the number of matching methods to skip (including the initial method) |
40 * @param visitor the visitor that is called for every matching method |
41 * @param visitor the visitor that is called for every matching method |
41 * @return the last result returned by the visitor (which is non-null to indicate that iteration |
42 * @return the last result returned by the visitor (which is non-null to indicate that iteration |
42 * should stop), or null if the whole stack was iterated. |
43 * should stop), or null if the whole stack was iterated. |
43 */ |
44 */ |