use of jdk.vm.ci.code.stack.StackIntrospection in project graal by oracle.
the class SubstrateInspectedFrame method iterateFrames.
@NeverInline("Stack walking starts at the physical caller frame of this method")
@Override
public <T> T iterateFrames(ResolvedJavaMethod[] initialMethods, ResolvedJavaMethod[] matchingMethods, int initialSkip, InspectedFrameVisitor<T> visitor) {
if (SubstrateUtil.HOSTED) {
/*
* During native-image generation we use HotSpotStackIntrospection to iterate frames.
* `initialMethods` and `matchingMethods` are hosted versions of `ResolvedJavaMethod`
* that we provide them in `SubstrateTruffleRuntime`.
*/
StackIntrospection hostedStackIntrospection = JVMCI.getRuntime().getHostJVMCIBackend().getStackIntrospection();
return hostedStackIntrospection.iterateFrames(initialMethods, matchingMethods, initialSkip, visitor);
}
/* Stack walking starts at the physical caller frame of this method. */
Pointer startSP = KnownIntrinsics.readCallerStackPointer();
CodePointer startIP = KnownIntrinsics.readReturnAddress();
PhysicalStackFrameVisitor<T> physicalFrameVisitor = new PhysicalStackFrameVisitor<>(initialMethods, matchingMethods, initialSkip, visitor);
JavaStackWalker.walkCurrentThread(startSP, startIP, physicalFrameVisitor);
return physicalFrameVisitor.result;
}
Aggregations