Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLStackTraceBuiltin.java @ 15097:a1b0d7a1ef40
SL: Make SLStackTraceBuilting comfortable with non-graal runtimes.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 14 Apr 2014 22:36:42 +0200 |
parents | d3add9b82b71 |
children | a3b0ecef8a15 |
comparison
equal
deleted
inserted
replaced
15096:dcc0f31b2bfb | 15097:a1b0d7a1ef40 |
---|---|
43 } | 43 } |
44 | 44 |
45 @SlowPath | 45 @SlowPath |
46 private static String createStackTrace() { | 46 private static String createStackTrace() { |
47 StringBuilder str = new StringBuilder(); | 47 StringBuilder str = new StringBuilder(); |
48 for (FrameInstance frame : Truffle.getRuntime().getStackTrace()) { | 48 Iterable<FrameInstance> frames = Truffle.getRuntime().getStackTrace(); |
49 dumpFrame(str, frame.getCallTarget(), frame.getFrame(FrameAccess.READ_ONLY, true), frame.isVirtualFrame()); | 49 |
50 if (frames != null) { | |
51 for (FrameInstance frame : frames) { | |
52 dumpFrame(str, frame.getCallTarget(), frame.getFrame(FrameAccess.READ_ONLY, true), frame.isVirtualFrame()); | |
53 } | |
50 } | 54 } |
51 return str.toString(); | 55 return str.toString(); |
52 } | 56 } |
53 | 57 |
54 private static void dumpFrame(StringBuilder str, CallTarget rootNode, Frame frame, boolean isVirtual) { | 58 private static void dumpFrame(StringBuilder str, CallTarget rootNode, Frame frame, boolean isVirtual) { |