Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLStackTraceBuiltin.java @ 16529:f6ac86d3334e
Change API for stack walking to a visitor: TruffleRuntime#iterateFrames replaces TruffleRuntime#getStackTrace
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Tue, 15 Jul 2014 16:34:53 -0700 |
parents | a3b0ecef8a15 |
children | fb1c21844758 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLStackTraceBuiltin.java Tue Jul 15 15:49:12 2014 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLStackTraceBuiltin.java Tue Jul 15 16:34:53 2014 -0700 @@ -45,13 +45,11 @@ @SlowPath private static String createStackTrace() { StringBuilder str = new StringBuilder(); - Iterable<FrameInstance> frames = Truffle.getRuntime().getStackTrace(); - if (frames != null) { - for (FrameInstance frame : frames) { - dumpFrame(str, frame.getCallTarget(), frame.getFrame(FrameAccess.READ_ONLY, true), frame.isVirtualFrame()); - } - } + Truffle.getRuntime().iterateFrames(frameInstance -> { + dumpFrame(str, frameInstance.getCallTarget(), frameInstance.getFrame(FrameAccess.READ_ONLY, true), frameInstance.isVirtualFrame()); + return null; + }); return str.toString(); }